summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base')
-rw-r--r--Master/texmf-dist/tex/context/base/anch-bar.mkiv41
-rw-r--r--Master/texmf-dist/tex/context/base/anch-pgr.mkiv38
-rw-r--r--Master/texmf-dist/tex/context/base/anch-pos.lua109
-rw-r--r--Master/texmf-dist/tex/context/base/anch-pos.mkiv24
-rw-r--r--Master/texmf-dist/tex/context/base/anch-snc.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/attr-ini.lua157
-rw-r--r--Master/texmf-dist/tex/context/base/attr-ini.mkiv74
-rw-r--r--Master/texmf-dist/tex/context/base/back-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/back-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/back-pdf.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/back-pdf.mkiv55
-rw-r--r--Master/texmf-dist/tex/context/base/back-u3d.mkiv156
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-bib.lua605
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-bib.mkiv943
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-tra.lua194
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-tra.mkii1778
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-tra.mkiv1552
-rw-r--r--Master/texmf-dist/tex/context/base/bibl-tst.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/blob-ini.lua165
-rw-r--r--Master/texmf-dist/tex/context/base/blob-ini.mkiv34
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ini.lua382
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ini.mkii8
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ini.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ver.mkii10
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ver.mkiv290
-rw-r--r--Master/texmf-dist/tex/context/base/bxml-apa.mkiv613
-rw-r--r--Master/texmf-dist/tex/context/base/catc-ctx.tex16
-rw-r--r--Master/texmf-dist/tex/context/base/catc-def.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/catc-ini.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/catc-ini.mkiv57
-rw-r--r--Master/texmf-dist/tex/context/base/char-act.mkiv13
-rw-r--r--Master/texmf-dist/tex/context/base/char-cmp.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/char-def.lua240
-rw-r--r--Master/texmf-dist/tex/context/base/char-enc.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/char-ini.lua102
-rw-r--r--Master/texmf-dist/tex/context/base/char-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/char-map.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/char-tex.lua89
-rw-r--r--Master/texmf-dist/tex/context/base/char-utf.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/char-utf.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/chem-ini.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/chem-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/chem-str.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/chem-str.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ext.mkii10
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ext.mkiv60
-rw-r--r--Master/texmf-dist/tex/context/base/colo-hex.mkii4
-rw-r--r--Master/texmf-dist/tex/context/base/colo-hex.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ini.lua255
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ini.mkiv133
-rw-r--r--Master/texmf-dist/tex/context/base/colo-new.mkii1857
-rw-r--r--Master/texmf-dist/tex/context/base/colo-new.mkiv331
-rw-r--r--Master/texmf-dist/tex/context/base/colo-new.tex1051
-rw-r--r--Master/texmf-dist/tex/context/base/colo-x11.tex677
-rw-r--r--Master/texmf-dist/tex/context/base/cont-cz.tex35
-rw-r--r--Master/texmf-dist/tex/context/base/cont-fil.tex3
-rw-r--r--Master/texmf-dist/tex/context/base/cont-log.tex66
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.mkiv116
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/cont-uk.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/context-base.lmx68
-rw-r--r--Master/texmf-dist/tex/context/base/context-characters.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context-debug.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context-error.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context-fonttest.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context-help.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context-timing.lmx2
-rw-r--r--Master/texmf-dist/tex/context/base/context.mkii15
-rw-r--r--Master/texmf-dist/tex/context/base/context.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/context.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-bar.tex194
-rw-r--r--Master/texmf-dist/tex/context/base/core-blk.tex676
-rw-r--r--Master/texmf-dist/tex/context/base/core-box.tex953
-rw-r--r--Master/texmf-dist/tex/context/base/core-con.lua176
-rw-r--r--Master/texmf-dist/tex/context/base/core-con.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/core-ctx.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/core-ctx.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/core-def.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/core-def.mkiv38
-rw-r--r--Master/texmf-dist/tex/context/base/core-env.mkiv170
-rw-r--r--Master/texmf-dist/tex/context/base/core-fil.mkiv55
-rw-r--r--Master/texmf-dist/tex/context/base/core-fnt.mkiv183
-rw-r--r--Master/texmf-dist/tex/context/base/core-grd.mkiv1074
-rw-r--r--Master/texmf-dist/tex/context/base/core-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/core-job.lua52
-rw-r--r--Master/texmf-dist/tex/context/base/core-job.mkii5
-rw-r--r--Master/texmf-dist/tex/context/base/core-job.mkiv58
-rw-r--r--Master/texmf-dist/tex/context/base/core-mis.mkiv121
-rw-r--r--Master/texmf-dist/tex/context/base/core-spa.lua720
-rw-r--r--Master/texmf-dist/tex/context/base/core-spa.mkiv4277
-rw-r--r--Master/texmf-dist/tex/context/base/core-sys.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/core-sys.mkiv149
-rw-r--r--Master/texmf-dist/tex/context/base/core-two.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/core-two.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/core-uti.lua33
-rw-r--r--Master/texmf-dist/tex/context/base/core-uti.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/core-var.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/data-aux.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/data-bin.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/data-con.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/data-crl.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/data-ctx.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/data-gen.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/data-inp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/data-lst.lua15
-rw-r--r--Master/texmf-dist/tex/context/base/data-lua.lua125
-rw-r--r--Master/texmf-dist/tex/context/base/data-out.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/data-pre.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/data-res.lua533
-rw-r--r--Master/texmf-dist/tex/context/base/data-sch.lua142
-rw-r--r--Master/texmf-dist/tex/context/base/data-tex.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/data-tmf.lua43
-rw-r--r--Master/texmf-dist/tex/context/base/data-tmp.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/data-tre.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/data-use.lua28
-rw-r--r--Master/texmf-dist/tex/context/base/data-zip.lua78
-rw-r--r--Master/texmf-dist/tex/context/base/enco-def.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ffr.mkii4
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ini.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ini.mkiv144
-rw-r--r--Master/texmf-dist/tex/context/base/enco-l7x.mkii236
-rw-r--r--Master/texmf-dist/tex/context/base/font-afm.lua133
-rw-r--r--Master/texmf-dist/tex/context/base/font-agl.lua3695
-rw-r--r--Master/texmf-dist/tex/context/base/font-chk.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/font-cid.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/font-col.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/font-col.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/font-ctx.lua314
-rw-r--r--Master/texmf-dist/tex/context/base/font-def.lua140
-rw-r--r--Master/texmf-dist/tex/context/base/font-dum.lua221
-rw-r--r--Master/texmf-dist/tex/context/base/font-enc.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/font-enh.lua201
-rw-r--r--Master/texmf-dist/tex/context/base/font-ext.lua440
-rw-r--r--Master/texmf-dist/tex/context/base/font-fbk.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/font-gds.lua294
-rw-r--r--Master/texmf-dist/tex/context/base/font-gds.mkiv83
-rw-r--r--Master/texmf-dist/tex/context/base/font-ini.lua58
-rw-r--r--Master/texmf-dist/tex/context/base/font-ini.mkii30
-rw-r--r--Master/texmf-dist/tex/context/base/font-ini.mkiv691
-rw-r--r--Master/texmf-dist/tex/context/base/font-log.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/font-map.lua390
-rw-r--r--Master/texmf-dist/tex/context/base/font-mis.lua28
-rw-r--r--Master/texmf-dist/tex/context/base/font-ota.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/font-otb.lua228
-rw-r--r--Master/texmf-dist/tex/context/base/font-otc.lua29
-rw-r--r--Master/texmf-dist/tex/context/base/font-otd.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/font-otf.lua654
-rw-r--r--Master/texmf-dist/tex/context/base/font-oti.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/font-otn.lua630
-rw-r--r--Master/texmf-dist/tex/context/base/font-otp.lua156
-rw-r--r--Master/texmf-dist/tex/context/base/font-ott.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/font-pat.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/font-run.mkiv45
-rw-r--r--Master/texmf-dist/tex/context/base/font-syn.lua1273
-rw-r--r--Master/texmf-dist/tex/context/base/font-tfm.lua455
-rw-r--r--Master/texmf-dist/tex/context/base/font-tra.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/font-vf.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/font-xtx.lua27
-rw-r--r--Master/texmf-dist/tex/context/base/font-xtx.mkii49
-rw-r--r--Master/texmf-dist/tex/context/base/grph-fig.mkiv160
-rw-r--r--Master/texmf-dist/tex/context/base/grph-fil.lua42
-rw-r--r--Master/texmf-dist/tex/context/base/grph-inc.lua530
-rw-r--r--Master/texmf-dist/tex/context/base/grph-inc.mkii5
-rw-r--r--Master/texmf-dist/tex/context/base/grph-inc.mkiv29
-rw-r--r--Master/texmf-dist/tex/context/base/grph-swf.lua43
-rw-r--r--Master/texmf-dist/tex/context/base/grph-trf.mkii4
-rw-r--r--Master/texmf-dist/tex/context/base/grph-trf.mkiv21
-rw-r--r--Master/texmf-dist/tex/context/base/grph-u3d.lua48
-rw-r--r--Master/texmf-dist/tex/context/base/hand-ini.mkiv34
-rw-r--r--Master/texmf-dist/tex/context/base/java-ini.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/l-aux.lua108
-rw-r--r--Master/texmf-dist/tex/context/base/l-boolean.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/l-dimen.lua109
-rw-r--r--Master/texmf-dist/tex/context/base/l-dir.lua152
-rw-r--r--Master/texmf-dist/tex/context/base/l-file.lua148
-rw-r--r--Master/texmf-dist/tex/context/base/l-io.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/l-lpeg.lua157
-rw-r--r--Master/texmf-dist/tex/context/base/l-math.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/l-md5.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/l-number.lua23
-rw-r--r--Master/texmf-dist/tex/context/base/l-os.lua305
-rw-r--r--Master/texmf-dist/tex/context/base/l-pdfview.lua95
-rw-r--r--Master/texmf-dist/tex/context/base/l-set.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/l-string.lua83
-rw-r--r--Master/texmf-dist/tex/context/base/l-table.lua163
-rw-r--r--Master/texmf-dist/tex/context/base/l-unicode.lua39
-rw-r--r--Master/texmf-dist/tex/context/base/l-url.lua49
-rw-r--r--Master/texmf-dist/tex/context/base/l-utils.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/l-xml.lua2442
-rw-r--r--Master/texmf-dist/tex/context/base/lang-alt.tex91
-rw-r--r--Master/texmf-dist/tex/context/base/lang-bal.tex108
-rw-r--r--Master/texmf-dist/tex/context/base/lang-cjk.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ger.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ini.lua281
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ini.mkii42
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ini.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ita.tex52
-rw-r--r--Master/texmf-dist/tex/context/base/lang-lab.mkiv76
-rw-r--r--Master/texmf-dist/tex/context/base/lang-mis.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/lang-sla.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-url.lua136
-rw-r--r--Master/texmf-dist/tex/context/base/lang-url.mkiv13
-rw-r--r--Master/texmf-dist/tex/context/base/lang-wrd.lua225
-rw-r--r--Master/texmf-dist/tex/context/base/lang-wrd.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ano.lua140
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-col.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-fld.lua334
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-grp.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ini.lua461
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ini.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-mis.lua133
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-nod.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-pdx.lua139
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-pdx.mkiv71
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ren.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-swf.lua109
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-u3d.lua127
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-wid.lua95
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-xmp.lua165
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-xmp.xml43
-rw-r--r--Master/texmf-dist/tex/context/base/luat-cbk.lua128
-rw-r--r--Master/texmf-dist/tex/context/base/luat-cnf.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/luat-cod.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/luat-dum.lua69
-rw-r--r--Master/texmf-dist/tex/context/base/luat-env.lua78
-rw-r--r--Master/texmf-dist/tex/context/base/luat-exe.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/luat-fio.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/luat-ini.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/luat-ini.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/luat-iop.lua167
-rw-r--r--Master/texmf-dist/tex/context/base/luat-lib.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/luat-lua.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/luat-run.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/luat-sta.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/luat-sto.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-aux.lua543
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ctx.lua131
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ctx.mkiv64
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-dir.lua112
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ent.lua124
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-inf.lua53
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ini.lua1138
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-ini.mkiv360
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-lpt.lua1259
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-mis.lua57
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-pth.lua1555
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-sor.lua158
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-sor.mkiv94
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-tab.lua1025
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-tex.lua1410
-rw-r--r--Master/texmf-dist/tex/context/base/lxml-xml.lua288
-rw-r--r--Master/texmf-dist/tex/context/base/m-barcodes.mkiv122
-rw-r--r--Master/texmf-dist/tex/context/base/m-chart.mkii48
-rw-r--r--Master/texmf-dist/tex/context/base/m-chart.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/m-chart.tex36
-rw-r--r--Master/texmf-dist/tex/context/base/m-chemic.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/m-database.tex60
-rw-r--r--Master/texmf-dist/tex/context/base/m-directives.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/m-graph.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/m-narrowtt.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/m-obsolete.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/m-pstricks.lua73
-rw-r--r--Master/texmf-dist/tex/context/base/m-pstricks.mkii (renamed from Master/texmf-dist/tex/context/base/m-pstric.tex)16
-rw-r--r--Master/texmf-dist/tex/context/base/m-pstricks.mkiv66
-rw-r--r--Master/texmf-dist/tex/context/base/m-pstricks.tex (renamed from Master/texmf-dist/tex/context/base/type-one.tex)10
-rw-r--r--Master/texmf-dist/tex/context/base/m-punk.mkiv243
-rw-r--r--Master/texmf-dist/tex/context/base/m-punk.tex233
-rw-r--r--Master/texmf-dist/tex/context/base/m-steps.mkii83
-rw-r--r--Master/texmf-dist/tex/context/base/m-steps.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/m-steps.tex69
-rw-r--r--Master/texmf-dist/tex/context/base/m-timing.tex26
-rw-r--r--Master/texmf-dist/tex/context/base/m-trackers.tex (renamed from Master/texmf-dist/tex/context/base/m-track.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/m-translate.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/math-ali.mkiv273
-rw-r--r--Master/texmf-dist/tex/context/base/math-arr.mkiv74
-rw-r--r--Master/texmf-dist/tex/context/base/math-def.mkiv128
-rw-r--r--Master/texmf-dist/tex/context/base/math-dim.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/math-ent.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/math-ext.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/math-for.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.mkii5
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.mkiv199
-rw-r--r--Master/texmf-dist/tex/context/base/math-inl.mkiv339
-rw-r--r--Master/texmf-dist/tex/context/base/math-int.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/math-lan.mkiv67
-rw-r--r--Master/texmf-dist/tex/context/base/math-lbr.mkii67
-rw-r--r--Master/texmf-dist/tex/context/base/math-map.lua287
-rw-r--r--Master/texmf-dist/tex/context/base/math-noa.lua78
-rw-r--r--Master/texmf-dist/tex/context/base/math-pln.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/math-run.mkii54
-rw-r--r--Master/texmf-dist/tex/context/base/math-scr.mkiv88
-rw-r--r--Master/texmf-dist/tex/context/base/math-tex.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/math-vfu.lua880
-rw-r--r--Master/texmf-dist/tex/context/base/meta-dum.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-fig.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-fun.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-ini.mkii8
-rw-r--r--Master/texmf-dist/tex/context/base/meta-ini.mkiv133
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdf.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdh.lua58
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdh.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-tex.mkii11
-rw-r--r--Master/texmf-dist/tex/context/base/meta-tex.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-txt.tex24
-rw-r--r--Master/texmf-dist/tex/context/base/metatex.tex27
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-ctx.lua39
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-pdf.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-pps.lua212
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-pps.mkiv49
-rw-r--r--Master/texmf-dist/tex/context/base/mlib-run.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-arrange.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-combine.tex70
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-common.tex43
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-ideas.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-listing.tex74
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-timing.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/mult-chk.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mult-cld.lua170
-rw-r--r--Master/texmf-dist/tex/context/base/mult-cld.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/mult-clm.lua184
-rw-r--r--Master/texmf-dist/tex/context/base/mult-de.tex69
-rw-r--r--Master/texmf-dist/tex/context/base/mult-def.lua335
-rw-r--r--Master/texmf-dist/tex/context/base/mult-en.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/mult-fr.tex69
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ini.lua47
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ini.mkiv62
-rw-r--r--Master/texmf-dist/tex/context/base/mult-it.tex69
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mcs.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mde.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-men.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mes.lua43
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mfr.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mit.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mnl.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mno.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mpe.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-mro.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/mult-nl.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ro.tex69
-rw-r--r--Master/texmf-dist/tex/context/base/mult-sys.tex75
-rw-r--r--Master/texmf-dist/tex/context/base/node-aux.lua145
-rw-r--r--Master/texmf-dist/tex/context/base/node-bck.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/node-bck.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/node-dir.lua308
-rw-r--r--Master/texmf-dist/tex/context/base/node-ext.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/node-fin.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/node-fin.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/node-fnt.lua11
-rw-r--r--Master/texmf-dist/tex/context/base/node-ini.lua50
-rw-r--r--Master/texmf-dist/tex/context/base/node-ini.mkiv30
-rw-r--r--Master/texmf-dist/tex/context/base/node-inj.lua135
-rw-r--r--Master/texmf-dist/tex/context/base/node-mig.lua120
-rw-r--r--Master/texmf-dist/tex/context/base/node-mig.mkiv60
-rw-r--r--Master/texmf-dist/tex/context/base/node-pag.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/node-pag.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/node-par.lua88
-rw-r--r--Master/texmf-dist/tex/context/base/node-par.mkiv40
-rw-r--r--Master/texmf-dist/tex/context/base/node-pro.lua32
-rw-r--r--Master/texmf-dist/tex/context/base/node-ref.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/node-res.lua230
-rw-r--r--Master/texmf-dist/tex/context/base/node-rul.lua288
-rw-r--r--Master/texmf-dist/tex/context/base/node-rul.mkiv343
-rw-r--r--Master/texmf-dist/tex/context/base/node-seq.lua104
-rw-r--r--Master/texmf-dist/tex/context/base/node-ser.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/node-shp.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/node-tex.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/node-tra.lua94
-rw-r--r--Master/texmf-dist/tex/context/base/node-tsk.lua167
-rw-r--r--Master/texmf-dist/tex/context/base/node-tst.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/node-typ.lua53
-rw-r--r--Master/texmf-dist/tex/context/base/pack-box.mkii16
-rw-r--r--Master/texmf-dist/tex/context/base/pack-box.mkiv31
-rw-r--r--Master/texmf-dist/tex/context/base/pack-lyr.mkiv20
-rw-r--r--Master/texmf-dist/tex/context/base/pack-obj.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/pack-obj.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/pack-rul.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/pack-rul.mkiv273
-rw-r--r--Master/texmf-dist/tex/context/base/page-app.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/page-bck.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/page-flt.lua227
-rw-r--r--Master/texmf-dist/tex/context/base/page-flt.mkiv233
-rw-r--r--Master/texmf-dist/tex/context/base/page-flw.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/page-imp.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/page-ini.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/page-ini.mkiv164
-rw-r--r--Master/texmf-dist/tex/context/base/page-lay.mkiv69
-rw-r--r--Master/texmf-dist/tex/context/base/page-lin.lua238
-rw-r--r--Master/texmf-dist/tex/context/base/page-lin.mkiv286
-rw-r--r--Master/texmf-dist/tex/context/base/page-mak.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/page-mar.mkiv17
-rw-r--r--Master/texmf-dist/tex/context/base/page-mis.mkiv127
-rw-r--r--Master/texmf-dist/tex/context/base/page-mul.mkiv180
-rw-r--r--Master/texmf-dist/tex/context/base/page-not.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/page-one.mkiv172
-rw-r--r--Master/texmf-dist/tex/context/base/page-par.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/page-plg.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/page-set.mkii369
-rw-r--r--Master/texmf-dist/tex/context/base/page-set.mkiv506
-rw-r--r--Master/texmf-dist/tex/context/base/page-sid.mkiv99
-rw-r--r--Master/texmf-dist/tex/context/base/page-spr.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/page-str.lua221
-rw-r--r--Master/texmf-dist/tex/context/base/page-str.mkiv438
-rw-r--r--Master/texmf-dist/tex/context/base/page-txt.mkiv121
-rw-r--r--Master/texmf-dist/tex/context/base/ppchtex.mkii101
-rw-r--r--Master/texmf-dist/tex/context/base/ppchtex.mkiv113
-rw-r--r--Master/texmf-dist/tex/context/base/pret-lua.lua147
-rw-r--r--Master/texmf-dist/tex/context/base/pret-mp.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/pret-tex.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/pret-xml.lua136
-rw-r--r--Master/texmf-dist/tex/context/base/prop-ini.mkiv22
-rw-r--r--Master/texmf-dist/tex/context/base/prop-lay.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/prop-mis.mkiv46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-1.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-10.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-11.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-13.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-14.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-15.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-16.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-2.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-3.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-4.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-5.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-6.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-7.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-8.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-8859-9.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1250.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1251.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1252.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1253.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1254.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1255.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1256.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1257.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1258.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/regi-utf.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/s-abr-01.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/s-chi-00.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/s-fnt-10.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/s-fnt-25.tex40
-rw-r--r--Master/texmf-dist/tex/context/base/s-fnt-26.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/s-inf-01.tex203
-rw-r--r--Master/texmf-dist/tex/context/base/s-inf-02.tex27
-rw-r--r--Master/texmf-dist/tex/context/base/s-map-10.tex3
-rw-r--r--Master/texmf-dist/tex/context/base/s-mod-00.tex11
-rw-r--r--Master/texmf-dist/tex/context/base/s-mod-01.tex17
-rw-r--r--Master/texmf-dist/tex/context/base/s-mod.ctx24
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-60.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-64.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/s-ptj-01.tex166
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-bar.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-but.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-fld.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-fld.mkiv105
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-hlp.mkiv46
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-int.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-int.mkii24
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-int.mkiv67
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-men.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-nav.mkiv28
-rw-r--r--Master/texmf-dist/tex/context/base/scrp-cjk.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/scrp-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/scrp-ini.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/sort-ini.lua320
-rw-r--r--Master/texmf-dist/tex/context/base/sort-lan.lua402
-rw-r--r--Master/texmf-dist/tex/context/base/sort-lan.mkii74
-rw-r--r--Master/texmf-dist/tex/context/base/spac-ali.mkiv677
-rw-r--r--Master/texmf-dist/tex/context/base/spac-def.mkiv118
-rw-r--r--Master/texmf-dist/tex/context/base/spac-fnt.mkiv94
-rw-r--r--Master/texmf-dist/tex/context/base/spac-gen.mkii (renamed from Master/texmf-dist/tex/context/base/core-spa.mkii)40
-rw-r--r--Master/texmf-dist/tex/context/base/spac-grd.mkii (renamed from Master/texmf-dist/tex/context/base/core-grd.mkii)0
-rw-r--r--Master/texmf-dist/tex/context/base/spac-grd.mkiv259
-rw-r--r--Master/texmf-dist/tex/context/base/spac-hor.lua32
-rw-r--r--Master/texmf-dist/tex/context/base/spac-hor.mkiv946
-rw-r--r--Master/texmf-dist/tex/context/base/spac-pag.mkiv199
-rw-r--r--Master/texmf-dist/tex/context/base/spac-par.mkiv192
-rw-r--r--Master/texmf-dist/tex/context/base/spac-ver.lua1185
-rw-r--r--Master/texmf-dist/tex/context/base/spac-ver.mkiv2078
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dpm.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dpx.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/spec-fdf.mkii229
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tpd.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tst.mkii102
-rw-r--r--Master/texmf-dist/tex/context/base/strc-bkm.lua52
-rw-r--r--Master/texmf-dist/tex/context/base/strc-bkm.mkiv5
-rw-r--r--Master/texmf-dist/tex/context/base/strc-blk.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/strc-blk.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/strc-def.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/strc-des.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-des.mkiv390
-rw-r--r--Master/texmf-dist/tex/context/base/strc-doc.lua163
-rw-r--r--Master/texmf-dist/tex/context/base/strc-doc.mkiv84
-rw-r--r--Master/texmf-dist/tex/context/base/strc-flt.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-flt.mkiv409
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ini.lua42
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ini.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/strc-itm.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-itm.mkii33
-rw-r--r--Master/texmf-dist/tex/context/base/strc-itm.mkiv347
-rw-r--r--Master/texmf-dist/tex/context/base/strc-lnt.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/strc-lst.lua255
-rw-r--r--Master/texmf-dist/tex/context/base/strc-lst.mkiv91
-rw-r--r--Master/texmf-dist/tex/context/base/strc-mar.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-mar.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/strc-mat.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-mat.mkiv962
-rw-r--r--Master/texmf-dist/tex/context/base/strc-not.lua75
-rw-r--r--Master/texmf-dist/tex/context/base/strc-not.mkii32
-rw-r--r--Master/texmf-dist/tex/context/base/strc-not.mkiv405
-rw-r--r--Master/texmf-dist/tex/context/base/strc-num.lua98
-rw-r--r--Master/texmf-dist/tex/context/base/strc-num.mkiv110
-rw-r--r--Master/texmf-dist/tex/context/base/strc-pag.lua110
-rw-r--r--Master/texmf-dist/tex/context/base/strc-pag.mkiv97
-rw-r--r--Master/texmf-dist/tex/context/base/strc-prc.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-prc.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ref.lua641
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ref.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ref.mkiv290
-rw-r--r--Master/texmf-dist/tex/context/base/strc-reg.lua245
-rw-r--r--Master/texmf-dist/tex/context/base/strc-reg.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/strc-reg.mkiv282
-rw-r--r--Master/texmf-dist/tex/context/base/strc-ren.mkiv95
-rw-r--r--Master/texmf-dist/tex/context/base/strc-sbe.mkiv11
-rw-r--r--Master/texmf-dist/tex/context/base/strc-sec.mkiv244
-rw-r--r--Master/texmf-dist/tex/context/base/strc-syn.lua42
-rw-r--r--Master/texmf-dist/tex/context/base/strc-syn.mkiv103
-rw-r--r--Master/texmf-dist/tex/context/base/strc-xml.mkiv18
-rw-r--r--Master/texmf-dist/tex/context/base/supp-box.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/supp-dir.mkiv23
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.lua201
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.mkiv199
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mat.mkii (renamed from Master/texmf-dist/tex/context/base/supp-mat.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mat.mkiv293
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mis.mkii27
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mis.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mpe.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mps.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/supp-num.tex23
-rw-r--r--Master/texmf-dist/tex/context/base/supp-pdf.tex3
-rw-r--r--Master/texmf-dist/tex/context/base/supp-ran.lua31
-rw-r--r--Master/texmf-dist/tex/context/base/supp-vis.tex11
-rw-r--r--Master/texmf-dist/tex/context/base/symb-ini.mkiv10
-rw-r--r--Master/texmf-dist/tex/context/base/syst-aux.mkiv246
-rw-r--r--Master/texmf-dist/tex/context/base/syst-con.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ext.mkii29
-rw-r--r--Master/texmf-dist/tex/context/base/syst-gen.mkii10
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ini.tex17
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ltx.tex56
-rw-r--r--Master/texmf-dist/tex/context/base/syst-lua.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-com.mkii (renamed from Master/texmf-dist/tex/context/base/type-tmf.tex)17
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-com.mkiv21
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ltb.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ltb.mkiv30
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ntb.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ntb.mkiv100
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tab.mkiv81
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tbl.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tbl.mkiv108
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tsp.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/task-ini.lua101
-rw-r--r--Master/texmf-dist/tex/context/base/toks-ini.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/toks-ini.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/trac-deb.lua73
-rw-r--r--Master/texmf-dist/tex/context/base/trac-deb.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/trac-inf.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/trac-lmx.lua263
-rw-r--r--Master/texmf-dist/tex/context/base/trac-log.lua70
-rw-r--r--Master/texmf-dist/tex/context/base/trac-tex.mkiv19
-rw-r--r--Master/texmf-dist/tex/context/base/trac-tim.lua101
-rw-r--r--Master/texmf-dist/tex/context/base/trac-tra.lua180
-rw-r--r--Master/texmf-dist/tex/context/base/type-buy.mkii (renamed from Master/texmf-dist/tex/context/base/type-buy.tex)230
-rw-r--r--Master/texmf-dist/tex/context/base/type-buy.mkiv82
-rw-r--r--Master/texmf-dist/tex/context/base/type-cbg.mkii (renamed from Master/texmf-dist/tex/context/base/type-cbg.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-cow.mkii (renamed from Master/texmf-dist/tex/context/base/type-cow.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-cow.mkiv85
-rw-r--r--Master/texmf-dist/tex/context/base/type-def.mkii86
-rw-r--r--Master/texmf-dist/tex/context/base/type-def.mkiv48
-rw-r--r--Master/texmf-dist/tex/context/base/type-def.tex128
-rw-r--r--Master/texmf-dist/tex/context/base/type-exp.mkii (renamed from Master/texmf-dist/tex/context/base/type-exp.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-fsf.mkii (renamed from Master/texmf-dist/tex/context/base/type-fsf.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-ghz.mkii (renamed from Master/texmf-dist/tex/context/base/type-ghz.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-ghz.mkiv (renamed from Master/texmf-dist/tex/context/base/type-hgz.tex)6
-rw-r--r--Master/texmf-dist/tex/context/base/type-hgz.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/type-hgz.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/type-husayni-default.mkiv146
-rw-r--r--Master/texmf-dist/tex/context/base/type-ini.mkii19
-rw-r--r--Master/texmf-dist/tex/context/base/type-ini.mkiv296
-rw-r--r--Master/texmf-dist/tex/context/base/type-lua.mkiv88
-rw-r--r--Master/texmf-dist/tex/context/base/type-mac.mkii373
-rw-r--r--Master/texmf-dist/tex/context/base/type-mac.mkiv373
-rw-r--r--Master/texmf-dist/tex/context/base/type-mac.tex434
-rw-r--r--Master/texmf-dist/tex/context/base/type-msw.mkii1
-rw-r--r--Master/texmf-dist/tex/context/base/type-msw.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/type-one.mkii3867
-rw-r--r--Master/texmf-dist/tex/context/base/type-one.mkiv99
-rw-r--r--Master/texmf-dist/tex/context/base/type-otf.mkii2426
-rw-r--r--Master/texmf-dist/tex/context/base/type-otf.mkiv2162
-rw-r--r--Master/texmf-dist/tex/context/base/type-otf.tex155
-rw-r--r--Master/texmf-dist/tex/context/base/type-pre.mkii (renamed from Master/texmf-dist/tex/context/base/type-pre.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/type-run.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/type-set.mkii81
-rw-r--r--Master/texmf-dist/tex/context/base/type-set.mkiv77
-rw-r--r--Master/texmf-dist/tex/context/base/type-siz.mkii157
-rw-r--r--Master/texmf-dist/tex/context/base/type-siz.mkiv159
-rw-r--r--Master/texmf-dist/tex/context/base/type-siz.tex179
-rw-r--r--Master/texmf-dist/tex/context/base/type-tmf.mkii1147
-rw-r--r--Master/texmf-dist/tex/context/base/type-tmf.mkiv919
-rw-r--r--Master/texmf-dist/tex/context/base/type-win.mkii (renamed from Master/texmf-dist/tex/context/base/type-msw.tex)2
-rw-r--r--Master/texmf-dist/tex/context/base/type-win.mkiv (renamed from Master/texmf-dist/tex/context/base/type-win.tex)34
-rw-r--r--Master/texmf-dist/tex/context/base/type-xtx.mkii (renamed from Master/texmf-dist/tex/context/base/type-xtx.tex)1
-rw-r--r--Master/texmf-dist/tex/context/base/typo-brk.lua119
-rw-r--r--Master/texmf-dist/tex/context/base/typo-brk.mkiv46
-rw-r--r--Master/texmf-dist/tex/context/base/typo-cap.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/typo-cap.mkiv22
-rw-r--r--Master/texmf-dist/tex/context/base/typo-dig.lua106
-rw-r--r--Master/texmf-dist/tex/context/base/typo-dig.mkiv51
-rw-r--r--Master/texmf-dist/tex/context/base/typo-krn.lua84
-rw-r--r--Master/texmf-dist/tex/context/base/typo-krn.mkiv60
-rw-r--r--Master/texmf-dist/tex/context/base/typo-mir.lua63
-rw-r--r--Master/texmf-dist/tex/context/base/typo-mir.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/typo-rep.lua135
-rw-r--r--Master/texmf-dist/tex/context/base/typo-rep.mkiv53
-rw-r--r--Master/texmf-dist/tex/context/base/typo-spa.lua27
-rw-r--r--Master/texmf-dist/tex/context/base/typo-spa.mkiv12
-rw-r--r--Master/texmf-dist/tex/context/base/unic-031.mkii10
-rw-r--r--Master/texmf-dist/tex/context/base/verb-eif.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/verb-ini.mkii25
-rw-r--r--Master/texmf-dist/tex/context/base/verb-js.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/verb-jv.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/verb-pas.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/verb-raw.mkii6
-rw-r--r--Master/texmf-dist/tex/context/base/verb-sql.mkii2
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.lua267
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.mkiv96
-rw-r--r--Master/texmf-dist/tex/context/base/x-calcmath.lua289
-rw-r--r--Master/texmf-dist/tex/context/base/x-calcmath.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/x-cals.lua209
-rw-r--r--Master/texmf-dist/tex/context/base/x-cals.mkiv207
-rw-r--r--Master/texmf-dist/tex/context/base/x-chemml.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/x-contml.mkii (renamed from Master/texmf-dist/tex/context/base/x-contml.tex)2
-rw-r--r--Master/texmf-dist/tex/context/base/x-corres.mkii (renamed from Master/texmf-dist/tex/context/base/x-corres.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/x-ct.lua182
-rw-r--r--Master/texmf-dist/tex/context/base/x-ct.mkiv179
-rw-r--r--Master/texmf-dist/tex/context/base/x-dir-05.mkii51
-rw-r--r--Master/texmf-dist/tex/context/base/x-dir-05.mkiv72
-rw-r--r--Master/texmf-dist/tex/context/base/x-fe.mkii (renamed from Master/texmf-dist/tex/context/base/x-fe.tex)0
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-03.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/x-fo.mkii (renamed from Master/texmf-dist/tex/context/base/x-fo.tex)38
-rw-r--r--Master/texmf-dist/tex/context/base/x-foxet.mkii28
-rw-r--r--Master/texmf-dist/tex/context/base/x-foxet.mkiv29
-rw-r--r--Master/texmf-dist/tex/context/base/x-foxet.tex15
-rw-r--r--Master/texmf-dist/tex/context/base/x-ldx.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/x-mathml.lua331
-rw-r--r--Master/texmf-dist/tex/context/base/x-mathml.mkiv77
-rw-r--r--Master/texmf-dist/tex/context/base/x-pending.mkiv39
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-11.mkii556
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-11.mkiv566
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-11.tex890
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-12.tex17
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-99.tex283
-rw-r--r--Master/texmf-dist/tex/context/base/x-xtag.mkiv23
667 files changed, 61598 insertions, 39418 deletions
diff --git a/Master/texmf-dist/tex/context/base/anch-bar.mkiv b/Master/texmf-dist/tex/context/base/anch-bar.mkiv
index d08573c0f60..1013e76096f 100644
--- a/Master/texmf-dist/tex/context/base/anch-bar.mkiv
+++ b/Master/texmf-dist/tex/context/base/anch-bar.mkiv
@@ -56,7 +56,7 @@
\newcount\currentsidebar
\newdimen\sidebardistance
-\def\setupsidebars
+\unexpanded\def\setupsidebars
{\dodoubleargument\dosetupsidebars}
\def\dosetupsidebars[#1][#2]%
@@ -77,7 +77,7 @@
\c!rulecolor=red,
\c!distance=.5\bodyfontsize]
-\def\definesidebar
+\unexpanded\def\definesidebar
{\dodoubleempty\dodefinesidebar}
\def\dodefinesidebar[#1][#2]%
@@ -87,7 +87,7 @@
\getparameters
[\??br#1][#2]}
-\def\startsidebar
+\unexpanded\def\startsidebar
{\dosingleempty\dostartsidebar}
\def\dostartsidebar[#1]%
@@ -115,34 +115,19 @@
% \def\dostopsidebar#1%
% {\removelastspace\tpos{side:#1}\carryoverpar\egroup}
-\def\stopsidebar
+\unexpanded\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}{}%
+ \startMPpositiongraphic{mpos:bar}{linecolor,linewidth,distance}%
+ position_anchor_bar (
+ \MPp\MPbself, \MPp\MPeself,
+ \MPy\MPbself, \MPy\MPeself,
+ \MPh\MPbself, \MPd\MPeself,
+ \MPvar{distance}, \MPvar{linewidth}, \MPvar{linecolor}
+ ) ;
+ \stopMPpositiongraphic
+ \MPpositiongraphic{mpos:bar}{}%
\stopMPpositionmethod
%D We now reimplement the margin rules handler defined in
diff --git a/Master/texmf-dist/tex/context/base/anch-pgr.mkiv b/Master/texmf-dist/tex/context/base/anch-pgr.mkiv
index c558bb04fa8..248b9ca5e31 100644
--- a/Master/texmf-dist/tex/context/base/anch-pgr.mkiv
+++ b/Master/texmf-dist/tex/context/base/anch-pgr.mkiv
@@ -76,7 +76,7 @@
\fi
\fi\fi}
-\def\placepositionanchors % todo : depth pagebox
+\unexpanded\def\placepositionanchors % todo : depth pagebox
{\ifpositioning
\setbox\scratchbox\vbox to \textheight
{\simpletopskipcorrection
@@ -145,7 +145,7 @@
% obsolete and wrong anyway
%
-% \long\def\defineMPpositiongraphic#1%
+% \long\unexpanded\def\defineMPpositiongraphic#1%
% {\long\setvalue{\MPoverlayposprefix#1}}
%D The rest of the definitions concerning such overlays may
@@ -180,14 +180,14 @@
\vfill}%
\fi}
-\def\startpositionoverlay#1%
+\unexpanded\def\startpositionoverlay#1%
{\iftrialtypesetting % we don't want redundant entries in the list
\@EA\gobbleuntil\@EA\stoppositionoverlay
\else
\def\currentpositionoverlay{#1}%
\fi}
-\def\stoppositionoverlay
+\unexpanded\def\stoppositionoverlay
{\let\currentpositionoverlay\empty}
\def\resetpositionoverlay#1%
@@ -741,15 +741,15 @@
lineradius=\textbackgroundparameter\c!radius}}%
\stoppositionoverlay}
-\def\stoptextbackground
+\unexpanded\def\stoptextbackground
{\dodostoptextbackground
\carryoverpar\egroup}
-\def\starttextbackgroundmanual
+\unexpanded\def\starttextbackgroundmanual
{\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
\fpos\currentparbackground\ignorespaces}
-\def\stoptextbackgroundmanual
+\unexpanded\def\stoptextbackgroundmanual
{\tpos\currentparbackground
\dostopattributes}
@@ -797,7 +797,7 @@
%
\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
\nowhitespace
-\nobreak % new per 23/04/2006 (else potential break when whitespace)
+ \nobreak % new per 23/04/2006 (else potential break when whitespace)
\seteffectivehsize
\doinhibitblank % \blank[\v!disable]% new
\par}
@@ -816,7 +816,7 @@
\nobreak \vskip-\lineheight \nobreak
\nowhitespace
\egroup
-\bgroup \forgeteverypar % NOT REALLY NEEDED, SAVES HASH/MEM
+ \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)
@@ -828,7 +828,7 @@
\else
\tpos\currentparbackground
\fi
-\egroup
+ \egroup
\endgraf % new
\textbackgroundparameter\c!after}
@@ -900,12 +900,13 @@
\else
\MPy#1-\MPy#2-\MPy\textanchor+\MPy\textanchor+\MPh\textanchor
\fi
- \fi}%
+ \fi
+ \relax}%
\edef\textparwidth
{\the\dimexpr
\ifcase\scratchcounter
% one page
- \dimexpr\MPx#2-\MPx#1%
+ \MPx#2-\MPx#1%
\else
% two or more pages / maybe also hang
\ifx#3\relax
@@ -913,7 +914,8 @@
\else
\MPw\MPparanchor-\MPl\MPparanchor-\MPr\MPparanchor
\fi
- \fi}}
+ \fi
+ \relax}}
\def\mintextparheight{4\lineheight}
@@ -935,7 +937,7 @@
\fi
\fi}
-\def\definetextbackground
+\unexpanded\def\definetextbackground
{\dodoubleempty\dodefinetextbackground}
\def\dodefinetextbackground[#1][#2]% parent and ..parameter
@@ -948,13 +950,13 @@
\c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]%
\getparameters[\??td#1][#2]%
\doifvalue{\??td#1\c!state}\v!start\checktextbackgrounds
- \unexpanded\setvalue{#1}%
+ \setuvalue{#1}%
{\groupedcommand{\starttextbackground[#1]}{\stoptextbackground}}%
\setvalue{\e!start#1}{\starttextbackground[#1]}%
\setvalue{\e!stop #1}{\stoptextbackground}%
\fi}
-\def\setuptextbackground
+\unexpanded\def\setuptextbackground
{\dodoubleargument\dosetuptextbackground}
\def\dosetuptextbackground[#1][#2]%
@@ -1029,6 +1031,8 @@
linecolor=blue,
linewidth=1pt]
+% these might become macros in mp-page
+
\startuseMPgraphic{mpos:common:ec}
path pa ; pair ca ; color lc ; numeric lw ;
lw := \MPvar{linewidth} ;
@@ -1632,7 +1636,7 @@
\copyposition{e:#1}{e:#2}%
\dosetpositionaction{b:#2}{\dopositionaction{b:#1}}}
-\def\definepositionframed
+\unexpanded\def\definepositionframed
{\dodoubleargument\dodefinepositionframed}
\def\dodefinepositionframed[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/anch-pos.lua b/Master/texmf-dist/tex/context/base/anch-pos.lua
index b16fac05c9c..8066af4ceba 100644
--- a/Master/texmf-dist/tex/context/base/anch-pos.lua
+++ b/Master/texmf-dist/tex/context/base/anch-pos.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['anch-pos'] = {
version = 1.001,
- comment = "companion to anch-pos.tex",
+ comment = "companion to anch-pos.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -12,7 +12,9 @@ can we store much more information in <l n='lua'/> but it's also
more efficient.</p>
--ldx]]--
-local texprint, concat, format = tex.print, table.concat, string.format
+local concat, format = table.concat, string.format
+local texprint, ctxcatcodes = tex.print, tex.ctxcatcodes
+local lpegmatch = lpeg.match
jobpositions = jobpositions or { }
jobpositions.collected = jobpositions.collected or { }
@@ -50,90 +52,115 @@ function jobpositions.doifelse(name)
commands.testcase(jobpositions.collected[name] or ptbs[name])
end
-function jobpositions.MPp(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[1]) or '0' ) end
-function jobpositions.MPx(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[2]) or '0pt') end
-function jobpositions.MPy(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[3]) or '0pt') end
-function jobpositions.MPw(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[4]) or '0pt') end
-function jobpositions.MPh(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[5]) or '0pt') end
-function jobpositions.MPd(id) local jpi = pcol[id] or ptbs[id] texprint((jpi and jpi[6]) or '0pt') end
-
-
- function jobpositions.MPx(id)
- local jpi = pcol[id] or ptbs[id]
- local x = jpi and jpi[2]
- if x then
- texprint(format('\\the\\dimexpr %s-%s\\relax',x,dx))
- else
- texprint('0pt')
- end
+function jobpositions.MPp(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[1]) or '0' ) end
+function jobpositions.MPx(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[2]) or '0pt') end
+function jobpositions.MPy(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[3]) or '0pt') end
+function jobpositions.MPw(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[4]) or '0pt') end
+function jobpositions.MPh(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[5]) or '0pt') end
+function jobpositions.MPd(id) local jpi = pcol[id] or ptbs[id] texprint(ctxcatcodes,(jpi and jpi[6]) or '0pt') end
+
+
+function jobpositions.MPx(id)
+ local jpi = pcol[id] or ptbs[id]
+ local x = jpi and jpi[2]
+ if x then
+ texprint(ctxcatcodes,format('\\the\\dimexpr%s-%s\\relax',x,dx)) -- no space after dimexpr !
+ else
+ texprint(ctxcatcodes,'0pt')
end
- function jobpositions.MPy(id)
- local jpi = pcol[id] or ptbs[id]
- local y = jpi and jpi[3]
- if y then
- texprint(format('\\the\\dimexpr %s-%s\\relax',y,dy))
- else
- texprint('0pt')
- end
+end
+
+function jobpositions.MPy(id)
+ local jpi = pcol[id] or ptbs[id]
+ local y = jpi and jpi[3]
+ if y then
+ texprint(ctxcatcodes,format('\\the\\dimexpr%s-%s\\relax',y,dy)) -- no space after dimexpr !
+ else
+ texprint(ctxcatcodes,'0pt')
end
+end
-- the following are only for MP so there we can leave out the pt
--- can be writes
+-- can be writes and no format needed any more
function jobpositions.MPxy(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(format('(%s-%s,%s-%s)',jpi[2],dx,jpi[3],dy))
+ texprint(ctxcatcodes,format('(%s-%s,%s-%s)',jpi[2],dx,jpi[3],dy))
+--~ texprint(ctxcatcodes,'(',jpi[2],'-',dx,',',jpi[3],'-',dy,')')
else
- texprint('(0,0)')
+ texprint(ctxcatcodes,'(0,0)')
end
end
+
function jobpositions.MPll(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(format('(%s-%s,%s-%s-%s)',jpi[2],dx,jpi[3],jpi[6],dy))
+ texprint(ctxcatcodes,format('(%s-%s,%s-%s-%s)',jpi[2],dx,jpi[3],jpi[6],dy))
+--~ texprint(ctxcatcodes,'(',jpi[2],'-',dx,',',jpi[3],'-',jpi[6],'-',dy,')')
else
- texprint('(0,0)')
+ texprint(ctxcatcodes,'(0,0)')
end
end
+
function jobpositions.MPlr(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(format('(%s+%s-%s,%s-%s-%s)',jpi[2],jpi[4],dx,jpi[3],jpi[6],dy))
+ texprint(ctxcatcodes,format('(%s+%s-%s,%s-%s-%s)',jpi[2],jpi[4],dx,jpi[3],jpi[6],dy))
+--~ texprint(ctxcatcodes,'(',jpi[2],'+',jpi[4],'-',dx,',',jpi[3],'-',jpi[6],'-',dy,')')
else
- texprint('(0,0)')
+ texprint(ctxcatcodes,'(0,0)')
end
end
+
function jobpositions.MPur(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(format('(%s+%s-%s,%s+%s-%s)',jpi[2],jpi[4],dx,jpi[3],jpi[5],dy))
+ texprint(ctxcatcodes,format('(%s+%s-%s,%s+%s-%s)',jpi[2],jpi[4],dx,jpi[3],jpi[5],dy))
+--~ texprint(ctxcatcodes,'(',jpi[2],'+',jpi[4],'-',dx,',',jpi[3],'+',jpi[5],'-',dy,')')
else
- texprint('(0,0)')
+ texprint(ctxcatcodes,'(0,0)')
end
end
+
function jobpositions.MPul(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(format('(%s-%s,%s+%s-%s)',jpi[2],dx,jpi[3],jpi[5],dy))
+ texprint(ctxcatcodes,format('(%s-%s,%s+%s-%s)',jpi[2],dx,jpi[3],jpi[5],dy))
+--~ texprint(ctxcatcodes,'(',jpi[2],'-',dx,',',jpi[3],'+',jpi[5],'-',dy,')')
else
- texprint('(0,0)')
+ texprint(ctxcatcodes,'(0,0)')
end
end
+
function jobpositions.MPpos(id)
local jpi = pcol[id] or ptbs[id]
if jpi then
- texprint(concat(jpi,',',1,6))
+ texprint(ctxcatcodes,concat(jpi,',',1,6))
else
- texprint('0,0,0,0,0,0')
+ texprint(ctxcatcodes,'0,0,0,0,0,0')
end
end
+
+local splitter = lpeg.Ct(lpeg.splitat(","))
+
function jobpositions.MPplus(id,n,default)
local jpi = pcol[id] or ptbs[id]
- texprint((jpi and jpi[6+n]) or default)
+ if not jpi then
+ texprint(ctxcatcodes,default)
+ else
+ local split = jpi[0]
+ if not split then
+ split = lpegmatch(splitter,jpi[7])
+ jpi[0] = split
+ end
+ texprint(ctxcatcodes,split[n] or default)
+ end
end
+
function jobpositions.MPrest(id,default)
local jpi = pcol[id] or ptbs[id]
- texprint((jpi and jpi[7] and concat(jpi,",",7,#jpi)) or default)
+ -- texprint(ctxcatcodes,(jpi and jpi[7] and concat(jpi,",",7,#jpi)) or default)
+ texprint(ctxcatcodes,(jpi and jpi[7]) or default)
end
diff --git a/Master/texmf-dist/tex/context/base/anch-pos.mkiv b/Master/texmf-dist/tex/context/base/anch-pos.mkiv
index 0ddda9af40f..e454747daf2 100644
--- a/Master/texmf-dist/tex/context/base/anch-pos.mkiv
+++ b/Master/texmf-dist/tex/context/base/anch-pos.mkiv
@@ -205,18 +205,18 @@
% \the\dimexpr\noexpand\lastsavedpositionx\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax
% \the\dimexpr\noexpand\lastsavedpositiony\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax
-\def\MPp #1{\ctxlua{jobpositions.MPp("#1")}}
-\def\MPx #1{\ctxlua{jobpositions.MPx("#1")}}
-\def\MPy #1{\ctxlua{jobpositions.MPy("#1")}}
-\def\MPw #1{\ctxlua{jobpositions.MPw("#1")}}
-\def\MPh #1{\ctxlua{jobpositions.MPh("#1")}}
-\def\MPd #1{\ctxlua{jobpositions.MPd("#1")}}
-\def\MPxy #1{\ctxlua{jobpositions.MPxy("#1")}}
-\def\MPll #1{\ctxlua{jobpositions.MPll("#1")}}
-\def\MPlr #1{\ctxlua{jobpositions.MPlr("#1")}}
-\def\MPur #1{\ctxlua{jobpositions.MPur("#1")}}
-\def\MPul #1{\ctxlua{jobpositions.MPul("#1")}}
-\def\MPpos #1{\ctxlua{jobpositions.MPpos("#1")}}
+\def\MPp #1{\ctxlua{jobpositions.MPp("#1")}}
+\def\MPx #1{\ctxlua{jobpositions.MPx("#1")}}
+\def\MPy #1{\ctxlua{jobpositions.MPy("#1")}}
+\def\MPw #1{\ctxlua{jobpositions.MPw("#1")}}
+\def\MPh #1{\ctxlua{jobpositions.MPh("#1")}}
+\def\MPd #1{\ctxlua{jobpositions.MPd("#1")}}
+\def\MPxy #1{\ctxlua{jobpositions.MPxy("#1")}}
+\def\MPll #1{\ctxlua{jobpositions.MPll("#1")}}
+\def\MPlr #1{\ctxlua{jobpositions.MPlr("#1")}}
+\def\MPur #1{\ctxlua{jobpositions.MPur("#1")}}
+\def\MPul #1{\ctxlua{jobpositions.MPul("#1")}}
+\def\MPpos#1{\ctxlua{jobpositions.MPpos("#1")}}
%D \macros
%D {MPplus, MPrest, MPv, MPvv}
diff --git a/Master/texmf-dist/tex/context/base/anch-snc.mkiv b/Master/texmf-dist/tex/context/base/anch-snc.mkiv
index 1f361011102..f976047c9b9 100644
--- a/Master/texmf-dist/tex/context/base/anch-snc.mkiv
+++ b/Master/texmf-dist/tex/context/base/anch-snc.mkiv
@@ -22,7 +22,7 @@
\ifx\s!preset \undefined \def\s!preset {preset} \fi
\ifx\s!syncpos\undefined \def\s!syncpos{syncpos} \fi
-\def\definesyncpositions[#1]%
+\unexpanded\def\definesyncpositions[#1]%
{\global\let\flushsyncpositions\doflushsyncpositions % only when used
\setcounter{\s!num:\s!syncpos:#1}{0}%
\doglobal\appendtoksonce\csname\s!reset :\s!syncpos:#1\endcsname\to\resetsyncpositions
diff --git a/Master/texmf-dist/tex/context/base/attr-ini.lua b/Master/texmf-dist/tex/context/base/attr-ini.lua
index 535488c35b1..81c2f4744ca 100644
--- a/Master/texmf-dist/tex/context/base/attr-ini.lua
+++ b/Master/texmf-dist/tex/context/base/attr-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['attr-ini'] = {
version = 1.001,
- comment = "companion to attr-ini.tex",
+ 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"
@@ -15,8 +15,10 @@ local concat = table.concat
local texsprint = tex.sprint
local ctxcatcodes = tex.ctxcatcodes
+local unsetvalue = attributes.unsetvalue
--- todo: document this
+-- todo: document this but first reimplement this as it reflects the early
+-- days of luatex / mkiv and we have better ways now
-- nb: attributes: color etc is much slower than normal (marks + literals) but ...
-- nb. too many "0 g"s
@@ -60,7 +62,6 @@ colors.data = colors.data or { }
colors.values = colors.values or { }
colors.registered = colors.registered or { }
-colors.enabled = true
colors.weightgray = true
colors.attribute = attributes.private('color')
colors.selector = attributes.private('colormodel')
@@ -79,10 +80,13 @@ local templates = {
}
local models = {
- all = 1,
- gray = 2,
- rgb = 3,
- cmyk = 4,
+ [interfaces.variables.none] = unsetvalue,
+ black = unsetvalue,
+ bw = unsetvalue,
+ all = 1,
+ gray = 2,
+ rgb = 3,
+ cmyk = 4,
}
colors.model = "all"
@@ -94,8 +98,7 @@ local registered = colors.registered
local numbers = attributes.numbers
local list = attributes.list
-local min = math.min
-local max = math.max
+local min, max, floor = math.min, math.max, math.floor
local nodeinjections = backends.nodeinjections
local codeinjections = backends.codeinjections
@@ -121,10 +124,77 @@ local function cmyktogray(c,m,y,k)
return rgbtogray(cmyktorgb(c,m,y,k))
end
+-- http://en.wikipedia.org/wiki/HSI_color_space
+-- http://nl.wikipedia.org/wiki/HSV_(kleurruimte)
+
+
+local function hsvtorgb(h,s,v)
+ -- h = h % 360
+ local hd = h/60
+ local hf = floor(hd)
+ local hi = hf % 6
+ -- local f = hd - hi
+ local f = hd - hf
+ local p = v * (1 - s)
+ local q = v * (1 - f * s)
+ local t = v * (1 - (1 - f) * s)
+ if hi == 0 then
+ return v, t, p
+ elseif hi == 1 then
+ return q, v, p
+ elseif hi == 2 then
+ return p, v, t
+ elseif hi == 3 then
+ return p, q, v
+ elseif hi == 4 then
+ return t, p, v
+ elseif hi == 5 then
+ return v, p, q
+ else
+ print("error in hsv -> rgb",hi,h,s,v)
+ end
+end
+
+function rgbtohsv(r,g,b)
+ local offset, maximum, other_1, other_2
+ if r >= g and r >= b then
+ offset, maximum, other_1, other_2 = 0, r, g, b
+ elseif g >= r and g >= b then
+ offset, maximum, other_1, other_2 = 2, g, b, r
+ else
+ offset, maximum, other_1, other_2 = 4, b, r, g
+ end
+ if maximum == 0 then
+ return 0, 0, 0
+ end
+ local minimum = other_1 < other_2 and other_1 or other_2
+ if maximum == minimum then
+ return 0, 0, maximum
+ end
+ local delta = maximum - minimum
+ return (offset + (other_1-other_2)/delta)*60, delta/maximum, maximum
+end
+
+function graytorgb(s) -- unweighted
+ return 1-s, 1-s, 1-s
+end
+
+function hsvtogray(h,s,v)
+ return rgb_to_gray(hsv_to_rgb(h,s,v))
+end
+
+function grayto_hsv(s)
+ return 0, 0, s
+end
+
colors.rgbtocmyk = rgbtocmyk
colors.rgbtogray = rgbtogray
colors.cmyktorgb = cmyktorgb
colors.cmyktogray = cmyktogray
+colors.rgbtohsv = rgbtohsv
+colors.hsvtorgb = hsvtorgb
+colors.hsvtogray = hsvtogray
+colors.graytohsv = graytohsv
-- we can share some *data by using s, rgb and cmyk hashes, but
-- normally the amount of colors is not that large; storing the
@@ -192,16 +262,20 @@ local function reviver(data,n)
d = { gray, gray, gray, gray }
logs.report("attributes","unable to revive color %s",n or "?")
else
- local kind, gray, rgb, cmyk = v[1], graycolor(v[2]), rgbcolor(v[3],v[4],v[5]), cmykcolor(v[6],v[7],v[8],v[9])
+ local kind = v[1]
if kind == 2 then
+ local gray= graycolor(v[2])
d = { gray, gray, gray, gray }
elseif kind == 3 then
+ local gray, rgb, cmyk = graycolor(v[2]), rgbcolor(v[3],v[4],v[5]), cmykcolor(v[6],v[7],v[8],v[9])
d = { rgb, gray, rgb, cmyk }
elseif kind == 4 then
+ local gray, rgb, cmyk = graycolor(v[2]), rgbcolor(v[3],v[4],v[5]), cmykcolor(v[6],v[7],v[8],v[9])
d = { cmyk, gray, rgb, cmyk }
elseif kind == 5 then
local spot = spotcolor(v[10],v[11],v[12],v[13])
- d = { spot, gray, rgb, cmyk }
+ -- d = { spot, gray, rgb, cmyk }
+ d = { spot, spot, spot, spot }
end
end
data[n] = d
@@ -226,7 +300,7 @@ function colors.register(name, colorspace, ...) -- passing 9 vars is faster (but
local stamp = format(templates[colorspace],...)
local color = registered[stamp]
if not color then
- color = #values+1
+ color = #values + 1
values[color] = colors[colorspace](...)
registered[stamp] = color
-- colors.reviver(color)
@@ -250,13 +324,16 @@ shipouts.handle_color = nodes.install_attribute_handler {
resolver = function() return colors.main end,
}
+function colors.enable()
+ tasks.enableaction("shipouts","shipouts.handle_color")
+end
+
-- transparencies
transparencies = transparencies or { }
transparencies.registered = transparencies.registered or { }
transparencies.data = transparencies.data or { }
transparencies.values = transparencies.values or { }
-transparencies.enabled = false
transparencies.triggering = true
transparencies.attribute = attributes.private('transparency')
@@ -336,24 +413,27 @@ shipouts.handle_transparency = nodes.install_attribute_handler {
processor = states.process,
}
---- overprint / knockout
+function transparencies.enable()
+ tasks.enableaction("shipouts","shipouts.handle_transparency")
+end
+
+--- colorintents: overprint / knockout
-overprints = overprints or { }
-overprints.data = overprints.data or { }
-overprints.enabled = false
-overprints.attribute = attributes.private('overprint')
+colorintents = colorintents or { }
+colorintents.data = colorintents.data or { }
+colorintents.attribute = attributes.private('colorintent')
-overprints.registered = {
+colorintents.registered = {
overprint = 1,
knockout = 2,
}
-local data, registered = overprints.data, overprints.registered
+local data, registered = colorintents.data, colorintents.registered
-local function extender(overprints,key)
+local function extender(colorintents,key)
if key == "none" then
local d = data[2]
- overprints.none = d
+ colorintents.none = d
return d
end
end
@@ -370,26 +450,29 @@ local function reviver(data,n)
end
end
-setmetatable(overprints, { __index = extender })
-setmetatable(overprints.data, { __index = reviver })
+setmetatable(colorintents, { __index = extender })
+setmetatable(colorintents.data, { __index = reviver })
-function overprints.register(stamp)
+function colorintents.register(stamp)
return registered[stamp] or registered.overprint
end
-shipouts.handle_overprint = nodes.install_attribute_handler {
- name = "overprint",
- namespace = overprints,
+shipouts.handle_colorintent = nodes.install_attribute_handler {
+ name = "colorintent",
+ namespace = colorintents,
initializer = states.initialize,
finalizer = states.finalize,
processor = states.process,
}
+function colorintents.enable()
+ tasks.enableaction("shipouts","shipouts.handle_colorintent")
+end
+
--- negative / positive
negatives = negatives or { }
negatives.data = negatives.data or { }
-negatives.enabled = false
negatives.attribute = attributes.private("negative")
negatives.registered = {
@@ -434,13 +517,16 @@ shipouts.handle_negative = nodes.install_attribute_handler {
processor = states.process,
}
+function negatives.enable()
+ tasks.enableaction("shipouts","shipouts.handle_negative")
+end
+
-- effects -- can be optimized (todo: metatables)
effects = effects or { }
effects.data = effects.data or { }
effects.values = effects.values or { }
effects.registered = effects.registered or { }
-effects.enabled = false
effects.stamp = "%s:%s:%s"
effects.attribute = attributes.private("effect")
@@ -463,7 +549,7 @@ end
local function reviver(data,n)
local e = values[n] -- we could nil values[n] now but hardly needed
- local d = effect(v[1],v[2],v[3])
+ local d = effect(e[1],e[2],e[3])
data[n] = d
return d
end
@@ -490,6 +576,10 @@ shipouts.handle_effect = nodes.install_attribute_handler {
processor = states.process,
}
+function effects.enable()
+ tasks.enableaction("shipouts","shipouts.handle_effect")
+end
+
-- layers (ugly code, due to no grouping and such); currently we use exclusive layers
-- but when we need it stacked layers might show up too; the next function based
-- approach can be replaced by static (metatable driven) resolvers
@@ -499,7 +589,6 @@ viewerlayers.data = viewerlayers.data or { }
viewerlayers.registered = viewerlayers.registered or { }
viewerlayers.values = viewerlayers.values or { }
viewerlayers.listwise = viewerlayers.listwise or { }
-viewerlayers.enabled = false
viewerlayers.attribute = attributes.private("viewerlayer")
storage.register("viewerlayers/registered", viewerlayers.registered, "viewerlayers.registered")
@@ -553,3 +642,7 @@ shipouts.handle_viewerlayer = nodes.install_attribute_handler {
finalizer = states.finalize,
processor = states.stacked,
}
+
+function viewerlayers.enable()
+ tasks.enableaction("shipouts","shipouts.handle_viewerlayer")
+end
diff --git a/Master/texmf-dist/tex/context/base/attr-ini.mkiv b/Master/texmf-dist/tex/context/base/attr-ini.mkiv
index b90d4976b00..87d06c48a44 100644
--- a/Master/texmf-dist/tex/context/base/attr-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/attr-ini.mkiv
@@ -20,6 +20,21 @@
\registerctxluafile{attr-ini}{1.001}
+%D This might move:
+
+\def\pushattribute#1%
+ {\global\advance\csname\??ae:\string#1\endcsname\plusone
+ \global\expandafter\mathchardef\csname\??ae:\string#1:\number\csname\??ae:\string#1\endcsname\endcsname\attribute#1}
+
+\def\popattribute#1%
+ {\attribute#1\csname\??ae:\string#1:\number\csname\??ae:\string#1\endcsname\endcsname
+ \global\advance\csname\??ae:\string#1\endcsname\minusone}
+
+\def\installattributestack#1%
+ {\expandafter\newcount\csname\??ae:\string#1\endcsname}
+
+%D For the moment we put this here (later it will move to where it's used):
+
\definesystemattribute[state]
\definesystemattribute[skip]
\definesystemattribute[penalty]
@@ -27,14 +42,16 @@
\definesystemattribute[color] \chardef\colorattribute \dogetattributeid{color}
\definesystemattribute[transparency] \chardef\transparencyattribute \dogetattributeid{transparency}
\definesystemattribute[background] \chardef\backgroundattribute \dogetattributeid{background}
-\definesystemattribute[overprint]
-\definesystemattribute[negative]
-\definesystemattribute[effect]
+\definesystemattribute[colorintent] \chardef\colorintentattribute \dogetattributeid{colorintent}
+\definesystemattribute[negative] \chardef\negativeattribute \dogetattributeid{negative}
+\definesystemattribute[effect] \chardef\effectattribute \dogetattributeid{effect}
\definesystemattribute[viewerlayer] \chardef\viewerlayerattribute \dogetattributeid{viewerlayer}
\definesystemattribute[layoutcomponent] \chardef\layoutcomponentattribute\dogetattributeid{layoutcomponent}
\definesystemattribute[reference] \chardef\referenceattribute \dogetattributeid{reference}
\definesystemattribute[destination] \chardef\destinationattribute \dogetattributeid{destination}
\definesystemattribute[graphicvadjust] \chardef\graphicvadjustattribute \dogetattributeid{graphicvadjust}
+\definesystemattribute[ruled] \chardef\ruledattribute \dogetattributeid{ruled}
+\definesystemattribute[shifted] \chardef\shiftedattribute \dogetattributeid{shifted}
% \definesystemattribute[ignore]
%
@@ -53,14 +70,14 @@
\newcount\currentcolormodel
-\def\setcolormodel#1%
+\def\dosetcolormodel#1%
{\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1'))}%
- \dosetattribute{colormodel}{\the\currentcolormodel}}
+ \attribute\colormodelattribute\currentcolormodel}
-\setcolormodel{all}
+\dosetcolormodel{all}
\appendtoks
- \setcolormodel{all}% redundant?
+ \dosetcolormodel{all}% redundant?
\to \everyjob
\def\registerrgbcolor #1#2#3#4{\ctxlua{colors.register('#1','rgb' ,#2,#3,#4)}}
@@ -70,12 +87,12 @@
% transparency
\def\registertransparency#1#2#3%
- {\setevalue{(ts:#1)}{\dosetattribute{transparency}{\ctxlua{tex.print(transparencies.register(#2,#3))}}}}
+ {\setevalue{(ts:#1)}{\attribute\transparencyattribute\ctxlua{tex.write(transparencies.register(#2,#3))} }}
\def\sometransparencyswitch#1{\csname(ts:#1)\endcsname}
\def\sometransparencyswitch
- {\ctxlua{transparencies.enabled=true}%
+ {\ctxlua{transparencies.enable()}%
\gdef\sometransparencyswitch##1{\csname(ts:##1)\endcsname}%
\sometransparencyswitch}
@@ -84,24 +101,28 @@
% overprint
-\def\registeroverprint#1#2%
- {\setevalue{(os:#1)}{\dosetattribute{overprint}{\ctxlua{tex.print(overprints.register('#2'))}}}}
+\def\registercolorintent#1#2%
+ {\setevalue{(os:#1)}{\attribute\colorintentattribute\ctxlua{tex.write(colorintents.register('#2'))} }}
-\def\dotriggeroverprint
- {\ctxlua{overprints.enabled=true}%
- \gdef\dotriggeroverprint##1{\csname(os:##1)\endcsname}%
- \dotriggeroverprint}
+\def\dotriggercolorintent
+ {\ctxlua{colorintents.enable()}%
+ \gdef\dotriggercolorintent##1{\csname(os:##1)\endcsname}%
+ \dotriggercolorintent}
-\registeroverprint{knockout} {knockout}
-\registeroverprint{overprint}{overprint}
+\registercolorintent{knockout} {knockout}
+\registercolorintent{overprint}{overprint}
+
+\installattributestack\colorintentattribute
+
+\setevalue{(os:#\v!none}{\attribute\colorintentattribute\attributeunsetvalue} % does this work out ok?
% negative
\def\registernegative#1#2%
- {\setevalue{(ns:#1)}{\dosetattribute{negative}{\ctxlua{tex.print(negatives.register('#2'))}}}}
+ {\setevalue{(ns:#1)}{\attribute\negativeattribute\ctxlua{tex.write(negatives.register('#2'))} }}
\def\dotriggernegative
- {\ctxlua{negatives.enabled=true}%
+ {\ctxlua{negatives.enable()}%
\gdef\dotriggernegative##1{\csname(ns:##1)\endcsname}%
\dotriggernegative}
@@ -112,10 +133,10 @@
\def\registereffect#1#2#3% #2=stretch #3=rulethickness
{\setxvalue{(es:#1:#2:\number\dimexpr#3\relax)}%
- {\dosetattribute{effect}{\ctxlua{tex.print(effects.register('#1',#2,\number\dimexpr#3\relax))}}}}
+ {\attribute\effectattribute\ctxlua{tex.write(effects.register('#1',#2,\number\dimexpr#3\relax))} }}
\def\dotriggereffect
- {\ctxlua{effects.enabled=true}%
+ {\ctxlua{effects.enable()}%
\gdef\dotriggereffect##1##2##3%
{\ifcsname(es:##1:##2:\number\dimexpr##3\relax)\endcsname\else\registereffect{##1}{##2}{##3}\fi
\csname(es:##1:##2:\number\dimexpr##3\relax)\endcsname}%
@@ -129,20 +150,15 @@
% viewerlayers (will probably change a bit)
-% \def\registerviewerlayer#1#2% global !
-% {\setxvalue{(vl:#1)}{\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}}
-%
-% \setevalue{(vl:)}{\doresetattribute{viewerlayer}}
-%
% needs to work over stopitemize grouping etc
\def\registerviewerlayer#1#2% global !
- {\setxvalue{(vl:#1)}{\global\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}}
+ {\setxvalue{(vl:#1)}{\global\attribute\viewerlayerattribute\ctxlua{tex.write(viewerlayers.register('#2'))} }}
-\setevalue{(vl:)}{\global\doresetattribute{viewerlayer}}
+\setevalue{(vl:)}{\global\attribute\viewerlayerattribute\attributeunsetvalue}
\def\dotriggerviewerlayer
- {\ctxlua{viewerlayers.enabled=true}%
+ {\ctxlua{viewerlayers.enable()}%
\gdef\dotriggerviewerlayer##1{\csname(vl:##1)\endcsname}%
\dotriggerviewerlayer}
diff --git a/Master/texmf-dist/tex/context/base/back-ini.lua b/Master/texmf-dist/tex/context/base/back-ini.lua
index bad6b0282d5..12a487dd4dc 100644
--- a/Master/texmf-dist/tex/context/base/back-ini.lua
+++ b/Master/texmf-dist/tex/context/base/back-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['back-ini'] = {
version = 1.001,
- comment = "companion to back-ini.tex",
+ comment = "companion to back-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -46,6 +46,7 @@ backends.codeinjections = {
registeredsymbol = nothing,
registercomment = nothing,
+ embedfile = nothing,
attachfile = nothing,
adddocumentinfo = nothing,
setupidentity = nothing,
@@ -55,7 +56,6 @@ backends.codeinjections = {
addtransparencygroup = nothing,
typesetfield = nothing,
- finishfields = nothing,
doiffieldelse = nothing,
doiffieldgroupelse = nothing,
definefield = nothing,
diff --git a/Master/texmf-dist/tex/context/base/back-ini.mkiv b/Master/texmf-dist/tex/context/base/back-ini.mkiv
index 07e9147f259..b7bbdb56f01 100644
--- a/Master/texmf-dist/tex/context/base/back-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/back-ini.mkiv
@@ -163,6 +163,6 @@
\edef\jobsuffix{#1}%
\setsystemmode\jobsuffix}
-\def\setupoutput[#1]{} % will be command line switch
+\unexpanded\def\setupoutput[#1]{} % will be command line switch
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/back-pdf.lua b/Master/texmf-dist/tex/context/base/back-pdf.lua
index 908801d8a95..54e22f1a2bd 100644
--- a/Master/texmf-dist/tex/context/base/back-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/back-pdf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['back-pdf'] = {
version = 1.001,
- comment = "companion to back-pdf.tex",
+ 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"
@@ -21,8 +21,7 @@ local concat = table.concat
local round = math.round
local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
local texsprint, texwrite = tex.sprint, tex.write
-
-ctxcatcodes = tex.ctxcatcodes
+local ctxcatcodes = tex.ctxcatcodes
local copy_node = node.copy
@@ -32,14 +31,18 @@ local registrations = backends.pdf.registrations
local pdfliteral, register = nodes.pdfliteral, nodes.register
-local pdfconstant = lpdf.constant
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfreference = lpdf.reference
-local pdfverbose = lpdf.verbose
+local pdfconstant = lpdf.constant
+local pdfstring = lpdf.string
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfverbose = lpdf.verbose
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfannotation = nodes.pdfannotation
-local pdfreserveobj = pdf.reserveobj
-local pdfimmediateobj = pdf.immediateobj
+local pdfreserveobj = pdf.reserveobj
+local pdfimmediateobj = pdf.immediateobj
function nodeinjections.rgbcolor(r,g,b)
return register(pdfliteral(format("%s %s %s rg %s %s %s RG",r,g,b,r,g,b)))
@@ -55,7 +58,7 @@ end
function nodeinjections.spotcolor(n,f,d,p)
if type(p) == "string" then
- p = p:gsub(","," ") -- brr misuse of spot
+ p = gsub(p,","," ") -- brr misuse of spot
end
return register(pdfliteral(format("/%s cs /%s CS %s SCN %s scn",n,n,p,p)))
end
@@ -72,9 +75,9 @@ local effects = {
hidden = 3,
}
-function nodeinjections.effect(stretch,rulethickness,effect)
+function nodeinjections.effect(effect,stretch,rulethickness)
-- always, no zero test (removed)
- rulethickness = number.dimenfactors["bp"]*rulethickness
+ rulethickness = number.dimenfactors["bp"] * rulethickness
effect = effects[effect] or effects['normal']
return register(pdfliteral(format("%s Tc %s w %s Tr",stretch,rulethickness,effect))) -- watch order
end
@@ -131,7 +134,7 @@ function codeinjections.insertmovie(specification)
Movie = moviedict,
A = controldict,
}
- node.write(nodes.pdfannot(width,height,0,action()))
+ node.write(pdfannotation(width,height,0,action()))
end
function codeinjections.insertsound(specification)
@@ -151,7 +154,7 @@ function codeinjections.insertsound(specification)
Movie = sounddict,
A = controldict,
}
- node.write(nodes.pdfannot(0,0,0,action()))
+ node.write(pdfannotation(0,0,0,action()))
end
end
@@ -162,7 +165,7 @@ local pdf_indexed = pdfconstant("Indexed")
local pdf_device_n = pdfconstant("DeviceN")
local pdf_device_rgb = pdfconstant("DeviceRGB")
local pdf_device_cmyk = pdfconstant("DeviceCMYK")
-local pdf_device_gray = pdfconstant("Devicegray")
+local pdf_device_gray = pdfconstant("DeviceGray")
local pdf_extgstate = pdfconstant("ExtGState")
local pdf_rbg_range = pdfarray { 0, 1, 0, 1, 0, 1 }
@@ -303,6 +306,7 @@ local function indexcolorref(name) -- actually, names (parent) is the hash
end
function registrations.rgbspotcolor(name,noffractions,names,p,r,g,b)
+--~ print(name,noffractions,names,p,r,g,b)
if noffractions == 1 then
registersomespotcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rbg_range,format(rgb_function,r,g,b))
else
diff --git a/Master/texmf-dist/tex/context/base/back-pdf.mkiv b/Master/texmf-dist/tex/context/base/back-pdf.mkiv
index 2d3ba85248b..a10afd5b901 100644
--- a/Master/texmf-dist/tex/context/base/back-pdf.mkiv
+++ b/Master/texmf-dist/tex/context/base/back-pdf.mkiv
@@ -29,7 +29,7 @@
\pdfpkresolution = 600
\pdfdecimaldigits = 10
\pdfinclusionerrorlevel = 0
-\pdfminorversion = 5
+\pdfminorversion = 6 % maybe even 7
%pdfuniqueresname = 1
%D This one can be consulted by users although the suffix is also
@@ -44,13 +44,13 @@
%D These are the only official methods to add stuff to the resources.
-\def\pdfbackendsetcatalog #1#2{\ctxlua{lpdf.addtocatalog ("#1",\!!bs#2\!!es)}} \newtoks\pdfcatalog
-\def\pdfbackendsetinfo #1#2{\ctxlua{lpdf.addtoinfo ("#1",\!!bs#2\!!es)}} \newtoks\pdfinfo
-\def\pdfbackendsetname #1#2{\ctxlua{lpdf.addtonames ("#1",\!!bs#2\!!es)}} \newtoks\pdfnames
+\def\pdfbackendsetcatalog #1#2{\ctxlua{lpdf.addtocatalog ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetinfo #1#2{\ctxlua{lpdf.addtoinfo ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetname #1#2{\ctxlua{lpdf.addtonames ("#1",\!!bs#2\!!es)}}
-\def\pdfbackendsetpageattribute #1#2{\ctxlua{lpdf.addtopageattributes ("#1",\!!bs#2\!!es)}} \newtoks\pdfpageresources
-\def\pdfbackendsetpagesattribute#1#2{\ctxlua{lpdf.addtopagesattributes("#1",\!!bs#2\!!es)}} \newtoks\pdfpageattr
-\def\pdfbackendsetpageresource #1#2{\ctxlua{lpdf.addtopageresources ("#1",\!!bs#2\!!es)}} \newtoks\pdfpagesattr
+\def\pdfbackendsetpageattribute #1#2{\ctxlua{lpdf.addtopageattributes ("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetpagesattribute#1#2{\ctxlua{lpdf.addtopagesattributes("#1",\!!bs#2\!!es)}}
+\def\pdfbackendsetpageresource #1#2{\ctxlua{lpdf.addtopageresources ("#1",\!!bs#2\!!es)}}
\def\pdfbackendsetextgstate #1#2{\ctxlua{lpdf.adddocumentextgstate ("#1",lpdf.verbose(\!!bs#2\!!es))}}
\def\pdfbackendsetcolorspace #1#2{\ctxlua{lpdf.adddocumentcolorspace("#1",lpdf.verbose(\!!bs#2\!!es))}}
@@ -59,27 +59,33 @@
\def\pdfbackendcurrentresources {\ctxlua{lpdf.collectedresources()}}
+%D Let's block these:
+
+\let\pdfcatalog \relax \newtoks\pdfcatalog
+\let\pdfinfo \relax \newtoks\pdfinfo
+\let\pdfnames \relax \newtoks\pdfnames
+\let\pdfpageresources\relax \newtoks\pdfpageresources
+\let\pdfpageattr \relax \newtoks\pdfpageattr
+\let\pdfpagesattr \relax \newtoks\pdfpagesattr
+
%D An example of usage is:
-\appendtoks % will change ...
- \pdfbackendsetinfo{ConTeXt.Version}{(\contextversion)}%
- \pdfbackendsetinfo{ConTeXt.Time} {(\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
- \pdfbackendsetinfo{ConTeXt.Jobname}{(\jobname)}%
- \pdfbackendsetinfo{ConTeXt.Url} {(www.pragma-ade.com)}%
+\appendtoks
+ \pdfbackendsetinfo{ConTeXt.Version}{\contextversion}%
+ \pdfbackendsetinfo{ConTeXt.Time} {\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute}%
+ \pdfbackendsetinfo{ConTeXt.Jobname}{\jobname}%
+ \pdfbackendsetinfo{ConTeXt.Url} {www.pragma-ade.com}%
\to \everylastbackendshipout
%D Unfortunately this is still needed (also for \METAPOST\ to
%D \PDF\ converter):
-\def\doresetmapfilelist
- {\global\let\doresetmapfilelist\relax
- \pdfmapfile{original-empty.map}}
-
-\def\doloadmapfile #1#2{\pdfmapfile{#1#2}}
-\def\doloadmapline #1#2{\pdfmapline{#1#2}}
-
-\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform
-\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage
+% \def\doresetmapfilelist
+% {\global\let\doresetmapfilelist\relax
+% \pdfmapfile{original-empty.map}}
+%
+% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform
+% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage
%D Transformations. Some day we will use primitives (once they're fixed).
@@ -101,7 +107,7 @@
\def\dostartmirroring{\pdfliteral{-1 0 0 1 0 0 cm}}
\def\dostopmirroring {\pdfliteral{-1 0 0 1 0 0 cm}}
-\def\dostartclipping#1#2#3% todo
+\def\dostartclipping#1#2#3% todo (still needed?)
{\PointsToBigPoints{#2}\width
\PointsToBigPoints{#3}\height
\grabMPclippath{#1}{1}\width\height{0 0 m \width\space 0 l \width \height l 0 \height l}%
@@ -115,7 +121,7 @@
\appendtoks \ctxlua{backends.codeinjections.finalizepage ()}\to \everybackendshipout % is immediate
\appendtoks \ctxlua{backends.codeinjections.finalizedocument()}\to \everylastbackendshipout % is immediate
-%D Temporary hack, will be removed or improved.
+%D Temporary hack, will be removed or improved or default.
\def\TransparencyHack{\ctxlua{backends.codeinjections.addtransparencygroup()}}
@@ -159,8 +165,11 @@
{\dogetobjectreferencepage{#1}{#2}#3%
\doPDFgetpagereference{\ifx#3\empty\realfolio\else#3\fi}#3}
+\let\lastpredefinedsymbol\empty % some day we can do more at the lua end
+
\def\predefinesymbol[#1]%
{\begingroup
+ \xdef\lastpredefinedsymbol{#1}%
\settightobject{SYM}{#1}\hbox{\symbol[#1]}% to be checked ... maybe only fitting
\dogetobjectreference{SYM}{#1}\lastref
\ctxlua{backends.codeinjections.registersymbol("#1",\lastref)}%
diff --git a/Master/texmf-dist/tex/context/base/back-u3d.mkiv b/Master/texmf-dist/tex/context/base/back-u3d.mkiv
new file mode 100644
index 00000000000..398159feb2c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/back-u3d.mkiv
@@ -0,0 +1,156 @@
+%D \module
+%D [ file=back-u3d,
+%D version=2009.04.15,
+%D title=\CONTEXT\ Backend Macros,
+%D subtitle=U3D Experiment,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% This is only a placeholder that demonstrates the usage of u3d
+% resources. The user interface is rather messy an might be
+% improved. The files and setup is derived from an example by
+% Michael Vidiassov.
+
+\endinput
+
+\starttext
+
+\startluaparameterset [u3d:myset:controls:1]
+ view = {
+ name = 'default',
+ bg = {1,1,1},
+ mag = 100,
+ coo = {0,0,0},
+ c2c = {0,0,1},
+ rot = {40,0,60},
+ roo = 6,
+ lights = 'CAD'
+ },
+ js = 'cloudq.js'
+\stopluaparameterset
+
+\startluaparameterset [u3d:myset:controls:2]
+ views = {
+ {
+ name = 'AnglePositioning',
+ bg = {1,1,1},
+ azimuth = 45,
+ altitude = 45,
+ roo = 50,
+ aac = 2.5,
+ lights = 'Artwork'
+ },
+ {
+ name = 'RotationPositioning',
+ bg = {1,1,1},
+ rot = {0,45,45},
+ roo = 50,
+ aac = 2.5,
+ lights = 'Artwork'
+ },
+ {
+ name = 'VectorPositioning',
+ bg = {1,0,0},
+ c2c = {1,1,math.sqrt(2)},
+ roo = 50,
+ aac = 2.5,
+ lights = 'CAD'
+ },
+ {
+ name = 'PositionPositioning',
+ bg = {1,0,0},
+ pos = {1+25,1+25,1+50/math.sqrt(2)},
+ aac = 2.5,
+ lights = 'CAD'
+ },
+ {
+ name = 'ortho',
+ bg = {1,1,1},
+ mag = 300,
+ lights = 'CAD',
+ crossection = {}
+ }
+ },
+ view = {
+ name = 'default',
+ bg = {1,1,1},
+ c2c = {-1,-1,0},
+ roo = 50,
+ aac = 2.5,
+ roll = 45,
+ lights = 'CAD',
+ crossection = {
+ normal = {-1,-1,-1},
+ transparent = true
+ },
+ nodes = {
+ {
+ name = 'xlabel',
+ visible = false
+ },
+ {
+ name = 'ylabel',
+ opacity = 0.5
+ },
+ {
+ name = 'zlabel',
+ rendermode = 'Wireframe'
+ }
+ }
+ }
+\stopluaparameterset
+
+\useexternalfigure
+ [cloudq]
+ [cloudq.u3d]
+ [width=0.7\textwidth,
+ height=.7\textwidth,
+ display=u3d:myset:display:1,
+ controls=u3d:myset:controls:1]
+
+\useexternalfigure
+ [axes]
+ [axes.u3d]
+ [width=0.7\textwidth,
+ height=.7\textwidth,
+ controls=u3d:myset:controls:1]
+
+\startluaparameterset[u3d:myset:display:2]
+ toolbar = true,
+ preview = 'cloudq.png'
+\stopluaparameterset
+\startluaparameterset[u3d:myset:display:3]
+ toolbar = true,
+ tree = false,
+ preview = 'area.png'
+\stopluaparameterset
+\startluaparameterset[u3d:myset:display:4]
+ toolbar = true,
+ tree = false,
+ view = {
+ name = 'view',
+ bg = {0.1,0.1,0.1},
+ c2c = {-1,-1,0},
+ roo = 50,
+ aac = 2.5,
+ roll = 45,
+ lights = 'Red'
+ }
+\stopluaparameterset
+\startluaparameterset[u3d:myset:display:5]
+ toolbar = true,
+ tree = false,
+ view = 'ortho'
+\stopluaparameterset
+
+\placefigure[here]{none}{\externalfigure[cloudq][display=u3d:myset:display:2]}
+\placefigure[here]{none}{\externalfigure[axes] [display=u3d:myset:display:3]}
+\placefigure[here]{none}{\externalfigure[axes] [display=u3d:myset:display:4]}
+\placefigure[here]{none}{\externalfigure[axes] [display=u3d:myset:display:5,width=0.5\textwidth,height=.5\textwidth]}
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/bibl-bib.lua b/Master/texmf-dist/tex/context/base/bibl-bib.lua
index 028202ec22f..3c0dad2fa4e 100644
--- a/Master/texmf-dist/tex/context/base/bibl-bib.lua
+++ b/Master/texmf-dist/tex/context/base/bibl-bib.lua
@@ -12,8 +12,18 @@ bibtex files and converts them to xml so that the we access the content
in a convenient way. Actually handling the data takes place elsewhere.</p>
--ldx]]--
-local lower, format = string.lower, string.format
+local utf = unicode.utf8
+local lower, format, gsub, concat = string.lower, string.format, string.gsub, table.concat
local next = next
+local utfchar = utf.char
+local lpegmatch = lpeg.match
+local textoutf = characters and characters.tex.toutf
+local variables = interfaces and interfaces.variables
+
+local finalizers = xml.finalizers.tex
+local xmlfilter, xmltext = xml.filter, xml.text
+
+local trace_bibxml = false trackers.register("publications.bibxml", function(v) trace_bibtex = v end)
bibtex = bibtex or { }
@@ -21,10 +31,29 @@ bibtex.size = 0
bibtex.definitions = 0
bibtex.shortcuts = 0
+local defaultshortcuts = {
+ jan = "1",
+ feb = "2",
+ mar = "3",
+ apr = "4",
+ may = "5",
+ jun = "6",
+ jul = "7",
+ aug = "8",
+ sep = "9",
+ oct = "10",
+ nov = "11",
+ dec = "12",
+}
+
local shortcuts = { }
-local data = { }
+local data = { }
local entries
+-- Currently we expand shortcuts and for large ones (like the acknowledgements
+-- in tugboat.bib this is not that efficient. However, eventually strings get
+-- hashed again.
+
local function do_shortcut(tag,key,value)
bibtex.shortcuts = bibtex.shortcuts + 1
if lower(tag) == "@string" then
@@ -49,34 +78,33 @@ local function do_definition(tag,key,tab) -- maybe check entries here (saves mem
end
local function resolve(s)
- return shortcuts[s] or ""
-end
-
-local percent = lpeg.P("%")
-local start = lpeg.P("@")
-local comma = lpeg.P(",")
-local hash = lpeg.P("#")
-local escape = lpeg.P("\\")
-local single = lpeg.P("'")
-local double = lpeg.P('"')
-local left = lpeg.P('{')
-local right = lpeg.P('}')
+ return shortcuts[s] or defaultshortcuts[s] or s -- can be number
+end
+
+local P, R, S, C, Cc, Cs, Ct = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct
+
+local percent = P("%")
+local start = P("@")
+local comma = P(",")
+local hash = P("#")
+local escape = P("\\")
+local single = P("'")
+local double = P('"')
+local left = P('{')
+local right = P('}')
local both = left + right
-local lineending = lpeg.S("\n\r")
-local space = lpeg.S(" \t\n\r\f")
+local lineending = S("\n\r")
+local space = S(" \t\n\r\f")
local spacing = space^0
-local equal = lpeg.P("=")
+local equal = P("=")
local collapsed = (space^1)/ " "
local function add(a,b) if b then return a..b else return a end end
-local keyword = lpeg.C((lpeg.R("az","AZ","09") + lpeg.S("@_:-"))^1) -- lpeg.C((1-space)^1)
+local keyword = C((lpeg.R("az","AZ","09") + S("@_:-"))^1) -- lpeg.C((1-space)^1)
local s_quoted = ((escape*single) + collapsed + (1-single))^0
local d_quoted = ((escape*double) + collapsed + (1-double))^0
-local balanced = lpeg.P {
- [1] = ((escape * (left+right)) + (1 - (left+right)) + lpeg.V(2))^0,
- [2] = left * lpeg.V(1) * right
-}
+local balanced = lpeg.patterns.balanced
local s_value = (single/"") * s_quoted * (single/"")
local d_value = (double/"") * d_quoted * (double/"")
@@ -84,7 +112,7 @@ local b_value = (left /"") * balanced * (right /"")
local r_value = keyword/resolve
local somevalue = s_value + d_value + b_value + r_value
-local value = lpeg.Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0))
+local value = Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0))
local assignment = spacing * keyword * spacing * equal * spacing * value * spacing
local shortcut = keyword * spacing * left * spacing * (assignment * comma^0)^0 * spacing * right
@@ -101,14 +129,21 @@ function bibtex.convert(session,content)
data, shortcuts, entries = session.data, session.shortcuts, session.entries
-- session.size = session.size + #content
bibtex.size = bibtex.size + #content
- grammar:match(content or "")
+ session.size = session.size + #content
+ lpegmatch(grammar,content or "")
statistics.stoptiming(bibtex)
end
function bibtex.load(session,filename)
local filename = resolvers.find_file(filename,"bib")
if filename ~= "" then
- bibtex.convert(session,io.loaddata(filename) or "")
+ local data = io.loaddata(filename) or ""
+ if data == "" then
+ logs.report("publications","empty file '%s', no conversion to xml",filename)
+ elseif trace_bibxml then
+ logs.report("publications","converting file '%s' to xml",filename)
+ end
+ bibtex.convert(session,data)
end
end
@@ -119,37 +154,88 @@ function bibtex.new()
xml = xml.convert("<?xml version='1.0' standalone='yes'?>\n<bibtex></bibtex>"),
size = 0,
entries = nil,
+ loaded = false,
}
end
local escaped_pattern = xml.escaped_pattern
-function bibtex.toxml(session)
+local ihatethis = {
+ f = "\\f",
+ n = "\\n",
+ r = "\\r",
+ s = "\\s",
+ t = "\\t",
+ v = "\\v",
+ z = "\\z",
+}
+
+local command = P("\\")/"" * Cc("\\bibtexcommand{") * (R("az","AZ")^1) * Cc("}")
+local any = P(1)
+local done = P(-1)
+local one_l = P("{") / ""
+local one_r = P("}") / ""
+local two_l = P("{{") / ""
+local two_r = P("}}") / ""
+
+local filter = Cs(
+ two_l * (command + any - two_r - done)^0 * two_r * done +
+ one_l * (command + any - one_r - done)^0 * one_r * done +
+ (command + any )^0
+)
+
+function bibtex.toxml(session,options)
+ if session.loaded then
+ return
+ else
+ session.loaded = true
+ end
-- we can always speed this up if needed
-- format slows down things a bit but who cares
statistics.starttiming(bibtex)
local result = { }
+ local options = aux.settings_to_hash(options)
+ local convert = options.convert -- todo: interface
+ local strip = options.strip -- todo: interface
local entries = session.entries
result[#result+1] = format("<?xml version='1.0' standalone='yes'?>")
result[#result+1] = format("<bibtex>")
for id, categories in next, session.data do
- result[#result+1] = format(" <c n='%s'>",id)
+ id = lower(gsub(id,"^@",""))
for name, entry in next, categories do
if not entries or entries[name] then
- result[#result+1] = format(" <e n='%s'>",name)
+ result[#result+1] = format("<entry tag='%s' category='%s'>",lower(name),id)
for key, value in next, entry do
- value = escaped_pattern:match(value)
+ value = gsub(value,"\\(.)",ihatethis)
+ value = lpegmatch(escaped_pattern,value)
+
if value ~= "" then
- result[#result+1] = format(" <v n='%s'>%s</v>",key,value)
+ if convert then
+ value = textoutf(value,true)
+ end
+ if strip then
+ -- as there is no proper namespace in bibtex we need this
+ -- kind of hackery ... bibtex databases are quite unportable
+ value = lpegmatch(filter,value) or value
+ end
+ result[#result+1] = format(" <field name='%s'>%s</field>",key,value)
end
end
- result[#result+1] = format(" </e>")
+ result[#result+1] = format("</entry>")
end
end
- result[#result+1] = format(" </c>")
end
result[#result+1] = format("</bibtex>")
- session.xml = xml.convert(table.concat(result,"\n"))
+ result = concat(result,"\n")
+ -- alternatively we could use lxml.convert
+ session.xml = xml.convert(result, {
+ resolve_entities = true,
+ resolve_predefined_entities = true, -- in case we have escaped entities
+ -- unify_predefined_entities = true, -- &#038; -> &amp;
+ utfize_entities = true,
+ } )
+ session.data = nil
+ session.shortcuts = nil
statistics.stoptiming(bibtex)
end
@@ -204,30 +290,473 @@ end)
--~ print(table.serialize(session.shortcuts))
--~ print(xml.serialize(session.xml))
--- this will move:
+if not characters then dofile(resolvers.find_file("char-def.lua")) end
+
+local chardata = characters.data
+local concat = table.concat
+
+local P, Ct, lpegmatch = lpeg.P, lpeg.Ct, lpeg.match
+
+local space, comma = P(" "), P(",")
+
+local andsplitter = Ct(lpeg.splitat(space^1 * "and" * space^1))
+local commasplitter = Ct(lpeg.splitat(space^0 * comma * space^0))
+local spacesplitter = Ct(lpeg.splitat(space^1))
+local firstcharacter = lpeg.patterns.utf8byte
+
+function is_upper(str)
+ local first = lpegmatch(firstcharacter,str)
+ local okay = chardata[first]
+ return okay and okay.category == "lu"
+end
+
+local function splitauthors(str)
+ local authors = lpegmatch(andsplitter,str)
+ for i=1,#authors do
+ local firstnames, vons, surnames, initials, juniors, words
+ local author = authors[i]
+ local split = lpegmatch(commasplitter,author)
+ local n = #split
+ if n == 1 then
+ --~ First von Last
+ words = lpegmatch(spacesplitter,author)
+ firstnames, vons, surnames = { }, { }, { }
+ local i, n = 1, #words
+ while i <= n do
+ local w = words[i]
+ if is_upper(w) then
+ firstnames[#firstnames+1], i = w, i + 1
+ else
+ break
+ end
+ end
+ while i <= n do
+ local w = words[i]
+ if is_upper(w) then
+ break
+ else
+ vons[#vons+1], i = w, i + 1
+ end
+ end
+ while i <= n do
+ surnames[#surnames+1], i = words[i], i + 1
+ end
+ elseif n == 2 then
+ --~ von Last, First
+ words = lpegmatch(spacesplitter,split[2])
+ surnames = lpegmatch(spacesplitter,split[1])
+ firstnames, vons = { }, { }
+ local i, n = 1, #words
+ while i <= n do
+ local w = words[i]
+ if is_upper(w) then
+ firstnames[#firstnames+1], i = w, i + 1
+ else
+ break
+ end
+ end
+ while i <= n do
+ vons[#vons+1], i = words[i], i + 1
+ end
+ else
+ --~ von Last, Jr ,First
+ firstnames = lpegmatch(spacesplitter,split[1])
+ juniors = lpegmatch(spacesplitter,split[2])
+ surnames = lpegmatch(spacesplitter,split[3])
+ if n > 3 then
+ -- error
+ end
+ end
+ if #surnames == 0 then
+ surnames[1] = firstnames[#firstnames]
+ firstnames[#firstnames] = nil
+ end
+ if firstnames then
+ initials = { }
+ for i=1,#firstnames do
+ initials[i] = utfchar(lpegmatch(firstcharacter,firstnames[i]))
+ end
+ end
+ authors[i] = {
+ original = author,
+ firstnames = firstnames,
+ vons = vons,
+ surnames = surnames,
+ initials = initials,
+ juniors = juniors,
+ }
+ end
+ authors.original = str
+ return authors
+end
+
+local function the_initials(initials,symbol)
+ local t, symbol = { }, symbol or "."
+ for i=1,#initials do
+ t[i] = initials[i] .. symbol
+ end
+ return t
+end
+
+-- authors
+
+bibtex.authors = bibtex.authors or { }
+
+local authors = bibtex.authors
+
+local defaultsettings = {
+ firstnamesep = " ",
+ vonsep = " ",
+ surnamesep = " ",
+ juniorsep = " ",
+ surnamejuniorsep = ", ",
+ juniorjuniorsep = ", ",
+ surnamefirstnamesep = ", ",
+ surnameinitialsep = ", ",
+ namesep = ", ",
+ lastnamesep = " and ",
+ finalnamesep = " and ",
+}
+
+function authors.normal(author,settings)
+ local firstnames, vons, surnames, juniors = author.firstnames, author.vons, author.surnames, author.juniors
+ local result, settings = { }, settings or defaultsettings
+ if firstnames and #firstnames > 0 then
+ result[#result+1] = concat(firstnames," ")
+ result[#result+1] = settings.firstnamesep or defaultsettings.firstnamesep
+ end
+ if vons and #vons > 0 then
+ result[#result+1] = concat(vons," ")
+ result[#result+1] = settings.vonsep or defaultsettings.vonsep
+ end
+ if surnames then
+ result[#result+1] = concat(surnames," ")
+ end
+ if juniors and #juniors > 0 then
+ result[#result+1] = concat(juniors," ")
+ result[#result+1] = settings.surnamesep or defaultsettings.surnamesep
+ end
+ return concat(result)
+end
+
+function authors.normalshort(author,settings)
+ local firstnames, vons, surnames, juniors = author.firstnames, author.vons, author.surnames, author.juniors
+ local result, settings = { }, settings or defaultsettings
+ if firstnames and #firstnames > 0 then
+ result[#result+1] = concat(firstnames," ")
+ result[#result+1] = settings.firstnamesep or defaultsettings.firstnamesep
+ end
+ if vons and #vons > 0 then
+ result[#result+1] = concat(vons," ")
+ result[#result+1] = settings.vonsep or defaultsettings.vonsep
+ end
+ if surnames then
+ result[#result+1] = concat(surnames," ")
+ end
+ if juniors and #juniors > 0 then
+ result[#result+1] = concat(juniors," ")
+ result[#result+1] = settings.surnamejuniorsep or defaultsettings.surnamejuniorsep
+ end
+ return concat(result)
+end
+
+function authors.inverted(author,settings)
+ local firstnames, vons, surnames, juniors = author.firstnames, author.vons, author.surnames, author.juniors
+ local result, settings = { }, settings or defaultsettings
+ if vons and #vons > 0 then
+ result[#result+1] = concat(vons," ")
+ result[#result+1] = settings.vonsep or defaultsettings.vonsep
+ end
+ if surnames then
+ result[#result+1] = concat(surnames," ")
+ end
+ if juniors and #juniors > 0 then
+ result[#result+1] = settings.juniorjuniorsep or defaultsettings.juniorjuniorsep
+ result[#result+1] = concat(juniors," ")
+ end
+ if firstnames and #firstnames > 0 then
+ result[#result+1] = settings.surnamefirstnamesep or defaultsettings.surnamefirstnamesep
+ result[#result+1] = concat(firstnames," ")
+ end
+ return concat(result)
+end
+
+function authors.invertedshort(author,settings)
+ local vons, surnames, initials, juniors = author.vons, author.surnames, author.initials, author.juniors
+ local result, settings = { }, settings or defaultsettings
+ if vons and #vons > 0 then
+ result[#result+1] = concat(vons," ")
+ result[#result+1] = settings.vonsep or defaultsettings.vonsep
+ end
+ if surnames then
+ result[#result+1] = concat(surnames," ")
+ end
+ if juniors and #juniors > 0 then
+ result[#result+1] = settings.juniorjuniorsep or defaultsettings.juniorjuniorsep
+ result[#result+1] = concat(juniors," ")
+ end
+ if initials and #initials > 0 then
+ result[#result+1] = settings.surnameinitialsep or defaultsettings.surnameinitialsep
+ result[#result+1] = concat(the_initials(initials)," ")
+ end
+ return concat(result)
+end
+
+local lastconcatsize = 1
+
+local function bibtexconcat(t,settings)
+ local namesep = settings.namesep or defaultsettings.namesep or ", "
+ local lastnamesep = settings.lastnamesep or defaultsettings.lastnamesep or namesep
+ local finalnamesep = settings.finalnamesep or defaultsettings.finalnamesep or lastnamesep
+ local lastconcatsize = #t
+ if lastconcatsize > 2 then
+ local s = { }
+ for i=1,lastconcatsize-2 do
+ s[i] = t[i] .. namesep
+ end
+ s[lastconcatsize-1], s[lastconcatsize] = t[lastconcatsize-1] .. finalnamesep, t[lastconcatsize]
+ return concat(s)
+ elseif lastconcatsize > 1 then
+ return concat(t,lastnamesep)
+ elseif lastconcatsize > 0 then
+ return t[1]
+ else
+ return ""
+ end
+end
+
+function authors.concat(author,combiner,what,settings)
+ if type(combiner) == "string" then
+ combiner = authors[combiner or "normal"] or authors.normal
+ end
+ local split = splitauthors(author)
+ local setting = settings[what]
+ local etallimit, etaldisplay, etaltext = 1000, 1000, ""
+ if setting then
+ etallimit = settings.etallimit or 1000
+ etaldisplay = settings.etaldisplay or etallimit
+ etalltext = settings.etaltext or ""
+ end
+ local max = #split
+ if max > etallimit and etaldisplay < max then
+ max = etaldisplay
+ end
+ for i=1,max do
+ split[i] = combiner(split[i],settings)
+ end
+ local result = bibtexconcat(split,settings)
+ if max < #split then
+ return result
+ else
+ return result .. etaltext
+ end
+end
+
+function authors.short(author,year)
+ local result = { }
+ if author then
+ local authors = splitauthors(author)
+ for a=1,#authors do
+ local aa = authors[a]
+ local initials = aa.initials
+ for i=1,#initials do
+ result[#result+1] = initials[i]
+ end
+ local surnames = aa.surnames
+ for s=1,#surnames do
+ result[#result+1] = utfchar(lpegmatch(firstcharacter,surnames[s]))
+ end
+ end
+ end
+ if year then
+ result[#result+1] = year
+ end
+ return concat(result)
+end
+
+-- We can consider creating a hashtable key -> entry but I wonder if
+-- pays off.
+
+local function collectauthoryears(id,list)
+ list = aux.settings_to_hash(list)
+ id = lxml.get_id(id)
+ local found = { }
+ for e in xml.collected(id,"/bibtex/entry") do
+ if list[e.at.tag] then
+ local year = xmlfilter(e,"xml:///field[@name='year']/text()")
+ local author = xmlfilter(e,"xml:///field[@name='author']/text()")
+ if author and year then
+ local a = found[author]
+ if not a then
+ a = { }
+ found[author] = a
+ end
+ local y = a[year]
+ if not y then
+ y = { }
+ a[year] = y
+ end
+ y[#y+1] = e
+ end
+ end
+ end
+ -- found = { author = { year_1 = { e1, e2, e3 } } }
+ local done = { }
+ for author, years in next, found do
+ local yrs = { }
+ for year, entries in next, years do
+ if subyears then
+ -- -- add letters to all entries of an author and if so shouldn't
+ -- -- we tag all years of an author as soon as we do this?
+ -- if #entries > 1 then
+ -- for i=1,#years do
+ -- local entry = years[i]
+ -- -- years[i] = year .. string.char(i + string.byte("0") - 1)
+ -- end
+ -- end
+ else
+ yrs[#yrs+1] = year
+ end
+ end
+ done[author] = yrs
+ end
+ return done
+end
+
+local method, settings = "normal", { }
+
+function authors.setsettings(s)
+ settings = s or settings
+end
if commands then
+ local texsprint = tex and tex.sprint
+ local ctxcatcodes = tex and tex.ctxcatcodes
+
local sessions = { }
function commands.definebibtexsession(name)
sessions[name] = bibtex.new()
end
- function commands.preparebibtexsession(name)
- bibtex.toxml(sessions[name])
- lxml.register("bibtex:"..name,sessions[name].xml)
+
+ function commands.preparebibtexsession(name,xmlname,options)
+ bibtex.toxml(sessions[name],options)
+ lxml.register(xmlname,sessions[name].xml)
end
+
function commands.registerbibtexfile(name,filename)
bibtex.load(sessions[name],filename)
end
+
function commands.registerbibtexentry(name,entry)
local session = sessions[name]
local entries = session.entries
if not entries then
- session.entries = { [entry] = true }
+ session.entries = { [entry] = true } -- here we can keep more info
else
entries[entry] = true
end
end
+ -- commands.bibtexconcat = bibtexconcat
+
+ -- finalizers can be rather dumb as we have just text and no embedded xml
+
+ function finalizers.bibtexconcat(collected,method,what)
+ if collected then
+ local author = collected[1].dt[1] or ""
+ if author ~= "" then
+ texsprint(ctxcatcodes,authors.concat(author,method,what,settings))
+ end
+ end
+ end
+
+ function finalizers.bibtexshort(collected)
+ if collected then
+ local c = collected[1]
+ local year = xmlfilter(c,"xml://field[@name='year']/text()")
+ local author = xmlfilter(c,"xml://field[@name='author']/text()")
+ texsprint(ctxcatcodes,authors.short(author,year))
+ end
+ end
+
+ -- experiment:
+
+ --~ -- alternative approach: keep data at the tex end
+
+ --~ local function xbibtexconcat(t,sep,finalsep,lastsep)
+ --~ local n = #t
+ --~ if n > 0 then
+ --~ context(t[1])
+ --~ if n > 1 then
+ --~ if n > 2 then
+ --~ for i=2,n-1 do
+ --~ context.bibtexpublicationsparameter("sep")
+ --~ context(t[i])
+ --~ end
+ --~ context.bibtexpublicationsparameter("finalsep")
+ --~ else
+ --~ context.bibtexpublicationsparameter("lastsep")
+ --~ end
+ --~ context(t[n])
+ --~ end
+ --~ end
+ --~ end
+
+ -- todo : sort
+
+ -- todo: choose between bibtex or commands namespace
+
+ function bibtex.authorref(id,list)
+ local result = collectauthoryears(id,list,method,what)
+ for author, years in next, result do
+ texsprint(ctxcatcodes,authors.concat(author,method,what,settings))
+ end
+ end
+
+ function bibtex.authoryearref(id,list)
+ local result = collectauthoryears(id,list,method,what)
+ for author, years in next, result do
+ texsprint(ctxcatcodes,authors.concat(author,method,what,settings)," (",concat(years,", "),")")
+ end
+ end
+
+ function bibtex.authoryearsref(id,list)
+ local result = collectauthoryears(id,list,method,what)
+ for author, years in next, result do
+ texsprint(ctxcatcodes,"(",authors.concat(author,method,what,settings),", ",concat(years,", "),")")
+ end
+ end
+
+ function bibtex.singular_or_plural(singular,plural)
+ if lastconcatsize and lastconcatsize > 1 then
+ texsprint(ctxcatcodes,plural)
+ else
+ texsprint(ctxcatcodes,singular)
+ end
+ end
end
+
+
+--~ local function test(sample)
+--~ local authors = splitauthors(sample)
+--~ print(table.serialize(authors))
+--~ for i=1,#authors do
+--~ local author = authors[i]
+--~ print(normalauthor (author,settings))
+--~ print(normalshortauthor (author,settings))
+--~ print(invertedauthor (author,settings))
+--~ print(invertedshortauthor(author,settings))
+--~ end
+--~ print(concatauthors(sample,settings,normalauthor))
+--~ print(concatauthors(sample,settings,normalshortauthor))
+--~ print(concatauthors(sample,settings,invertedauthor))
+--~ print(concatauthors(sample,settings,invertedshortauthor))
+--~ end
+
+--~ local sample_a = "Hagen, Hans and Hoekwater, Taco Whoever T. Ex. and Henkel Hut, Hartmut Harald von der"
+--~ local sample_b = "Hans Hagen and Taco Whoever T. Ex. Hoekwater and Hartmut Harald von der Henkel Hut"
+
+--~ test(sample_a)
+--~ test(sample_b)
diff --git a/Master/texmf-dist/tex/context/base/bibl-bib.mkiv b/Master/texmf-dist/tex/context/base/bibl-bib.mkiv
index 51db67ed7da..10abe5cb8a7 100644
--- a/Master/texmf-dist/tex/context/base/bibl-bib.mkiv
+++ b/Master/texmf-dist/tex/context/base/bibl-bib.mkiv
@@ -11,19 +11,952 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{ConTeXt Bibliography Support / BibTeX}
+\writestatus{loading}{ConTeXt Bibliography Support / Experimental BibTeX}
\registerctxluafile{bibl-bib}{1.001}
\unprotect
-\def\definebibtexsession [#1]{\ctxlua{commands.definebibtexsession("#1")}}
-\def\preparebibtexsession [#1]{\ctxlua{commands.preparebibtexsession("#1")}}
+% todo: et al limiters
+% todo: split: citationvariant and publicationvariant
+
+%D This interface is under development. As I don't use \BIBTEX\ myself I need
+%D some motivation to spend time on it, and an occasional question on the
+%D list can be a reason. A few examples. As \BIBTEX\ databases can be poluted
+%D by local commands, we need to catch:
+%D
+%D \startbuffer
+%D \defbibtexcommand\MF {MF}
+%D \defbibtexcommand\MP {MP}
+%D \defbibtexcommand\TUB {TUGboat}
+%D \defbibtexcommand\Mc {Mac}
+%D \defbibtexcommand\sltt{\tt}
+%D \defbibtexcommand\<#1>{\type{#1}}
+%D \defbibtexcommand\acro#1{#1}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D Let's define a session and load a few databases. We convert to \UTF\ and
+%D strip commands.
+%D
+%D \startbuffer
+%D \definebibtexsession [somebibtex]
+%D \registerbibtexfile [somebibtex] [tugboat.bib]
+%D \registerbibtexfile [somebibtex] [komoedie.bib]
+%D \preparebibtexsession [somebibtex] [convert,strip]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D This loads an mapping (work in progress):
+%D
+%D \startbuffer
+%D \def\currentbibtexformat{apa} \input bxml-\currentbibtexformat.mkiv
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D There are several ways to handle the \XML. It helps if you're a bit
+%D familiar with \XML\ processing in \MKIV.
+%D
+%D Here we regular setups. Three elements are mapped but only one
+%D is actually used and applied to root element \type {/bibtex}.
+%D
+%D \startbuffer
+%D \startxmlsetups bibtex
+%D \xmlregistereddocumentsetups{#1}{}
+%D \xmlsetsetup{#1}{bibtex|entry|field}{bibtex:*}
+%D \xmlmain{#1}
+%D \stopxmlsetups
+%D
+%D \startxmlsetups bibtex:bibtex
+%D \xmlfilter{#1}{
+%D /entry[@category='article']
+%D /field[@name='author' and (find(text(),'Hagen') or find(text(),'Hoekwater'))]
+%D /../command(bibtex:format)
+%D }
+%D \stopxmlsetups
+%D
+%D \applytobibtexsession[somebibtex][bibtex]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D A simpler setup is given next. Here we just apply a setup to the root
+%D element directly:
+%D
+%D \startbuffer
+%D \startxmlsetups bibtex:list
+%D \xmlfilter{#1}{/bibtex/entry/command(bibtex:format)}
+%D \stopxmlsetups
+%D
+%D \applytobibtexsession[somebibtex][bibtex:list]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D A slightly more complex expression:
+%D
+%D \startbuffer
+%D \startxmlsetups bibtex:filter
+%D \xmlfilter{#1}{
+%D /bibtex
+%D /entry[@category='article']
+%D /field[@name='author' and (find(text(),'Hagen') or find(text(),'Hoekwater'))]
+%D /../command(bibtex:format)
+%D }
+%D \stopxmlsetups
+%D
+%D \applytobibtexsession[somebibtex][bibtex:filter]
+%D \stopbuffer
+%D
+%D \typebuffer
+
+\newtoks \everydefinebibtexsession
+\newtoks \everypreparebibtexsession
+\newtoks \everysetupbibtexsession
+\setfalse \tracebibtexformat
+
+\unexpanded\def\definebibtexsession {\dosingleargument\dodefinebibtexsession}
+\def\preparebibtexsession {\dodoubleempty \dopreparebibtexsession}
+\unexpanded\def\setupbibtexsession {\dodoubleargument\dosetupbibtexsession}
+
+\def\dodefinebibtexsession [#1]{\edef\currentbibtexsession{#1}%
+ \ctxlua{commands.definebibtexsession("#1")}%
+ \the\everydefinebibtexsession}
+
+\def\dopreparebibtexsession[#1][#2]{\edef\currentbibtexsession{#1}%
+ \ctxlua{commands.preparebibtexsession("#1","bibtex:#1","#2")}%
+ \the\everypreparebibtexsession}
+
+\def\dosetupbibtexsession [#1][#2]{\edef\currentbibtexsession{#1}%
+ \getparameters[\??pb#1][#2]%
+ \the\everysetupbibtexsession}
+
\def\registerbibtexfile {\dodoubleargument\doregisterbibtexfile}
-\def\doregisterbibtexfile [#1][#2]{\ctxlua{commands.registerbibtexfile("#1","#2")}} % also the fast one
\def\registerbibtexentry {\dodoubleargument\doregisterbibtexentry}
-\def\doregisterbibtexentry [#1][#2]{\ctxlua{commands.registerbibtexentry("#1","#2")}} % also the fast one
\def\applytobibtexsession {\dodoubleargument\doapplytobibtexsession}
+
+\def\doregisterbibtexfile [#1][#2]{\ctxlua{commands.registerbibtexfile("#1","#2")}}
+\def\doregisterbibtexentry [#1][#2]{\ctxlua{commands.registerbibtexentry("#1","#2")}}
\def\doapplytobibtexsession[#1][#2]{\xmlprocessregistered{bibtex:#1}{#2}{#2}}
+\unexpanded\def\bibtexcommand#1%
+ {\ifcsname\??pb:c:#1\endcsname \else
+ \fakebibtexcommand{#1}%
+ \fi
+ \csname\??pb:c:#1\endcsname}
+
+\def\fakebibtexcommand#1%
+ {\ifcsname#1\endcsname
+ \writestatus{bibtex}{unknown command: #1, using built-in context variant}%
+ \setugvalue{\??pb:c:#1}{\dosomebibtexcommand{#1}}%
+ \else
+ \writestatus{bibtex}{unknown command: #1}%
+ \setugvalue{\??pb:c:#1}{\dofakebibtexcommand{#1}}%
+ \fi}
+
+\let\dosomebibtexcommand \getvalue
+\def\dofakebibtexcommand#1{{\tttf#1}}
+
+\def\defbibtexcommand#1%
+ {\setuvalue{\strippedcsname#1}}
+
+\def\bibxmldoifelse#1{\xmldoifelse\currentbibxmlnode{/field[@name='#1']}}
+\def\bibxmldoif #1{\xmldoif \currentbibxmlnode{/field[@name='#1']}}
+\def\bibxmldoifnot #1{\xmldoifnot \currentbibxmlnode{/field[@name='#1']}}
+\def\bibxmlflush #1{\xmlcontext \currentbibxmlnode{/field[@name='#1']}}
+\def\bibxmlsetup {\xmlsetup \currentbibxmlnode} % {#1}
+
+\def\currentbibtexformat{apa} % ho wto interface this, maybe split loading and key
+\def\currentbibxmlnode {unset}
+\def\currentbibxmltag {unset}
+
+\startxmlsetups bibtex
+ \xmlregistereddocumentsetups{#1}{}
+ \xmlsetsetup{#1}{bibtex|entry|field}{bibtex:*}
+ \xmlmain{#1}
+\stopxmlsetups
+
+\startxmlsetups bibtex:format
+ \bibtexpublicationsparameter\c!before\relax % prevents lookahead
+ \edef\currentbibxmlnode {#1}
+ \edef\currentbibxmltag {\xmlatt{#1}{tag}}
+ \edef\currentbibxmlcategory{\xmlatt{#1}{category}}
+ \ifconditional\tracebibtexformat
+ \tracedbibxmlintro\currentbibxmltag
+ \tracedbibxmlintro\currentbibxmlcategory
+ \fi
+ \ignorespaces
+ \xmlcommand{#1}{.}{bibtex:\currentbibtexformat:\currentbibxmlcategory}
+ \removeunwantedspaces
+ \bibtexpublicationsparameter\c!after\relax % prevents lookahead
+\stopxmlsetups
+
+\startxmlsetups bibtex:list
+ \xmlfilter{#1}{/bibtex/entry/command(bibtex:format)}
+\stopxmlsetups
+
+\startxmlsetups bibtex:bibtex
+ \xmlfilter{#1}{/entry/command(bibtex:format)}
+\stopxmlsetups
+
+% formatters
+
+\let\normalbibxmlflush\bibxmlflush
+
+\definecolor[bibtextracecolor:field] [darkred]
+\definecolor[bibtextracecolor:crossref][darkblue]
+\definecolor[bibtextracecolor:key] [darkgreen]
+
+\def\tracedbibxmlintro #1{{\tttf#1 -> }}
+\def\tracedbibxmlflush #1{\color[bibtextracecolor:field] {\tttf[#1]}}
+\def\tracedbibxmltexts #1{\color[bibtextracecolor:field] {\tttf<#1>}}
+\def\tracedbibxmlcrossref#1{\color[bibtextracecolor:crossref]{\tttf#1}}
+\def\tracedbibxmlkey #1{\color[bibtextracecolor:key] {\tttf#1}}
+
+\def\tracedbibxmltext
+ {\ifconditional\tracebibtexformat
+ \expandafter\tracedbibxmltexts % plural
+ \else
+ \expandafter\firstofoneargument
+ \fi}
+
+\def\bibxmlflush
+ {\ifconditional\tracebibtexformat
+ \expandafter\tracedbibxmlflush
+ \else
+ \expandafter\normalbibxmlflush
+ \fi}
+
+\startxmlsetups bibtex:format:crossref
+ \ifconditional\tracebibtexformat
+ \tracedbibxmlcrossref{\xmlfirst\currentbibxmlnode{/field[@name='crossref']/lower()}}
+ \else
+ \cite[\xmlfirst\currentbibxmlnode{/field[@name='crossref']/lower()}]
+ \fi
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:key
+ \ifconditional\tracebibtexformat
+ \tracedbibxmlkey{\normalbibxmlflush{key}}
+ \else
+ \bibxmlflush{key}
+ \fi
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:common:author
+ \ifconditional\tracebibtexformat
+ \bibxmlflush\currentbibtexvariant
+ \else
+ \xmlfilter{#1}{/field[@name='\currentbibtexvariant']/bibtexconcat('\currentbibtexvariant')}
+ \fi
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:author
+ \begingroup
+ \def\currentbibtexvariant{author}
+ \xmlsetup{#1}{bibtex:format:common:author}
+ \endgroup
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:artauthor
+ \begingroup
+ \def\currentbibtexvariant{artauthor}
+ \xmlsetup{#1}{bibtex:format:common:author}
+ \endgroup
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:editor
+ \begingroup
+ \def\currentbibtexvariant{editor}
+ \xmlsetup{#1}{bibtex:format:common:author}
+ \endgroup
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:doi
+% \bibdoifelse{\@@pb@doi}{#1\expanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3}
+ *doi*
+\stopxmlsetups
+
+
+\startxmlsetups bibtex:format:doi
+% \bibdoifelse{\@@pb@biburl}{#1\expanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#2}{#3}
+ *url*
+\stopxmlsetups
+
+\startxmlsetups bibtex:format:month
+% {\bibdoifelse\@@pb@month
+% {#1\doifnumberelse\@@pb@month
+% {\doifconversiondefinedelse\@@pbmonthconversion
+% {\convertnumber\@@pbmonthconversion\@@pb@month}{\@@pb@month}}%
+% {\@@pb@month}#2}%
+% {#3}
+ *month*
+\stopxmlsetups
+
+% lists
+
+\def\bibtexlistprocessor
+ {\ctxlua{bibtex.hacks.add(structure.lists.uservalue("\currentlist",\currentlistindex,"bibref"),\currentlistindex)}}
+
+\appendtoks
+ \definelist[\currentbibtexsession]%
+ \setuplist[\currentbibtexsession][\c!state=\v!start,\c!width=]%
+ \installstructurelistprocessor{\currentbibtexsession:userdata}{\bibtexlistprocessor}%
+\to \everydefinebibtexsession
+
+% \def\installbibtexsorter#1#2%
+% {\setvalue{\??pb:\c!sort:#1}{#2}}
+
+% \installbibtexsorter\v!no {no}
+% \installbibtexsorter\v!author {au}
+% \installbibtexsorter\v!title {ti}
+% \installbibtexsorter\v!short {ab}
+% \installbibtexsorter\empty {no}
+% \installbibtexsorter\s!default{no}
+
+% \setupbibtex
+% [\c!sorttype=\v!cite,
+% \c!sort=no]
+
+% \long\unexpanded\def\startpublication#1\stoppublication
+% {\blank
+% todo
+% \blank}
+
+% \let\stoppublication\relax
+
+\unexpanded\def\bibtexspace {\removeunwantedspaces\space}
+\unexpanded\def\bibtexperiod {\removeunwantedspaces.\space}
+\unexpanded\def\bibtexcomma {\removeunwantedspaces,\space}
+\unexpanded\def\bibtexlparent {\removeunwantedspaces\space(}
+\unexpanded\def\bibtexrparent {\removeunwantedspaces)\space}
+\unexpanded\def\bibtexlbracket{\removeunwantedspaces\space[}
+\unexpanded\def\bibtexrbracket{\removeunwantedspaces]\space}
+
+% interfacing
+
+% todo : lang en language
+% todo : directions
+
+
+% variables
+
+\newcount\bibtexblock \bibtexblock\plusone
+
+\newtoks \everysetupbibtexpublications
+\newtoks \everysetupbibtexcitations
+\newcount\bibtexcounter
+
+\def\bibtexrefprefix{\number\bibtexblock:}
+
+\let\currentbibtexsession\s!default
+\let\currentbibtexvariant\s!default
+
+% parameters: session+variant variant session shared
+
+\def\bibtexpublicationsparameter#1%
+ {\csname
+ \ifcsname\??pb\currentbibtexsession:\currentbibtexvariant#1\endcsname
+ \??pb\currentbibtexsession:\currentbibtexvariant#1%
+ \else\ifcsname\??pb:\currentbibtexvariant#1\endcsname
+ \??pb:\currentbibtexvariant#1%
+ \else\ifcsname\??pb\currentbibtexsession#1\endcsname
+ \??pb\currentbibtexsession#1%
+ \else\ifcsname\??pb#1\endcsname
+ \??pb#1%
+ \else
+ \s!empty
+ \fi\fi\fi\fi
+ \endcsname}
+
+\def\bibtexcitationparameter#1%
+ {\csname
+ \ifcsname\??pv\currentbibtexsession:\currentbibtexvariant#1\endcsname
+ \??pv\currentbibtexsession:\currentbibtexvariant#1%
+ \else\ifcsname\??pv:\currentbibtexvariant#1\endcsname
+ \??pv:\currentbibtexvariant#1%
+ \else\ifcsname\??pv\currentbibtexsession#1\endcsname
+ \??pv\currentbibtexsession#1%
+ \else\ifcsname\??pv#1\endcsname
+ \??pv#1%
+ \else
+ \s!empty
+ \fi\fi\fi\fi
+ \endcsname}
+
+% setup commands
+
+\unexpanded\def\setupbibtexpublications
+ {\let\currentpublicationclass\??pb
+ \let\everysetupbibtexwhatever\everysetupbibtexpublications
+ \dodoubleargument\dosetupbibtexwhatever}
+
+\unexpanded\def\setupbibtexcitations
+ {\let\currentpublicationclass\??pv
+ \let\everysetupbibtexwhatever\everysetupbibtexcitations
+ \dodoubleargument\dosetupbibtexwhatever}
+
+\unexpanded\def\setupbibtexpublicationvariants
+ {\let\currentpublicationclass\??pb
+ \let\everysetupbibtexwhatever\everysetupbibtexpublications
+ \dotripleargument\dosetupbibtexwhatevervariant}
+
+\unexpanded\def\setupbibtexcitationvariants
+ {\let\currentpublicationclass\??pv
+ \let\everysetupbibtexwhatever\everysetupbibtexcitations
+ \dotripleargument\dosetupbibtexwhatevervariant}
+
+\def\dosetupbibtexwhatever[#1][#2]% [sessionlist] [setup]
+ {\ifsecondargument
+ % sessions setups
+ \def\dobtxcommand##1{\getparameters[\currentpublicationclass##1][#2]}%
+ \processcommalist[#1]\dobtxcommand
+ \else
+ % setups
+ \getparameters[\currentpublicationclass][#1]%
+ \the\everysetupbibtexwhatever
+ \fi}
+
+\def\dosetupbibtexwhatevervariant[#1][#2][#3]% [sessionlist] [variantlist] [setup]
+ {\ifthirdargument
+ % sessions variants setups
+ \def\dobtxcommand##1%
+ {\def\dodobtxcommand####1{\getparameters[\currentpublicationclass##1:####1][#3]}%
+ \processcommalist[#2]\dodobtxcommand}%
+ \processcommalist[#1]\docbtxommand
+ \else\ifsecondargument
+ % variants setups
+ \def\dobtxcommand##1{\getparameters[\currentpublicationclass:##1][#2]}%
+ \processcommalist[#1]\dobtxcommand
+ \else
+ % setups
+ \getparameters[\currentpublicationclass][#1]%
+ \the\everysetupbibtexwhatever
+ \fi\fi}
+
+% some initializations
+
+\setupbibtexcitationvariants
+ [author,authoryear,authoryears]
+ [\c!namesep={, }]
+
+% loading alternatives (apa etc)
+
+\def\doloadbibtexpublicationalternative
+ {\ifproductionrun
+ \edef\bibtexpublicationsalternative{\@@pbalternative}% parent
+ \ifx\bibtexpublicationsalternative\empty \else
+ \processcommacommand[\bibtexpublicationsalternative]\dodoloadbibtexpublicationalternative
+ \let\@@pbalternative\empty
+ \fi
+ \fi}
+
+\def\dodoloadbibtexpublicationalternative#1%
+ {\doonlyonce{#1}
+ {\readsysfile{bxml-#1.mkiv}
+ {\showmessage\m!publications{6}{bxml-#1}}
+ {\showmessage\m!publications{1}{bxml-#1}}}}
+
+\appendtoks
+ \doloadbibtexpublicationalternative
+\to \everysetupbibtexpublications
+
+\appendtoks
+ \doloadbibtexpublicationalternative
+\to \everyjob
+
+% whatever, should be key
+
+\def\bibtexleftnumber#1{#1\hfill~}
+
+% testing
+
+% \showmessage\m!publications{5}{#1 is unknown}\secondoftwoarguments}
+
+\let\doifbibreferencefoundelse\secondofthreearguments
+
+% lists
+
+\newtoks\everysetupbibtexlistplacement
+
+% this will change as we need it too often .. we will use context.thebibtexnamesep
+
+\appendtoks
+ \ctxlua {bibtex.authors.setsettings {
+ namesep = \!!bs\bibtexpublicationsparameter\c!namesep\!!es,
+ lastnamesep = \!!bs\bibtexpublicationsparameter\c!lastnamesep\!!es,
+ finalnamesep = \!!bs\bibtexpublicationsparameter\c!finalnamesep\!!es,
+ firstnamesep = \!!bs\bibtexpublicationsparameter\c!firstnamesep\!!es,
+ juniorsep = \!!bs\bibtexpublicationsparameter\c!juniorsep\!!es,
+ vonsep = \!!bs\bibtexpublicationsparameter\c!vonsep\!!es,
+ surnamesep = \!!bs\bibtexpublicationsparameter\c!surnamesep\!!es,
+ namesep = \!!bs\bibtexpublicationsparameter\c!namesep\!!es,
+ lastnamesep = \!!bs\bibtexpublicationsparameter\c!lastnamesep\!!es,
+ finalnamesep = \!!bs\bibtexpublicationsparameter\c!finalnamesep\!!es,
+ author = {
+ etallimit = \!!bs\bibtexpublicationsparameter\c!authoretallimit\!!es,
+ etaldisplay = \!!bs\bibtexpublicationsparameter\c!authoretaldisplay\!!es,
+ etaltext = \!!bs\bibtexpublicationsparameter\c!authoretaltext\!!es,
+ },
+ editor = {
+ etallimit = \!!bs\bibtexpublicationsparameter\c!editoretallimit\!!es,
+ etaldisplay = \!!bs\bibtexpublicationsparameter\c!editoretaldisplay\!!es,
+ etaltext = \!!bs\bibtexpublicationsparameter\c!editoretaltext\!!es,
+ },
+ artauthor = {
+ etallimit = \!!bs\bibtexpublicationsparameter\c!artauthoretallimit\!!es,
+ etaldisplay = \!!bs\bibtexpublicationsparameter\c!artauthoretaldisplay\!!es,
+ etaltext = \!!bs\bibtexpublicationsparameter\c!artauthoretaltext\!!es,
+ },
+ } }%
+\to \everysetupbibtexlistplacement
+
+\def\completebibtexpublications{\dodoubleempty\docompletebibtexpublications}
+\unexpanded\def\placebibtexpublications {\dodoubleempty\doplacebibtexpublications}
+
+\def\docompletebibtexpublications[#1][#2]% title might become obsolete, just headtext
+ {\begingroup
+ \edef\currentbibtexsession{#1}%
+ \let\currentlist\currentbibtexsession
+ \setuplist[\currentbibtexsession][\c!criterium=\v!previous,#2]
+ \doifelsenothing{\namedlistparameter\currentbibtexsession\c!title}
+ {\systemsuppliedchapter[\currentbibtexsession]{\headtext{\currentbibtexsession}}}
+ {\normalexpanded{\systemsuppliedchapter[\currentbibtexsession]{\namedlistparameter\currentbibtexsession\c!title}}}%
+ \dodoplacebibtexpublications}
+
+\def\doplacebibtexpublications[#1][#2]%
+ {\begingroup
+ \edef\currentbibtexsession{#1}%
+ \let\currentlist\currentbibtexsession
+ \setuplist[\currentbibtexsession][\c!criterium=\v!previous,#2]%
+ \dodoplacebibtexpublications}
+
+\def\dodoplacebibtexpublications
+ {\determinelistcharacteristics[\currentbibtexsession]%
+ \the\everysetupbibtexlistplacement
+ \forgetall
+ \typesetbibtexlist
+ \endgroup
+ \global\advance\bibtexblock\plusone}
+
+\setvalue{\??pb:\c!numbering:\v!short}#1% todo var s -> short tag
+ {\bibtexlistnumberbox{\bibtexpublicationsparameter\c!numbercommand{\bibtexgetshort\currentpublicationtag}}}
+
+\setvalue{\??pb:\c!numbering:\v!bib}#1% todo var n -> number
+ {\bibtexlistnumberbox{\bibtexpublicationsparameter\c!numbercommand{\bibtexgetnumber\currentpublicationtag}}}
+
+\setvalue{\??pb:\c!numbering:\s!unknown}#1%
+ {\bibtexlistnumberbox{\bibtexpublicationsparameter\c!numbercommand{#1}}}
+
+\def\@@pblimitednumber % name
+ {\csname\??pb:\c!numbering:%
+ \ifcsname\??pb:\c!numbering:\currentbibtexnumbering\endcsname
+ \currentbibtexnumbering
+ \else
+ \s!unknown
+ \fi
+ \endcsname}
+
+\appendtoks
+ \edef\currentbibtexnumbering{\bibtexpublicationsparameter\c!numbering}%
+ \ifx\currentbibtexnumbering\v!no
+ \setuplist[\currentbibtexsession][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]%
+ \else
+ \setuplist[\currentbibtexsession][\c!numbercommand=\@@pblimitednumber]%
+ \fi
+\to \everysetupbibtexlistplacement
+
+\newdimen\bibtexnumberwidth
+
+\def\bibtexlistnumberbox{\hbox \ifcase\bibtexnumberwidth\else to \bibtexnumberwidth\fi}
+
+\appendtoks
+ \doifelse{\bibtexpublicationsparameter\c!autohang}\v!yes
+ {\ifx\currentbibtexnumbering\v!short
+ \setbox\scratchbox\hbox{\bibtexpublicationsparameter\c!numbercommand{\bibtexpublicationsparameter\c!samplesize}}%
+ \else
+ \setbox\scratchbox\hbox{\bibtexpublicationsparameter\c!numbercommand{\ctxlua{tex.write(structure.lists.size())}}}%
+ \fi
+ \bibtexnumberwidth\wd\scratchbox
+ \setuplist[\currentbibtexsession][\c!distance=\zeropoint]}
+ {\doifelsenothing{\bibtexpublicationsparameter\c!width}
+ {\bibtexnumberwidth\zeropoint}
+ {\bibtexnumberwidth\bibtexpublicationsparameter\c!width}}%
+ \setuplist[\currentbibtexsession][\c!width=\bibtexnumberwidth]%
+\to \everysetupbibtexlistplacement
+
+\appendtoks
+ \let\maybeyear\gobbleoneargument
+ \let\noopsort \gobbleoneargument
+\to \everysetupbibtexlistplacement
+
+\appendtoks
+ \doifelse{\bibtexpublicationsparameter\c!maybeyear}\v!off
+ {\let\maybeyear\gobbleoneargument}
+ {\let\maybeyear\firstofoneargument}%
+\to \everysetupbibtexlistplacement
+
+\appendtoks
+ \doifnot{\bibtexpublicationsparameter\c!option}\v!continue
+ {\global\bibtexcounter\zerocount}%
+\to \everysetupbibtexlistplacement
+
+\appendtoks
+ \edef\currentbibtexcriterium{\namedlistparameter\currentbibtexsession\c!criterium}%
+\to \everysetupbibtexlistplacement
+
+\def\typesetbibtexlist
+ {\dobeginoflist
+ \doif{\namedlistparameter\currentbibtexsession\c!criterium}\v!cite
+ {\setuplist[\currentbibtexsession][\c!criterium=\v!here]}%
+ \doifelse{\bibtexpublicationsparameter\c!method}\v!local
+ {\ctxlua{bibtex.hacks.reset(1)}}% function can take method
+ {\ctxlua{bibtex.hacks.reset(2)}}%
+ \placestructurelist
+ {\currentbibtexsession}
+ {\currentbibtexcriterium}
+ {\namedlistparameter\currentbibtexsession\c!number}%
+ \ctxlua{bibtex.hacks.flush("\bibtexpublicationsparameter\c!sorttype")}%
+ \doendoflist}
+
+\unexpanded\def\typesetbibtexpublication#1%
+ {\edef\currentbibtexsessiontag{#1}%
+ \ifx\currentbibtexsessiontag\empty
+ % can't really happen
+ \else\ifx\currentbibtexcriterium\v!all
+ \doplacepublicationindeed
+ \else
+ \ctxlua{bibtex.hacks.doifalreadyplaced("\currentbibtexsessiontag")}
+ \donothing
+ \dotypesetbibtexpublication
+ \fi\fi}
+
+\def\dotypesetbibtexpublication
+ {\doifbibreferencefoundelse\currentbibtexsessiontag
+ {\global\advance\bibtexcounter\plusone
+ \ctxlua{bibtex.hacks.registerplaced("\currentbibtexsessiontag")}%
+ \dodolistelement{\currentbibtexsession}{}{\number\bibtexcounter}{\thebibtexpublicationlistelement}{}{}}
+ {}} % invalid
+
+\def\thebibtexpublicationlistelement
+ {\strut
+ \expanded{\reference[\bibtexrefprefix\currentbibtexsessiontag]{\number\bibtexcounter}}%
+ \dotypesetabibtexpublication\currentbibtexsessiontag
+ \strut}
+
+\def\dotypesetabibtexpublication#1%
+ {\begingroup
+ \ignorespaces
+ \xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/command(bibtex:format)}%
+ \removeunwantedspaces
+% \ignorespaces
+% \bibalternative{\bibgetvart{#1}}%
+% \removeunwantedspaces
+ \endgroup}
+
+\def\doprocessbibtexentry#1{\typesetbibtexpublication{#1}}
+
+% citations
+
+\unexpanded\def\bibtexcitation[#1]%
+ {\edef\currentbibtexsession{#1}%
+ \strictdoifnextoptionalelse\dobibtexcitation\dobibtexref}
+
+\def\dobibtexref#1%
+ {\dodobibtexcitation[#1][]}
+
+\def\dobibtexcitation[#1]%
+ {\strictdoifnextoptionalelse{\dodobibtexcitation[#1]}{\dodobibtexcitation[#1][]}}
+
+\def\dodobibtexcitation[#1][#2]%
+ {\dontleavehmode
+ \begingroup
+ \doifelsenothing{#2}\secondargumentfalse\secondargumenttrue
+ \ifsecondargument
+ \dowhateverbibtexcitation{#1}{#2}%
+ \else
+ \donumberedbibtexcitation{#1}%
+ \fi
+ \endgroup}
+
+\def\dowhatevercitation#1#2%
+ {\processcommalist[#2]\dobibtexcitationindeed
+ \setupinteraction[\c!style=]% use flag instead
+ \doifassignmentelse{#1}
+ {\getparameters[\??pb\??pb][\c!alternative=,\c!extras=,#1]%
+ \edef\currentbibtexvariant{\@@pb@@pbalternative}%
+ \ifx\currentbibtexvariant\empty
+ \edef\currentbibtexvariant{\bibtexpublicationparameter\c!refcommand}%
+ \fi
+ \ifx\@@pb@@pbextras\empty
+ \setupcite[\currentbibtexvariant][#1]%
+ \else
+ \edef\@@pb@@pbextras{{\@@pb@@pbextras\ifdefined\@@pb@@pbright\@@pb@@pbright\else\bibtexpublicationparameter\c!right\fi}}%
+ \expanded{\setupcite[\currentbibtexvariant][#1,\c!right=\@@pb@@pbextras]}%
+ \fi}%
+ {\def\currentbibtexvariant{#1}}%
+ \getvalue{bibtex\currentbibtexvariant ref}[#2]}
+
+\def\donumberedbibtexcitation#1%
+ {\processcommalist[#1]\dobibtexcitationindeed
+ \setupinteraction[\c!style=]%
+ \edef\currentbibtexvariant{\bibtexcitationparameter\c!refcommand}%
+ \getvalue{bibtex\currentbibtexvariant ref}[#1]}
+
+\def\dobibtexcitationindeed#1%
+ {\iftrialtypesetting \else
+ \expanded{\writedatatolist[\currentbibtexsession][bibref=#1]}%
+ \fi}
+
+\def\nobibtexcitation[#1]%
+ {\processcommalist[#1]\dobibtexcitationindeed}
+
+\def\bibtexnumref[#1]%
+ {\dontleavehmode
+ \begingroup
+ \bibtexcitationparameter\v!left
+ \penalty\!!tenthousand
+ \ctxlua{bibtex.hacks.resolve("","\number\bibtexblock","#1")}%
+ \bibtexcitationparameter\v!right
+ \endgroup}
+
+\def\dowithbibtexnumrefconnector#1#2%
+ {\ifnum#1>\plusone
+ \ifnum#2>\plusone
+ \ifnum#2=#1\relax
+ \bibtexpublicationsparameter\c!lastpubsep
+ \else
+ \bibtexpublicationsparameter\c!pubsep
+ \fi
+ \fi
+ \fi}
+
+\def\dowithbibtexnumref#1#2#3#4#5% n, i, prefix block ref
+ {\dowithbibtexnumrefconnector{#1}{#2}%
+ \def\bibtexrefprefix{#4:}%
+ \inbiblink[#5]}
+
+\def\dowithbibtexnumrefrange#1#2#3#4#5#6#7% n, i, prefix block ref
+ {\dowithbibtexnumrefconnector{#1}{#2}%
+ \def\bibtexrefprefix{#4:}%
+ \inbiblink[#5]%
+ \endash
+ \def\bibtexrefprefix{#6:}%
+ \inbiblink[#7]}
+
+\def\nobibtexnumref#1%
+ {[#1]}
+
+% hm
+
+% \def\@@pbinumbercommand{\executeifdefined{\??pb:\c!numbercommand:\@@pbnumbering}\firstofoneargument}
+
+% \letvalue{\??pb:\c!numbercommand:\v!yes }\firstofoneargument
+% \letvalue{\??pb:\c!numbercommand:\v!no }\gobbleoneargument
+% \setvalue{\??pb:\c!numbercommand:\v!short}{\bibtexgetshort\currentpublicationtag\gobbleoneargument}
+% \setvalue{\??pb:\c!numbercommand:\v!bib }{\bibtexgetnumber\currentpublicationtag\gobbleoneargument}
+
+% \def\bibalternative#1{\csname\??pv\@@currentalternative#1\endcsname}
+
+% basic setup
+
+% parent -> publicationlist
+%
+% \setuplist
+% [\currentbibtexsession]
+% [\c!samplesize={AA99},
+% \c!alternative=a,
+% \c!interaction=,
+% \c!pagenumber=\v!no,
+% #1,
+% \c!command=]
+
+% \setuppublicationlist
+% [\c!title=,
+% \c!command=\dospecialbibinsert,
+% \c!maybeyear=\v!on]
+
+\setupbibtexpublications
+ [\c!monthconversion=,
+ \c!alternative=apa,
+ \c!method=\v!global,
+ \c!refcommand=num,
+ \c!numbercommand=\bibtexleftnumber]
+
+\setupbibtexcitations % command ?
+ [\c!refcommand=num]
+
+% helpers
+
+\def\doifbibtexinteractionelse
+ {\iflocation
+ \edef\temp{\bibtexcitationparameter\c!interaction}%
+ \ifx\temp\v!stop
+ \@EA@EA@EA\secondoftwoarguments
+ \else
+ \@EA@EA@EA\firstoftwoarguments
+ \fi
+ \else
+ \@EA\secondoftwoarguments
+ \fi}
+
+% variants
+
+% todo: lastsep here
+
+\newconditional\firstbibtexrefsep
+
+\def\bibtexresetrefsep
+ {\settrue\firstbibtexrefsep}
+
+\def\bibtexinsertrefsep
+ {\ifconditional\firstbibtexrefsep
+ \setfalse\firstbibtexrefsep
+ \else
+ \bibtexcitationparameter\c!pubsep
+ \fi}
+
+\def\inbibtexlink#1#2%
+ {\doifreferencefoundelse{\bibtexrefprefix#1}
+ {\goto{#2}[\bibtexrefprefix#1]}
+ {!#1!\unknownreference{#1}}}
+
+\def\dobibtexgotolink#1#2%
+ {\doifreferencefoundelse{\bibtexrefprefix#1}
+ {\goto{#2}[\bibtexrefprefix#1]}
+ {!#1!\unknownreference{#1}}}
+
+\def\dobibattexlink#1#2%
+ {\doifreferencefoundelse{\bibtexrefprefix#1}
+ {\at{#2}[\bibtexrefprefix#1]}
+ {!#1!\unknownreference{#1}}}
+
+\def\dobibtexurllink#1#2%
+ {\expanded{\useURL[bibtex:url:#1][#2]}%
+ \doifbibtexinteractionelse
+ {\goto{\url[bibtex:url:#1]}[url(bibtex:url:#1)]}
+ {\url[bibtex:url:#1]}}
+
+% todo: style, color
+
+\unexpanded\def\bibtexdataref {\dodoubleargument\dobibtexdataref}
+\unexpanded\def\bibtextyperef {\dodoubleargument\dobibtextyperef}
+\unexpanded\def\bibtexkeyref {\dodoubleargument\dobibtexkeyref}
+\unexpanded\def\bibtexserialref {\dodoubleargument\dobibtexserialref}
+\unexpanded\def\bibtexurlref {\dodoubleargument\dobibtexurlref}
+\unexpanded\def\bibtexdoiref {\dodoubleargument\dobibtexdoiref}
+\unexpanded\def\bibtexpageref {\dodoubleargument\dobibtexpageref}
+\unexpanded\def\bibtexnoneref {\dodoubleargument\dobibtexnoneref}
+\unexpanded\def\bibtexshortref {\dodoubleargument\dobibtexshortref}
+\unexpanded\def\bibtexyearref {\dodoubleargument\dobibtexyearref}
+\unexpanded\def\bibtexauthorref {\dodoubleargument\dobibtexauthorref}
+\unexpanded\def\bibtexauthoryearref {\dodoubleargument\dobibtexauthoryearref}
+\unexpanded\def\bibtexauthoryearsref{\dodoubleargument\dobibtexauthoryearsref}
+
+\def\dobibtexdataref {\doprocessbibtexref\dodobibtexdataref {ref}} % [#1][#2]
+\def\dobibtextyperef {\doprocessbibtexref\dodobibtextyperef {type}} % [#1][#2]
+\def\dobibtexkeyref {\doprocessbibtexref\dodobibtexkeyref {key}} % [#1][#2]
+\def\dobibtexserialref {\doprocessbibtexref\dodobibtexserialref {serial}} % [#1][#2]
+\def\dobibtexurlref {\doprocessbibtexref\dodobibtexurlref {url}} % [#1][#2]
+\def\dobibtexdoiref {\doprocessbibtexref\dodobibtexdoiref {doi}} % [#1][#2]
+\def\dobibtexpageref {\doprocessbibtexref\dodobibtexpageref {page}} % [#1][#2]
+\def\dobibtexnoneref {\doprocessbibtexref\dodobibtexnoneref {none}} % [#1][#2]
+\def\dobibtexshortref {\doprocessbibtexref\dodobibtexshortref {short}} % [#1][#2]
+\def\dobibtexyearref {\doprocessbibtexref\dodobibtexyearref {year}} % [#1][#2]
+\def\dobibtexauthorref {\doprocessbibtexref\dodobibtexauthorref {author}} % [#1][#2]
+\def\dobibtexauthoryearref {\doprocessbibtexref\dodobibtexauthoryearref {authoryear}} % [#1][#2]
+\def\dobibtexauthoryearsref{\doprocessbibtexref\dodobibtexauthoryearsref{authoryears}} % [#1][#2]
+
+\def\doprocessbibtexref#1#2[#3][#4]%
+ {\edef\currentbibtexsession{#3}%
+ \edef\currentbibtexvariant{#2}%
+ \def\dodoprocessbibtexref##1%
+ {% test for existence
+ \edef\currentbibtextag{##1}%
+ \bibtexinsertrefsep
+ #1{##1}}%
+ \bibtexresetrefsep
+ \bibtexcitationparameter\v!left
+ \processcommalist[#4]\dodoprocessbibtexref\relax
+ \bibtexcitationparameter\v!right}
+
+\def\dodobibtexdataref#1%
+ {\dotypesetabibtexpublication{#1}}
+
+\def\dodobibtextyperef#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/attribute('category')}}%
+ \bibtexrefcontent}
+
+\def\dodobibtexkeyref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='key']/context()}}%
+ \dobibtexgotolink{#1}{\bibtexrefcontent}}
+
+\def\dodobibtexserialref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/match()}}%
+ \dobibtexgotolink{#1}{\bibtexrefcontent}}
+
+\def\dodobibtexurlref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/field[@name='url']/context()}}%
+ \dobibtexurllink{#1}{\bibtexrefcontent}}
+
+\def\dodobibtexdoiref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/field[@name='doi']/context()}}%
+ \dobibtexurllink{#1}{http://dx.doi.org/\bibtexrefcontent}}
+
+\def\dodobibtexpageref#1%
+ {\dobibtexatlink{#1}{}} % second argument can become 'page'
+
+\def\dodobibtexnoneref#1%
+ {}
+
+\def\dodobibtexshortref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/bibtexshort()}}%
+ \dobibtexgotolink{#1}{\bibtexrefcontent}}
+
+\def\dodobibtexyearref#1%
+ {\edef\bibtexrefcontent{\xmlfilter{bibtex:\currentbibtexsession}{/bibtex/entry[@tag='#1']/field[@name='year']/context()}}%
+ \bibtexrefcontent}
+
+% \def\bibmaybeinteractive#1#2%
+% {\doifelsevalue{@@pv\@@currentalternative\c!compress}
+% {\ifbibinteractionelse{\gotobiblink{#2}[#1]}{#2}}
+% {#2}}
+
+% \def\bibauthornumref[#1]%
+% {\getcommalistsize[#1]%
+% \global\bibitemcounter\commalistsize
+% \bibresetrefsep
+% \processcommalist[#1]\dobibauthornumref }
+%
+% \def\dobibauthornumref#1%
+% {\bibinsertrefsep
+% \doifbibreferencefoundelse{#1}
+% {\begingroup
+% \bibgetvara{#1}%
+% \bibalternative\c!inbetween
+% \setuppublications[\c!refcommand=num]%
+% \cite[#1]%
+% \endgroup}
+% {\unknownreference{#1}}}
+
+% compress years
+% andtext namesep
+% otherstext authoretallimit
+
+% we will use context.* instead at the lua end because it saves us passing settings
+
+% \def\thebibtexpubsep {\bibtexpublicationsparameter\c!pubsep}
+% \def\thebibtexlastpubsep {\bibtexpublicationsparameter\c!lastpubsep}
+% \def\thebibtexfinalpubseparator{\bibtexpublicationsparameter\c!lastpubsep}
+
+\def\dodobibtexauthorref #1{\ctxlua{bibtex.authorref ("bibtex:\currentbibtexsession","#1","normal","author")}}
+\def\dodobibtexauthoryearref #1{\ctxlua{bibtex.authoryearref ("bibtex:\currentbibtexsession","#1","normal","author")}}
+\def\dodobibtexauthoryearsref#1{\ctxlua{bibtex.authoryearsref("bibtex:\currentbibtexsession","#1","normal","author")}}
+
+\unexpanded\def\bibtexsingularplural#1#2{\ctxlua{bibtex.singular_or_plural(\!!bs#1\!!es,\!!bs#2\!!es)}}
+
\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/bibl-tra.lua b/Master/texmf-dist/tex/context/base/bibl-tra.lua
new file mode 100644
index 00000000000..44223102859
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/bibl-tra.lua
@@ -0,0 +1,194 @@
+if not modules then modules = { } end modules ['bibl-bib'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+bibtex = bibtex or { }
+bibtex.hacks = bibtex.hacks or { }
+
+local match, gmatch, format, concat, sort = string.match, string.gmatch, string.format, table.concat, table.sort
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local variables, constants = interfaces.variables, interfaces.constants
+
+local trace_bibtex = false trackers.register("publications.bibtex", function(v) trace_bibtex = v end)
+
+local hacks = bibtex.hacks
+
+local list, done, alldone, used, registered, ordered = { }, { }, { }, { }, { }, { }
+local mode = 0
+
+local template = string.striplong([[
+ \citation{*}
+ \bibstyle{cont-%s}
+ \bibdata{%s}
+]])
+
+function hacks.process(settings)
+ local style = settings.style or ""
+ local database = settings.database or ""
+ local jobname = tex.jobname
+ if database ~= "" then
+ interfaces.showmessage("publications",3)
+ io.savedata(file.addsuffix(jobname,"aux"),format(template,style,database))
+ if trace_bibtex then
+ logs.report("publications","processing bibtex file '%s'",jobname)
+ end
+ os.execute(format("bibtex %s",jobname))
+ -- purge 'm
+ end
+end
+
+function hacks.register(str)
+ if trace_bibtex then
+ logs.report("publications","registering bibtex entry '%s'",str)
+ end
+ registered[#registered+1] = str
+ ordered[str] = #registered
+end
+
+function hacks.reset(m)
+ mode, list, done = m, { }, { }
+end
+
+function hacks.add(str,listindex)
+ if not str or mode == 0 then
+ -- skip
+ elseif mode == 1 then
+ -- all locals but no duplicates
+ local sc = structure.sections.currentid()
+ if done[str] ~= sc then
+ done[str], alldone[str] = sc, true
+ list[#list+1] = { str, listindex }
+ end
+ elseif mode == 2 then
+ -- all locals but no preceding
+ local sc = structure.sections.currentid()
+ if not alldone[str] and done[str] ~= sc then
+ done[str], alldone[str] = sc, true
+ list[#list+1] = { str, listindex }
+ end
+ end
+end
+
+local function compare(a,b)
+ local aa, bb = a[1], b[1]
+ if aa and bb then
+ return ordered[aa] < ordered[bb]
+ else
+ return true
+ end
+end
+
+function hacks.flush(sortvariant)
+ if sortvariant == "" or sortvariant == variables.cite or sortvariant == "default" then
+ -- order is cite order i.e. same as list
+ else
+ sort(list,compare)
+ end
+ for i=1,#list do
+ context.doprocessbibtexentry(list[i][1])
+ end
+end
+
+function hacks.registerplaced(str)
+ used[str] = true
+end
+
+function hacks.doifalreadyplaced(str)
+ commands.testcase(used[str])
+end
+
+-- we ask for <n>:tag but when we can't find it we go back
+-- to look for previous definitions, and when not found again
+-- we look forward
+
+local function compare(a,b)
+ return a[3] < b[3]
+end
+
+function hacks.resolve(prefix,block,reference) -- maybe already feed it split
+ local subset = jobreferences.collected[prefix or ""] or jobreferences.collected[""]
+ if subset then
+ local result, done = { }, { }
+ block = tonumber(block)
+ for rest in gmatch(reference,"([^,%s]+)") do
+ local blk, tag, found = block, nil, nil
+ if block then
+ tag = blk .. ":" .. rest
+ found = subset[tag]
+ if not found then
+ for i=block-1,1,-1 do
+ tag = i .. ":" .. rest
+ found = subset[tag]
+ if found then
+ blk = i
+ break
+ end
+ end
+ end
+ end
+ if not found then
+ blk = "*"
+ tag = blk .. ":" .. rest
+ found = subset[tag]
+ end
+ if found then
+ local current = found.entries and found.entries.text
+ if current and not done[current] then
+ result[#result+1] = { blk, rest, current }
+ done[current] = true
+ end
+ end
+ end
+ -- todo: ranges so the interface will change
+ sort(result,compare)
+ local first, last, firsti, lasti, firstr, lastr
+ local collected = { }
+ for i=1,#result do
+ local r = result[i]
+ local current = r[3]
+ if not first then
+ first, last, firsti, lasti, firstr, lastr = current, current, i, i, r, r
+ elseif current == last + 1 then
+ last, lasti, lastr = current, i, r
+ else
+ if last > first + 1 then
+ collected[#collected+1] = { firstr[1], firstr[2], lastr[1], lastr[2] }
+ else
+ collected[#collected+1] = { firstr[1], firstr[2] }
+ if last > first then
+ collected[#collected+1] = { lastr[1], lastr[2] }
+ end
+ end
+ first, last, firsti, lasti, firstr, lastr = current, current, i, i, r, r
+ end
+ end
+ if first then
+ if last > first + 1 then
+ collected[#collected+1] = { firstr[1], firstr[2], lastr[1], lastr[2] }
+ else
+ collected[#collected+1] = { firstr[1], firstr[2] }
+ if last > first then
+ collected[#collected+1] = { lastr[1], lastr[2] }
+ end
+ end
+ end
+ if #collected > 0 then
+ for i=1,#collected do
+ local c = collected[i]
+ if c[3] then
+ context.dowithbibtexnumrefrange(#collected,i,prefix,c[1],c[2],c[3],c[4])
+ else
+ context.dowithbibtexnumref(#collected,i,prefix,c[1],c[2])
+ end
+ end
+ else
+ context.nobibtexnumref("error 1")
+ end
+ else
+ context.nobibtexnumref("error 2")
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/bibl-tra.mkii b/Master/texmf-dist/tex/context/base/bibl-tra.mkii
new file mode 100644
index 00000000000..087781db9b1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/bibl-tra.mkii
@@ -0,0 +1,1778 @@
+%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
+
+%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}}
+
+\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 liust has been reordered here, and the meanings
+%D 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/bibl-tra.mkiv b/Master/texmf-dist/tex/context/base/bibl-tra.mkiv
new file mode 100644
index 00000000000..519af0c6f77
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/bibl-tra.mkiv
@@ -0,0 +1,1552 @@
+%D \module
+%D [ file=bibl-tra,
+%D version=2009.08.22,
+%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 module has been adapted to \MKIV\ by Hans Hagen so if things go wrong,
+%D he is to blame. The changes concern references and lists but teh rendering
+%D itself is unchanged. Future versions might provide variants as we have plans
+%D for an upgrade.
+%D
+%D We use a still somewhat experimental extension to the list
+%D mechanism. Eventually the bibtex module will use the bibl loader
+%D and access the data by means of lpath expressions. In that case we
+%D don't need to process the bibliography but still need to track
+%D usage as done here.
+%D
+%D A bit ongoing: make more local macros prefixed with bib, i.e. the bib
+%D namespace is reserved.
+
+\writestatus{loading}{ConTeXt Bibliography Support / BibTeX}
+
+\definefilesynonym[bib][obsolete]
+
+\registerctxluafile{bibl-tra}{1.001}
+
+%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\"unster (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\"achter) (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 Adapt referencing and list insertion to \MKIV. Update some code
+%D to the latest \CONTEXT. Change some names in order to avoid conflicts
+%D with existing core names (like \type {\insertpages}).
+%D \item All constants, variables, message etc.\ are now in the core.
+%D \item Added key: \type {method} (when \type {global}, previous shown entries are
+%D not shown again, when \type {local} they are repeated).
+%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 \item 9 vs 10, 19 vs 20 ... prevent extra runs when only subtle changes in wd of reference
+%D \stopitemize
+
+\unprotect
+
+\def\biblistname{pubs} % for compatibility
+
+\definelist
+ [pubs]
+
+\setuplist
+ [pubs]
+ [\c!state=\v!start,
+ \c!width=]
+
+\installstructurelistprocessor{pubs:userdata}%
+ {\ctxlua{bibtex.hacks.add(structure.lists.uservalue("\currentlist",\currentlistindex,"bibref"),\currentlistindex)}}
+
+\newcount\bibtexblock \bibtexblock\plusone
+
+%D \macros{bibdoif,bibdoifnot,bibdoifelse}
+%D
+%D Here are a few small helpers that are used a lot in all the typesetting commands
+%D (\type{\bibinsert...}) 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 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
+
+\newtoks\everysetupbibtex
+
+\unexpanded\def\setupbibtex
+ {\dosingleempty\dosetupbibtex}
+
+\def\dosetupbibtex[#1]%
+ {\let\@@pbdatabase\empty
+ \getparameters[\??pb][#1]%
+ \the\everysetupbibtex}
+
+\def\installbibtexsorter#1#2%
+ {\setvalue{\??pb:\c!sort:#1}{#2}}
+
+\installbibtexsorter\v!no {no}
+\installbibtexsorter\v!author {au}
+\installbibtexsorter\v!title {ti}
+\installbibtexsorter\v!short {ab}
+\installbibtexsorter\empty {no}
+\installbibtexsorter\s!default{no}
+
+\def\thebibtexsorter{\executeifdefined{\??pb:\c!sort:\@@pbsort}\@@pbsort}
+
+\appendtoks
+ \ifx\@@pbdatabase\empty\else
+ \doifmode{*\v!first}{\ctxlua{bibtex.hacks.process { style="\thebibtexsorter", database="\@@pbdatabase" }}}%
+ \fi
+\to \everysetupbibtex
+
+\setupbibtex
+ [\c!sorttype=\v!cite,
+ \c!sort=no]
+
+%D \macros{iftypesetall,ifbibcitecompress}
+%D
+%D The module needs some new \type{\if} statements.
+
+\newtoks\everysetuppublications
+
+\unexpanded\def\setuppublications
+ {\dosingleargument\dosetuppublications}
+
+\def\dosetuppublications[#1]%
+ {\getparameters[\??pb][\c!alternative=,#1]%
+ \doifsomething\@@pbalternative
+ {\readsysfile{bibl-\@@pbalternative.tex}
+ {\showmessage\m!publications{6}{bibl-\@@pbalternative}}
+ {\showmessage\m!publications{1}{bibl-\@@pbalternative}}%
+ \let\@@pbalternative\empty}%
+ \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
+ \ignorespaces}
+
+%D We can omit already shown references (\v!global) or use fresh
+%D lists each time (\v!local).
+
+\chardef\bibtexoncemode\plusone % 0=disable, 1=local, 2=global
+
+\appendtoks
+ \doifelse\@@pbmethod\v!local
+ {\chardef\bibtexoncemode\plusone}%
+ {\chardef\bibtexoncemode\plustwo}%
+\to \everysetuppublications
+
+%D Cite lists are compressed, if possible. This is set later on.
+
+\newif\ifbibcitecompress\bibcitecompresstrue
+
+% \appendtoks
+% \processaction
+% [\@@pbnumbering]
+% [ \v!yes=>\let\@@pbinumbercommand\firstofoneargument,
+% \v!no=>\let\@@pbinumbercommand\gobbleoneargument,
+% \v!short=>\def\@@pbinumbercommand##1{\bibgetvars\currentpublicationkey},
+% \v!bib=>\def\@@pbinumbercommand##1{\bibgetvarn\currentpublicationkey},
+% \s!unknown=>\let\@@pbinumbercommand\firstofoneargument]%
+% \to \everysetuppublications
+
+\def\@@pbinumbercommand{\executeifdefined{\??pb:\c!numbercommand:\@@pbnumbering}\firstofoneargument}
+
+\letvalue{\??pb:\c!numbercommand:\v!yes }\firstofoneargument
+\letvalue{\??pb:\c!numbercommand:\v!no }\gobbleoneargument
+\setvalue{\??pb:\c!numbercommand:\v!short}#1{\bibgetvars\currentpublicationkey}
+\setvalue{\??pb:\c!numbercommand:\v!bib }#1{\bibgetvarn\currentpublicationkey}
+
+% to be tested
+%
+% \setvalue{\??pb:\c!numbercommand:\v!short}{\bibgetvars\currentpublicationkey\firstofoneargument}
+% \setvalue{\??pb:\c!numbercommand:\v!bib }{\bibgetvarn\currentpublicationkey\firstofoneargument}
+
+\appendtoks
+ \processaction
+ [\@@pbrefcommand]
+ [\s!default=>\edef\@@citedefault{\@@pbrefcommand},
+ \s!unknown=>\edef\@@citedefault{\@@pbrefcommand}]%
+\to \everysetuppublications
+
+\def\bibleftnumber#1{#1\hfill~}
+
+%D \macros{usepublications}
+%D
+%D After discussing it with Thomas Schmitz it became clear that using external
+%D references makes no sense as one needs to refer to it in special ways and
+%D because similar numbers can be confusing. So, for the moment this is not
+%D supported in \MKIV. (So no: see reference [3-5,9] in "some other document")
+
+\def\usepublications[#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}}}}
+
+\def\dousepublications#1%
+ {\doonlyonce{#1.\f!bibextension}{\dodousepublications{#1}}}
+
+\def\dodousepublications#1%
+ {\let\@@savedpar\par
+ \let\par\ignorespaces
+ \ifhmode\kern\zeropoint\fi
+ \readfile{#1.\f!bibextension}
+ {\showmessage\m!publications{4}{#1.\f!bibextension}}
+ {\showmessage\m!publications{2}{#1.\f!bibextension}}%
+ \ifhmode\removeunwantedspaces\fi
+ \let\par\@@savedpar}
+
+%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
+%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\publicationlistparameter#1{\csname\??pv:l:#1\endcsname}
+
+\unexpanded\def\setuppublicationlist
+ {\dosingleempty\dosetuppublicationlist}
+
+\def\dosetuppublicationlist[#1]%
+ {\getparameters[\??pv:l:][#1]%
+ \setuplist[pubs][\c!samplesize={AA99},\c!alternative=a,\c!interaction=,\c!pagenumber=\v!no,#1,\c!command=]}
+
+\unexpanded\def\setuppublicationlayout[#1]#2%
+ {\setvalue{\??pv:l:#1}{#2}}
+
+\let\normalsetuppublicationlayout\setuppublicationlayout
+
+\setuppublicationlist[\c!title=,\c!command=\dospecialbibinsert,\c!maybeyear=\v!on]
+
+%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%
+ {\csname\??pv\@@currentalternative#1\endcsname}
+
+%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{bibinsert#1}, which can be
+%D used in the argument of \type{\setuppublicationlayout} to fetch
+%D one of the \type{@@pb@} data entries. \type{bibinsert#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
+%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
+
+\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%
+% {\begingroup
+% \bibdoifelse{\@@pb@doi}%
+% {\edef\ascii{\detokenize\expandafter{\@@pb@doi}}% probably not ok, to less expansion
+% #1\expanded{\bibgotoDOI{\@@pb@thekey}{\ascii}}#2}{#3}%
+% \endgroup}
+%
+% \def\bibinsertbiburl#1#2#3%
+% {\begingroup
+% \bibdoifelse{\@@pb@biburl}%
+% {\edef\ascii{\detokenize\expandafter{\@@pb@biburl}}% probably not ok, to less expansion
+% #1\expanded{\bibgotoURL{\@@pb@thekey}{\ascii}}#2}{#3}%
+% \endgroup}
+
+\def\bibinsertdoi#1#2#3% let's see how this fails
+ {\bibdoifelse{\@@pb@doi}{#1\expanded{\bibgotoDOI{\@@pb@thekey}{\@@pb@doi}}#2}{#3}}
+
+\def\bibinsertbiburl#1#2#3% let's see how this fails
+ {\bibdoifelse{\@@pb@biburl}{#1\expanded{\bibgotoURL{\@@pb@thekey}{\@@pb@biburl}}#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{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.
+
+% todo: instead of \getvalue{bla@num} in specs we should do
+% \bibentrynum{bla} so that we can create a better namespace
+
+%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{\bibinsertauthors} 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\docomplexbibdef#1%
+ {\dodoubleempty\dodocomplexbibdef[#1]}
+
+\def\dodocomplexbibdef[#1][#2]#3%
+ {\doquadrupleempty\dododocomplexbibdef[#1][#2][#3]}
+
+\def\dododocomplexbibdef[#1][#2][#3][#4]#5#6%
+ {\@EA\increment\csname#1@num\endcsname % todo: bib in name
+ \setevalue{\??pb @#1\csname#1@num\endcsname}{{#3}{#5}{#6}{#4}{#2}}\ignorespaces}
+
+\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.
+
+\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}
+ {\scratchtoks\@EA\@EA\@EA{\csname\??pb @#1\recurselevel\endcsname}%
+ \edef\templist{\ifx\templist\empty\else\templist,\fi\the\scratchtoks}}%
+ #3\publicationlistparameter\c!command{#1}{\todocounter}{\templist}#4\relax
+ \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\zerocount
+% \def\processauthoritem##1%
+% {\advance\scratchcounter\plusone
+% \ifnum\numexpr\scratchcounter-\plusone\relax<#2\relax
+% \publicationlistparameter{#1}##1%
+% \ifnum\scratchcounter=#2\relax
+% \ifnum\etallimitcounter<\commalistsize\relax
+% \bibalternative{#1etaltext}%
+% \fi
+% \else\ifnum\numexpr\scratchcounter+\plusone\relax=#2\relax
+% \ifnum\commalistsize>\plustwo
+% \bibalternative\c!finalnamesep
+% \else
+% \bibalternative\c!lastnamesep
+% \fi
+% \else
+% \bibalternative\c!namesep
+% \fi\fi
+% \fi}%
+% \processcommacommand[#3]\processauthoritem}
+
+\def\doprocessauthoritem#1#2#3%
+ {\advance\scratchcounter\plusone
+ \ifnum\numexpr\scratchcounter-\plusone\relax<#2\relax
+ \publicationlistparameter{#1}#3%
+ \ifnum\scratchcounter=#2\relax
+ \ifnum\etallimitcounter<\commalistsize\relax
+ \bibalternative{#1etaltext}%
+ \fi
+ \else\ifnum\numexpr\scratchcounter+\plusone\relax=#2\relax
+ \ifnum\commalistsize>\plustwo
+ \bibalternative\c!finalnamesep
+ \else
+ \bibalternative\c!lastnamesep
+ \fi
+ \else
+ \bibalternative\c!namesep
+ \fi\fi
+ \fi}
+
+\def\dospecialbibinsert#1#2#3%
+ {\getcommacommandsize[#3]%
+ \scratchcounter\zerocount
+ \processcommacommand[#3]{\doprocessauthoritem{#1}{#2}}}
+
+%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
+%D are:
+%D
+%D \startlines
+%D \type{#1} firstnames
+%D \type{#2} von
+%D \type{#3} surname
+%D \type{#4} inits
+%D \type{#5} junior
+%D \stoplines
+
+\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
+% \doloop
+% {\doifdefinedelse{\??pb @#1\recurselevel}
+% {\letvalue{\??pb @#1\recurselevel}\empty} % why not undefined?
+% {\exitloop}}}
+
+% \def\clearbibitemtwo#1%
+% {\letvalue{#1@num}\!!zerocount
+% \doloop
+% {\ifcsname\??pb @#1\recurselevel\endcsname
+% \expandafter\let\csname\??pb @#1\recurselevel\undefined
+% \else
+% \exitloop
+% \fi}}
+
+\def\clearbibitemtwo#1% is this reset really needed? after all we reset the counter and we are local
+ {%\dofastrecurse\plusone{\csname#1@num\endcsname}\plusone{\expandafter\let\csname\??pb @#1\recurselevel\undefined}%
+ \letvalue{#1@num}\!!zerocount}
+
+\def\bibitemdefs#1%
+ {\@EA\let\csname#1\expandafter\endcsname\csname bib@#1\endcsname}
+
+\def\presetbibvariables % make a fast resetter (toks)
+ {\processcommacommand[\bibcommandlist,crossref]\clearbibitem
+ \processcommalist [artauthor,author,editor]\clearbibitemtwo
+ \processcommacommand[\bibcommandlist]\bibitemdefs
+ \processcommalist [artauthor,author,editor,crossref]\bibitemdefs}
+
+%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.
+
+\newcount\bibtexcounter
+
+%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 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 conveniently 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!
+%D
+%D Now prohibits comments, so % can be used for urls
+
+\unexpanded\def\startpublication
+ {\begingroup
+ \catcode`\%=\othercatcode
+ \dosingleempty\dostartpublication}
+
+\let\stoppublication\relax
+
+% this is rather memory hungry; some day i will rewrite this so that
+% we use the database instead
+
+%D \macros{doifbibreferencefoundelse}
+%D
+%D Some macros to fetch the information provided by
+%D \type{\startpublication}.
+
+% we can consider a faster variant in the bbl file; we can also consider
+% storing the keys in lua (and then do more in lua) and use calls to
+% fetch the variables
+
+% hm, we can store at the lua end ...
+
+\long\def\dostartpublication[#1]#2\stoppublication
+ {\doifassignmentelse{#1}%
+ {\getparameters[\??pb][k=\s!unknown,t=article,n=,s=,a=,y=,o=,u=,#1]}%
+ {\getparameters[\??pb][k=#1,t=article,n=,s=,a=,y=,o=,u=]}%
+ \ctxlua{bibtex.hacks.register("\@@pbk")}%
+ \setxvalue{pbd:\@@pbk}##1{\noexpand\ifcase##1\noexpand\or
+ \@@pbk\noexpand\or
+ \@@pba\noexpand\or
+ \@@pby\noexpand\or
+ \@@pbs\noexpand\or
+ \@@pbn\noexpand\or
+ \@@pbt\noexpand\or
+ \@@pbo\noexpand\or
+ \@@pbu\noexpand\or
+ \normalunexpanded{#2}\noexpand\fi}%
+ \endgroup
+ \ignorespaces}
+
+\def\bibgetvark#1{\csname pbd:#1\endcsname\plusone }
+\def\bibgetvara#1{\csname pbd:#1\endcsname\plustwo }
+\def\bibgetvary#1{\csname pbd:#1\endcsname\plusthree}
+\def\bibgetvars#1{\csname pbd:#1\endcsname\plusfour }
+\def\bibgetvarn#1{\csname pbd:#1\endcsname\plusfive }
+\def\bibgetvart#1{\csname pbd:#1\endcsname\plussix }
+\def\bibgetvaro#1{\csname pbd:#1\endcsname\plusseven}
+\def\bibgetvaru#1{\csname pbd:#1\endcsname\pluseight}
+\def\bibgetvard#1{\csname pbd:#1\endcsname\plusnine }
+
+\def\doifbibreferencefoundelse#1%
+ {\preloadbiblist
+ \doifdefinedelse{pbd:#1}
+ \firstoftwoarguments
+ {\showmessage\m!publications{5}{#1 is unknown}\secondoftwoarguments}}
+
+%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.
+
+% used in bib self
+
+\def\bib@crossref#1% called via \csname \endcsname
+ {\setvalue{\??pb @crossref}{#1}\ignorespaces}
+
+\def\bibinsertcrossref#1#2#3%
+ {\bibdoifelse\@@pb@crossref{#1\cite[\@@pb@crossref]#2}{#3}}
+
+\appendtoks\let\insertcrossref\bibinsertcrossref\to\initializebibdefinitions
+
+%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{\currentpublicationkey}
+
+\def\doprocessbibtexentry#1{\typesetapublication{#1}}
+
+\def\typesetpubslist
+ {\dobeginoflist
+ % \the\initializebibdefinitions % COMMENTED
+ \edef\currentlist{pubs}%
+ \doif{\listparameter\c!criterium}\v!cite{\setuplist[pubs][\c!criterium=\v!here]}%
+ \ctxlua{bibtex.hacks.reset(\number\bibtexoncemode)}%
+ \placestructurelist{pubs}{\listparameter\c!criterium}{\listparameter\c!number}%
+ \ctxlua{bibtex.hacks.flush("\@@pbsorttype")}%
+ \doendoflist}
+
+\newif\ifinpublist
+
+\def\initializepubslist
+ {\def\currentlist{pubs}%
+ \edef\@@pbnumbering{\@@pbnumbering}%
+ \doifelse\@@pbautohang\v!yes
+ {\ifx\@@pbnumbering\v!short
+ \setbox\scratchbox\hbox{\@@pbnumbercommand{\listparameter\c!samplesize}}%
+ \else
+ \setbox\scratchbox\hbox{\@@pbnumbercommand{\ctxlua{tex.write(structure.lists.size())}}}%
+ \fi
+ \edef\publistnumberbox{\hbox to \the\wd\scratchbox}%
+ \expanded{\setuplist[pubs][\c!width=\the\wd\scratchbox,\c!distance=\zeropoint]}%
+ \ifx\@@pbnumbering\v!short
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{\bibgetvars\currentpublicationkey}}}%
+ \else\ifx\@@pbnumbering\v!bib
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{\bibgetvarn\currentpublicationkey}}}%
+ \else
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{##1}}}%
+ \fi\fi}
+ {\doifelsenothing{\listparameter\c!width}
+ {\let \publistnumberbox \hbox}
+ {\edef\publistnumberbox{\hbox to \listparameter\c!width}}%
+ \ifx\@@pbnumbering\v!short
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{\bibgetvars\currentpublicationkey}}}%
+ \else\ifx\@@pbnumbering\v!bib
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{\bibgetvarn\currentpublicationkey}}}%
+ \else
+ \def\@@pblimitednumber##1{\publistnumberbox{\@@pbnumbercommand{##1}}}%
+ \fi\fi}%
+ \ifx\@@pbnumbering\v!no
+ \setuplist[pubs][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]%
+ \else
+ \setuplist[pubs][\c!numbercommand=\@@pblimitednumber]%
+ \fi
+ \doifelse{\publicationlistparameter\c!maybeyear}{\v!off}{\def\maybeyear##1{}}{\def\maybeyear##1{##1}}%
+ \forgetall}
+
+\def\outdented#1% move to supp-box ?
+ {\hskip-\hangindent#1\relax}
+
+%D The full list of publications
+
+\def\completepublications
+ {\dosingleempty\docompletepublications}
+
+\def\docompletepublications[#1]%
+ {\begingroup
+ \setuplist[pubs][\c!criterium=\v!previous,#1]
+ \doifelsenothing{\publicationlistparameter\c!title}
+ {\systemsuppliedchapter[pubs]{\headtext{pubs}}}
+ {\normalexpanded{\systemsuppliedchapter[pubs]{\publicationlistparameter\c!title}}}%
+ \dodoplacepublications}
+
+%D And the portion with the entries only.
+
+\def\bibrefprefix{\number\bibtexblock:}
+
+\unexpanded\def\placepublications
+ {\dosingleempty\doplacepublications}
+
+\def\doplacepublications[#1]%
+ {\begingroup
+ \setuplist[pubs][\c!criterium=\v!previous,#1]%
+ \dodoplacepublications}
+
+\def\dodoplacepublications
+ {\determinelistcharacteristics[pubs]%
+ \initializepubslist
+ \doifnot{\namedlistparameter{pubs}\c!option}\v!continue
+ {\global\bibtexcounter\zerocount}%
+ \inpublisttrue
+ \typesetpubslist
+ \inpublistfalse
+ \endgroup
+ \global\advance\bibtexblock\plusone}
+
+%D \subsubject{What's in a publication}
+
+\unexpanded\def\typesetapublication#1%
+ {\doifsomething{#1}
+ {\doifelse{\namedlistparameter{pubs}\c!criterium}\v!all
+ {\doplacepublicationindeed{#1}}%
+ {\ctxlua{bibtex.hacks.doifalreadyplaced("#1")}
+ {}
+ {\doplacepublicationindeed{#1}}}%
+ }}
+
+% for the moment we don't access the data directly but we will do that
+% later when we get away from storing the data and only deal with
+% references
+
+% we'll define proper handlers later
+
+\def\doplacepublicationindeed#1%
+ {\doifbibreferencefoundelse{#1}
+ {\global\advance\bibtexcounter\plusone
+ \def\currentpublicationkey{#1}%
+ \ctxlua{bibtex.hacks.registerplaced("#1")}%
+ \dodolistelement
+ {pubs}%
+ {}%
+ {\number\bibtexcounter}%
+ {\expanded{\reference[\bibrefprefix#1]{\number\bibtexcounter}}%
+ \strut\dotypesetapublication{#1}\strut}%
+ {}%
+ {}}
+ {}} % invalid
+
+\def\dotypesetapublication#1%
+ {\bgroup
+ \the\initializebibdefinitions % NEW
+ \def\@@currentalternative{:l:}%
+ \presetbibvariables
+ \let\biblanguage\empty
+ \ignorespaces
+ \bibgetvard{#1}%
+ \removeunwantedspaces
+ \ignorespaces
+ \bibalternative{\bibgetvart{#1}}%
+ \removeunwantedspaces
+ \egroup}
+
+%D An few afterthoughts:
+
+\let\maybeyear\gobbleoneargument
+\let\noopsort \gobbleoneargument
+
+%D This is the result of bibtex's `language' field.
+
+\def\setbiblanguage#1#2{\setvalue{\??pb\s!language#1}{#2}}
+
+\def\lang#1%
+ {\edef\biblanguage{#1}%
+ \ifcsname\??pb\s!language#1\endcsname
+ \language[\getvalue{\??pb\s!language#1}]%
+ \fi
+ \ignorespaces}
+
+%D \subject{Citations}
+
+%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
+% {\doifnextoptionalelse\dodocite\dobibref}
+% \def\dobibref#1%
+% {\docite[#1][]}
+% \def\dodocite[#1]%
+% {\startstrictinspectnextcharacter
+% \dodoubleempty\dododocite[#1]}
+% \def\dododocite % [#1][#2]
+% {\stopstrictinspectnextcharacter
+% \docite}
+
+\unexpanded\def\cite
+ {\strictdoifnextoptionalelse\dodocite\dobibref}
+
+\def\dobibref#1%
+ {\docite[#1][]}
+
+\def\dodocite[#1]%
+ {\strictdoifnextoptionalelse{\docite[#1]}{\docite[#1][]}}
+
+\def\docite[#1][#2]%
+ {\begingroup
+ \doifelsenothing{#2}\secondargumentfalse\secondargumenttrue
+ \ifsecondargument
+ \dowhatevercite{#1}{#2}%
+ \else
+ \donumberedcite{#1}%
+ \fi
+ \endgroup}
+
+\def\dowhatevercite#1#2%
+ {\processcommalist[#2]\docitation
+ \setupinteraction[\c!style=]%
+ \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}}%
+ \doifelsevalue{@@pv\@@currentalternative\c!compress}\v!no\bibcitecompressfalse\bibcitecompresstrue
+ \getvalue{bib\@@currentalternative ref}[#2]}
+
+\def\donumberedcite#1%
+ {\processcommalist[#1]\docitation
+ \setupinteraction[\c!style=]%
+ \edef\@@currentalternative{\@@citedefault}%
+ \doifelsevalue{@@pv\@@currentalternative\c!compress}\v!no\bibcitecompressfalse\bibcitecompresstrue
+ \getvalue{bib\@@citedefault ref}[#1]}
+
+%D \macros{nocite}
+
+\def\nocite[#1]%
+ {\processcommalist[#1]\docitation}
+
+%D \macros{setupcite}
+
+\unexpanded\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
+ \dofetchapublication{#4}%
+ \doifdefinedelse{\??pb @bib#2}%
+ {\xdef#6{\getvalue{\??pb @bib#2}}}%
+ {\xdef#6{\getvalue{\??pb @#2}}}%
+ \egroup}
+
+\def\dofetchapublication#1%
+ {\def\currentpublicationkey{#1}%
+ \presetbibvariables
+ \ignorespaces\bibgetvard{#1}}
+
+\def\docitation#1%
+ {\iftrialtypesetting \else
+ \expanded{\writedatatolist[pubs][bibref=#1]}%
+ \fi}
+
+\let\addthisref\gobbleoneargument % keep this for compatibility
+
+%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?
+ \let\currentbibauthor\empty
+ \or
+ \def\currentbibauthor{#1}%
+ \or
+ \expanded{\docurrentbibauthor#1}%
+ \else
+ \handlemultiplebibauthors{\commalistsize}{#1}%
+ \fi}
+
+\newcount\citescratchcounter
+
+\def\handlemultiplebibauthors#1#2%
+ {\citescratchcounter\zerocount
+ \let\currentbibauthor\empty
+ \def\bibprocessauthoritem##1%
+ {\advance\citescratchcounter\plusone
+ \ifnum \citescratchcounter=#1\relax
+ \edef\currentbibauthor{\currentbibauthor##1}%
+ \else\ifnum\numexpr\citescratchcounter+\plusone\relax=#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%
+ {\def\myauthor{Xxxxxxxxxx}%
+ \def\myyear{0000}%
+ \doifbibreferencefoundelse{#1}
+ {\def\myauthor{{\bibgetvara{#1}}}%
+ \def\myyear {\bibgetvary{#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%
+ {\def\myauthor{Xxxxxxxxxx}%
+ \def\myyear {0000}%
+ \doifbibreferencefoundelse{#1}
+ {\xdef\myauthor{\bibgetvara{#1}}%
+ \xdef\myyear {\bibgetvary{#1}}}
+ {}%
+ \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\numexpr\commalistsize+\minusone\relax
+ \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}%
+ \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{gotobiblink,inbiblink,atbiblink}
+%D
+%D The final task is looping over that list until a match is found.
+
+\def\gotobiblink#1[#2]{\doifreferencefoundelse{\bibrefprefix#2}{\goto{#1}[\bibrefprefix#2]}{\unknownreference{#2}}}
+\def\atbiblink [#1]{\doifreferencefoundelse{\bibrefprefix#1}{\at [\bibrefprefix#1]}{\unknownreference{#1}}}
+\def\inbiblink [#1]{\doifreferencefoundelse{\bibrefprefix#1}{\expanded{\goto{\currentreferencetext}}[\bibrefprefix#1]}{\unknownreference{#1}}}
+
+%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\ifbibinteractionelse
+ {\iflocation
+ \doifelse{\bibalternative\c!interaction}\v!stop
+ {\@EA\secondoftwoarguments}
+ {\@EA\firstoftwoarguments}%
+ \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 \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{\bibinsertrefsep} does.
+
+\newconditional\firstbibrefsep
+
+\def\bibresetrefsep
+ {\settrue\firstbibrefsep}
+
+\def\bibinsertrefsep
+ {\ifconditional\firstbibrefsep
+ \setfalse\firstbibrefsep
+ \else
+ \bibalternative\c!pubsep
+ \fi}
+
+\def\bibshortref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibshortref
+ \bibalternative\v!right}
+
+\def\dobibshortref#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\gotobiblink{\bibgetvars{#1}}[#1]}
+ {\unknownreference{#1}}}
+
+\def\bibserialref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibserialref
+ \bibalternative\v!right}
+
+\def\dobibserialref#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\gotobiblink{\bibgetvarn{#1}}[#1]}
+ {\unknownreference{#1}}}
+
+\def\bibkeyref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibkeyref
+ \bibalternative\v!right}
+
+\def\dobibkeyref#1%
+ {\bibinsertrefsep
+ \gotobiblink{#1}[#1]}
+
+\def\bibgotoDOI#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
+ \bibresetrefsep\processcommalist[#1]\dobibdoiref
+ \bibalternative\v!right}
+
+\def\dobibdoiref#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\expanded{\bibgotoDOI{#1}{\bibgetvaro{#1}}}}
+ {\unknownreference{#1}}}
+
+\def\biburlref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobiburlref
+ \bibalternative\v!right}
+
+\def\bibgotoURL#1#2%
+ {\ifbibinteractionelse
+ {\useURL[bibfoo#1][#2]\goto{\url[bibfoo#1]}[url(bibfoo#1)]}
+ {\hyphenatedurl{#2}}}
+
+\def\dobiburlref#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\expanded{\bibgotoURL{#1}{\bibgetvaru{#1}}}}
+ {\unknownreference{#1}}}
+
+\def\bibtyperef[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibtyperef
+ \bibalternative\v!right}
+
+\def\dobibtyperef#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\gotobiblink{\bibgetvart{#1}}[#1]}
+ {\unknownreference{#1}}}
+
+\def\bibpageref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibpageref
+ \bibalternative\v!right}
+
+\def\dobibpageref#1%
+ {\bibinsertrefsep
+ \ifbibinteractionelse
+ {\atbiblink[#1]}
+ {{\referencingfalse\at[#1]}}}
+
+\def\bibdataref[#1]%
+ {\bibalternative\v!left
+ \bibresetrefsep\processcommalist[#1]\dobibdata
+ \bibalternative\v!right}
+
+\def\dobibdata#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\dotypesetapublication{#1}}
+ {\unknownreference{#1}}}
+
+\let\bibnoneref\nocite
+
+%D \macros{bibnumref}
+
+\def\bibnumref[#1]%
+ {\begingroup
+ \bibalternative\v!left
+ \penalty\!!tenthousand
+ \ctxlua{bibtex.hacks.resolve("","\number\bibtexblock","#1")}%
+ \bibalternative\v!right
+ \endgroup}
+
+\def\dowithbibtexnumrefconnector#1#2%
+ {\ifnum#1>\plusone
+ \ifnum#2>\plusone
+ \ifnum#2=#1\relax
+ \bibalternative{lastpubsep}%
+ \else
+ \bibalternative{pubsep}%
+ \fi
+ \fi
+ \fi}
+
+\def\dowithbibtexnumref#1#2#3#4#5% n, i, prefix block ref
+ {\dowithbibtexnumrefconnector{#1}{#2}%
+ \def\bibrefprefix{#4:}%
+ \inbiblink[#5]}
+
+\def\dowithbibtexnumrefrange#1#2#3#4#5#6#7% n, i, prefix block ref
+ {\dowithbibtexnumrefconnector{#1}{#2}%
+ \def\bibrefprefix{#4:}%
+ \inbiblink[#5]%
+ \endash
+ \def\bibrefprefix{#6:}%
+ \inbiblink[#7]}
+
+%D By request from Sanjoy. This makes it easier to implement
+%D \type{\citeasnoun}.
+
+\def\bibauthornumref[#1]%
+ {\getcommalistsize[#1]%
+ \global\bibitemcounter\commalistsize
+ \bibresetrefsep
+ \processcommalist[#1]\dobibauthornumref }
+
+\def\dobibauthornumref#1%
+ {\bibinsertrefsep
+ \doifbibreferencefoundelse{#1}
+ {\begingroup
+ \bibgetvara{#1}%
+ \bibalternative\c!inbetween
+ \setuppublications[\c!refcommand=num]%
+ \cite[#1]%
+ \endgroup}
+ {\unknownreference{#1}}}
+
+%D And some defaults are loaded from bibl-apa:
+
+\def\c!monthconversion{monthconversion} % todo
+
+\setuppublications
+ [\c!monthconversion=,
+ \c!alternative=apa,
+ \c!method=\v!global,
+ \c!refcommand=num,
+ \c!numbercommand=\bibleftnumber]
+
+\def\preloadbiblist
+ {\globallet\preloadbiblist\relax
+ \dousepublications\jobname}
+
+% \appendtoks \preloadbiblist \to \everysetuppublications
+% \appendtoks \preloadbiblist \to \everystarttext
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/bibl-tst.lua b/Master/texmf-dist/tex/context/base/bibl-tst.lua
index a1b85b0f78b..5ff8f45709f 100644
--- a/Master/texmf-dist/tex/context/base/bibl-tst.lua
+++ b/Master/texmf-dist/tex/context/base/bibl-tst.lua
@@ -11,8 +11,8 @@ bibtex.load(session,"texgraph.bib")
bibtex.load(session,"texjourn.bib")
bibtex.load(session,"texnique.bib")
bibtex.load(session,"tugboat.bib")
+print(bibtex.size,statistics.elapsedtime(bibtex))
bibtex.toxml(session)
-
print(bibtex.size,statistics.elapsedtime(bibtex))
--~ print(table.serialize(session.data))
diff --git a/Master/texmf-dist/tex/context/base/blob-ini.lua b/Master/texmf-dist/tex/context/base/blob-ini.lua
new file mode 100644
index 00000000000..0f7ccee26c5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/blob-ini.lua
@@ -0,0 +1,165 @@
+if not modules then modules = { } end modules ['blob-ini'] = {
+ version = 1.001,
+ comment = "companion to blob-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- later we will consider an OO variant.
+
+-- This module is just a playground. Occasionally we need to typeset
+-- at the lua and and this is one method. In principle we can construct
+-- pages this way too which sometimes makes sense in dumb cases. Actually,
+-- if one only needs this, one does not really need tex, okay maybe the
+-- parbuilder but that one can be simplified as well then.
+
+-- set fonts, attributes
+-- rest already done in packers etc
+-- add local par whatsit (or wait till cleaned up)
+-- collapse or new pars
+-- interline spacing etc
+
+-- DON'T USE THESE FUNCTIONS AS THEY WILL CHANGE!
+
+local type = type
+
+local utfvalues = string.utfvalues
+local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
+
+local fontdata = fonts.identifiers
+
+local new_glyph_node = nodes.glyph
+local new_glue_node = nodes.glyph
+
+local copy_node = node.copy
+local copy_node_list = node.copy_list
+local insert_node_after = node.insert_after
+local flush_node_list = node.flush_list
+local hpack_node_list = node.hpack
+local vpack_node_list = node.vpack
+local write_node = node.write
+
+local current_font = font.current
+
+blobs = blobs or { }
+
+local newline = lpegpatterns.newline
+local space = lpegpatterns.spacer
+local spacing = newline * space^0
+local content = (space^1)/" " + (1-spacing)
+
+local ctxtextcapture = lpeg.Ct ( (
+ space^0 * (
+ newline^2 * space^0 * lpeg.Cc("")
+ + newline * space^0 * lpeg.Cc(" ")
+ + lpeg.Cs(content^1)
+ )
+)^0)
+
+local function tonodes(str,fnt,attr) -- (str,template_glyph)
+ if not str or str == "" then
+ return
+ end
+ local head, tail, space, fnt, template = nil, nil, nil, nil, nil
+ if not fnt then
+ fnt = current_font()
+ elseif type(fnt) ~= "number" and fnt.id == "glyph" then
+ fnt, template = nil, fnt
+ -- else
+ -- already a number
+ end
+ for s in utfvalues(str) do
+ local n
+ if s == 32 then
+ if not space then
+ local parameters = fontdata[fnt].parameters
+ space = new_glue_node(parameters.space,parameters.space_stretch,parameters.space_shrink)
+ n = space
+ else
+ n = copy_node(space)
+ end
+ elseif template then
+ n = copy_node(template)
+ n.char = s
+ else
+ n = new_glyph_node(fnt,s)
+ end
+ if attr then -- normall false when template
+ n.attr = copy_node_list(attr)
+ end
+ if head then
+ insert_node_after(head,tail,n)
+ else
+ head = n
+ end
+ tail = n
+ end
+ return head, tail
+end
+
+blobs.tonodes = tonodes
+
+function blobs.new()
+ return {
+ list = { },
+ }
+end
+
+function blobs.append(t,str)
+ local kind = type(str)
+ local dummy = nil
+ if kind == "string" then
+ local pars = lpegmatch(ctxtextcapture,str)
+ local list = t.list
+ for p=1,#pars do
+ local str = pars[p]
+ if #str == 0 then
+ list[#list+1 ] = { head = nil, tail = nil }
+ else
+ local l = list[#list]
+ if not l then
+ l = { head = nil, tail = nil }
+ list[#list+1 ] = l
+ end
+ local head, tail = tonodes(str,nil,nil)
+ if head then
+ if l.head then
+ l.tail.next = head
+ head.prev = l.tail
+ l.tail = tail
+ else
+ l.head, l.tail = head, tail
+ end
+ end
+ end
+ end
+ end
+end
+
+function blobs.pack(t,how)
+ local list = t.list
+ for i=1,#list do
+ local pack = list[i].pack
+ if pack then
+ flush_node_list(node.pack)
+ end
+ if how == "vertical" then
+ -- we need to prepend a local par node
+ -- list[i].pack = node.vpack(list[i].head,"exactly")
+ logs.report("blobs","vpack not yet supported")
+ else
+ list[i].pack = hpack_node_list(list[i].head,"exactly")
+ end
+ end
+end
+
+function blobs.write(t)
+ local list = t.list
+ for i=1,#list do
+ local pack = list[i].pack
+ if pack then
+ write_node(pack)
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/blob-ini.mkiv b/Master/texmf-dist/tex/context/base/blob-ini.mkiv
new file mode 100644
index 00000000000..7f63ec73d91
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/blob-ini.mkiv
@@ -0,0 +1,34 @@
+%D \module
+%D [ file=blob-ini,
+%D version=2010.04.06,
+%D title=\CONTEXT\ \LUA\ Typesetting,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Lua Typesetting / Initialization}
+
+%D This is a prelude to typesetting at the \LUA\ end. The code
+%D is already quite old but will only get nice when we are further
+%D down the road (close to version 1.00 of \LUATEX). Typesetting in
+%D pure \LUA\ sometimes makes sense.
+
+\registerctxluafile{blob-ini}{1.001}
+
+\endinput
+
+% \starttext
+%
+% \startluacode
+% local b = blobs.new()
+% blobs.append(b,"Hello world.\n Here we are.\n\n And Again!")
+% blobs.pack(b)
+% blobs.write(b)
+% \stopluacode
+%
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/buff-ini.lua b/Master/texmf-dist/tex/context/base/buff-ini.lua
index f02963d6a06..6b1af8f96f3 100644
--- a/Master/texmf-dist/tex/context/base/buff-ini.lua
+++ b/Master/texmf-dist/tex/context/base/buff-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['buff-ini'] = {
version = 1.001,
- comment = "companion to core-buf.tex",
+ comment = "companion to core-buf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -20,16 +20,24 @@ buffers.visualizers = { }
-- if needed we can make 'm local
+local trace_run = false trackers.register("buffers.run", function(v) trace_run = v end)
+local trace_visualize = false trackers.register("buffers.visualize", function(v) trace_visualize = v end)
+
local utf = unicode.utf8
local concat, texsprint, texprint, texwrite = table.concat, tex.sprint, tex.print, tex.write
local utfbyte, utffind, utfgsub = utf.byte, utf.find, utf.gsub
local type, next = type, next
-local byte, sub, find, char, gsub, rep, lower = string.byte, string.sub, string.find, string.char, string.gsub, string.rep, string.lower
+local huge = math.huge
+local byte, sub, find, char, gsub, rep, lower, format, gmatch, match = string.byte, string.sub, string.find, string.char, string.gsub, string.rep, string.lower, string.format, string.gmatch, string.match
local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
local ctxcatcodes = tex.ctxcatcodes
+local variables = interfaces.variables
+local lpegmatch = lpeg.match
+
+local data, flags, hooks, visualizers = buffers.data, buffers.flags, buffers.hooks, buffers.visualizers
-local data, commands, flags, hooks, visualizers = buffers.data, buffers.commands, buffers.flags, buffers.hooks, buffers.visualizers
+visualizers.defaultname = variables.typing
function buffers.raw(name)
return data[name] or { }
@@ -47,6 +55,7 @@ function buffers.append(name, str)
data[name] = (data[name] or "") .. str
end
+
buffers.flags.store_as_table = true
-- to be sorted out: crlf + \ ; slow now
@@ -65,11 +74,11 @@ function buffers.grab(name,begintag,endtag,bufferdata)
buffers.level = buffers.level - 1
else
if dn == "" then
- dn = bufferdata:sub(1,#bufferdata-1)
+ dn = sub(bufferdata,1,#bufferdata-1)
else
- dn = dn .. "\n" .. bufferdata:sub(1,#bufferdata-1)
+ dn = dn .. "\n" .. sub(bufferdata,1,#bufferdata-1)
end
- dn = dn:gsub("[\010\013]$","")
+ dn = gsub(dn,"[\010\013]$","")
if flags.store_as_table then
dn = dn:splitlines()
end
@@ -104,23 +113,25 @@ function buffers.verbatimbreak(n,m)
if flags.optimize_verbatim then
if n == 2 or n == m then
texsprint(no_break_command)
- else
+ elseif n > 1 then
texsprint(do_break_command)
end
end
end
-function buffers.strip(lines)
- local first, last = 1, #lines
+function buffers.strip(lines,first,last)
+ local first, last = first or 1, last or #lines
for i=first,last do
- if #lines[i] == 0 then
+ local li = lines[i]
+ if #li == 0 or find(li,"^%s*$") then
first = first + 1
else
break
end
end
for i=last,first,-1 do
- if #lines[i] == 0 then
+ local li = lines[i]
+ if #li == 0 or find(li,"^%s*$") then
last = last - 1
else
break
@@ -129,15 +140,62 @@ function buffers.strip(lines)
return first, last, last - first + 1
end
-function buffers.type(name)
+function buffers.range(lines,first,last,range) -- 1,3 1,+3 fromhere,tothere
+ local first, last = first or 1, last or #lines
+ local what = aux.settings_to_array(range)
+ local r_first, r_last = what[1], what[2]
+ local f, l = tonumber(r_first), tonumber(r_last)
+ if r_first then
+ if f then
+ if f > first then
+ first = f
+ end
+ else
+ for i=first,last do
+ if find(lines[i],r_first) then
+ first, strip = i + 1
+ break
+ end
+ end
+ end
+ end
+ if r_last then
+ if l then
+ if find(r_last,"^[%+]") then -- 1,+3
+ l = first + l
+ end
+ if l < last then
+ last = l
+ end
+ else
+ for i=first,last do
+ if find(lines[i],r_last) then
+ last = i - 1
+ break
+ end
+ end
+ end
+ end
+ return first, last
+end
+
+function buffers.type(name,realign,range)
local lines = data[name]
local action = buffers.typeline
if lines then
if type(lines) == "string" then
lines = lines:splitlines()
+ data[name] = lines
+ end
+ if realign then
+ lines = buffers.realign(lines,realign)
end
local line, n = 0, 0
local first, last, m = buffers.strip(lines)
+ if range then
+ first, last = buffers.range(lines,first,last,range)
+ first, last = buffers.strip(lines,first,last)
+ end
hooks.begin_of_display()
for i=first,last do
n, line = action(lines[i], n, m, line)
@@ -153,16 +211,34 @@ function buffers.loaddata(filename) -- this one might go away
if not str then
ok, str, n = resolvers.loaders.tex(file.addsuffix(filename,'tex'))
end
- return str or ""
end
-function buffers.typefile(name) -- still somewhat messy, since name can be be suffixless
+function buffers.loaddata(filename) -- this one might go away
+ local foundname = resolvers.findtexfile(filename) or ""
+ if foundname == "" then
+ foundname = resolvers.findtexfile(file.addsuffix(filename,'tex')) or ""
+ end
+ if foundname == "" then
+ return ""
+ else
+ return resolvers.loadtexfile(foundname)
+ end
+end
+
+function buffers.typefile(name,realign,range) -- still somewhat messy, since name can be be suffixless
local str = buffers.loaddata(name)
if str and str~= "" then
local lines = str:splitlines()
+ if realign then
+ lines = buffers.realign(lines,realign)
+ end
local line, n, action = 0, 0, buffers.typeline
local first, last, m = buffers.strip(lines)
hooks.begin_of_display()
+ if range then
+ first, last = buffers.range(lines,first,last,range)
+ first, last = buffers.strip(lines,first,last)
+ end
for i=first,last do
n, line = action(lines[i], n, m, line)
end
@@ -173,7 +249,7 @@ end
function buffers.typeline(str,n,m,line)
n = n + 1
buffers.verbatimbreak(n,m)
- if str:find("%S") then
+ if find(str,"%S") then
line = line + 1
hooks.begin_of_line(line)
hooks.flush_line(hooks.line(str))
@@ -187,28 +263,51 @@ function buffers.typeline(str,n,m,line)
return n, line
end
-function buffers.save(name,list,encapsulate)
- if not name or name == "" then
- name = tex.jobname
- end
- if list then
- -- ok
- else
+-- The optional prefix hack is there for the typesetbuffer feature and
+-- in mkii we needed that (this hidden feature is used in a manual).
+
+local function prepared(name,list) -- list is optional
+ if not list or list == "" then
list = name
- name = tex.jobname .. "-" .. name .. ".tmp"
end
- local content = buffers.collect(list)
+ if not name or name == "" then
+ name = tex.jobname .. "-" .. list .. ".tmp"
+ end
+ local content = buffers.collect(list,nil) or ""
if content == "" then
content = "empty buffer"
end
- if encapsulate then
- io.savedata(name, "\\starttext\n"..content.."\n\\stoptext\n")
- else
- io.savedata(name, content)
+ return name, content
+end
+
+local capsule = "\\starttext\n%s\n\\stoptext\n"
+local command = "context %s"
+
+function buffers.save(name,list,encapsulate) -- list is optional
+ local name, content = prepared(name,list)
+ io.savedata(name, (encapsulate and format(capsule,content)) or content)
+end
+
+function commands.savebuffer(list,name) -- name is optional
+ buffers.save(name,list)
+end
+
+function buffers.run(name,list,encapsulate)
+ local name, content = prepared(name,list)
+ local data = io.loaddata(name)
+ content = (encapsulate and format(capsule,content)) or content
+ if data ~= content then
+ if trace_run then
+ commands.writestatus("buffers","changes in '%s', processing forced",name)
+ end
+ io.savedata(name,content)
+ os.execute(format(command,name))
+ elseif trace_run then
+ commands.writestatus("buffers","no changes in '%s', not processed",name)
end
end
-local printer = (lpeg.linebyline/texprint)^0
+local printer = (lpeg.patterns.textline/texprint)^0
function buffers.get(name)
local b = buffers.data[name]
@@ -218,7 +317,7 @@ function buffers.get(name)
texprint(b[i])
end
else
- printer:match(b)
+ lpegmatch(printer,b)
end
end
end
@@ -240,21 +339,15 @@ buffers.content = content
function buffers.collect(names,separator) -- no print
-- maybe we should always store a buffer as table so
- -- that we can pass if directly
+ -- that we can pass it directly
+ if type(names) == "string" then
+ names = aux.settings_to_array(names)
+ end
local t = { }
- if type(names) == "table" then
- for i=1,#names do
- local c = content(names[i],separator)
- if c ~= "" then
- t[#t+1] = c
- end
- end
- else
- for name in names:gmatch("[^,%s]+") do
- local c = content(name,separator)
- if c ~= "" then
- t[#t+1] = c
- end
+ for i=1,#names do
+ local c = content(names[i],separator)
+ if c ~= "" then
+ t[#t+1] = c
end
end
return concat(t,separator or "\r") -- "\n" is safer due to comments and such
@@ -274,11 +367,12 @@ function buffers.inspect(name)
local b = data[name]
if b then
if type(b) == "table" then
- for _,v in ipairs(b) do
+ for k=1,#b do
+ local v = b[k]
if v == "" then
texsprint(ctxcatcodes,"[crlf]\\par ") -- space ?
else
- texsprint(ctxcatcodes,(gsub(b,"(.)",tobyte)),"\\par")
+ texsprint(ctxcatcodes,(gsub(v,"(.)",tobyte)),"\\par")
end
end
else
@@ -289,42 +383,90 @@ end
-- maybe just line(n,str) empty(n,str)
-visualizers.handlers = visualizers.handlers or { }
-visualizers.escapetoken = nil
-visualizers.tablength = 7
-visualizers.enabletab = true -- false
-visualizers.enableescape = false
-visualizers.obeyspace = true
+visualizers.tablength = 7
+visualizers.enabletab = true -- false
+visualizers.obeyspace = true
+
+function buffers.settablength(tablength)
+ visualizers.tablength = tablength and tonumber(tablength) or 7
+end
+
+visualizers.handlers = visualizers.handlers or { }
local handlers = visualizers.handlers
function buffers.newvisualizer(name)
+ name = lower(name)
local handler = { }
handlers[name] = handler
return handler
end
function buffers.getvisualizer(name)
- return handlers[name]
+ name = lower(name)
+ return handlers[name] or buffers.loadvisualizer(name)
end
-local default = buffers.newvisualizer("default")
+function buffers.loadvisualizer(name)
+ name = lower(name)
+ local hn = handlers[name]
+ if hn then
+ return hn
+ else
+ environment.loadluafile("pret-" .. name)
+ local hn = handlers[name]
+ if not hn then
+ -- hn = buffers.newvisualizer(name)
+ hn = handlers[visualizers.defaultname]
+ handlers[name] = hn
+ if trace_visualize then
+ logs.report("buffers","mapping '%s' visualizer onto '%s'",name,visualizers.defaultname)
+ end
+ elseif trace_visualize then
+ logs.report("buffers","loading '%s' visualizer",name)
+ end
+ return hn
+ end
+end
+
+-- was "default", should be set at tex end (todo)
+
+local default = buffers.newvisualizer(visualizers.defaultname)
+
+--~ print(variables.typing) os.exit()
+
+-- will become cleaner
local currentvisualizer, currenthandler
function buffers.setvisualizer(str)
currentvisualizer = lower(str)
currenthandler = handlers[currentvisualizer]
- if not currenthandler then
- currentvisualizer = 'default'
+ if currenthandler then
+ -- if trace_visualize then
+ -- logs.report("buffers","enabling specific '%s' visualizer",currentvisualizer)
+ -- end
+ else
+ currentvisualizer = visualizers.defaultname
currenthandler = handlers.default
+ -- if trace_visualize then
+ -- logs.report("buffers","enabling default visualizer '%s'",currentvisualizer)
+ -- end
end
if currenthandler.reset then
currenthandler.reset()
end
end
-buffers.setvisualizer("default")
+function buffers.resetvisualizer()
+ currentvisualizer = visualizers.defaultname
+ currenthandler = handlers.default
+ if currenthandler.reset then
+ currenthandler.reset()
+ end
+end
+
+buffers.setvisualizer(visualizers.defaultname)
function visualizers.reset()
end
@@ -351,10 +493,15 @@ function hooks.end_of_inline()
(currenthandler.end_of_inline or default.end_of_inline)()
end
-
function hooks.flush_line(str,nesting)
- str = gsub(str," *[\n\r]+ *"," ") ; -- semi colon needed
- (currenthandler.flush_line or default.flush_line)(str,nesting)
+ local fl = currenthandler.flush_line
+ if fl then
+ str = gsub(str," *[\n\r]+ *"," ") ; -- semi colon needed
+ fl(str,nesting)
+ else
+ -- gsub done later
+ default.flush_line(str,nesting)
+ end
end
function hooks.flush_inline(str,nesting)
@@ -419,11 +566,11 @@ function default.line(str)
end
function default.flush_line(str)
- str = str:gsub(" *[\n\r]+ *"," ")
+ str = gsub(str," *[\n\r]+ *"," ")
if visualizers.obeyspace then
for c in utfcharacters(str) do
if c == " " then
- texsprint(ctxcatcodes,"\\obs ")
+ texsprint(ctxcatcodes,"\\obs")
else
texwrite(c)
end
@@ -454,13 +601,14 @@ end
-- special one
-commands.nested = "\\switchslantedtype "
+buffers.commands.nested = "\\switchslantedtype "
-- todo : utf + faster, direct print and such. no \\char, vrb catcodes, see end
function visualizers.flush_nested(str, enable) -- no utf, kind of obsolete mess
- str = str:gsub(" *[\n\r]+ *"," ")
+ str = gsub(str," *[\n\r]+ *"," ")
local result, c, nested, i = "", "", 0, 1
+ local commands = buffers.commands -- otherwise wrong commands
while i < #str do -- slow
c = sub(str,i,i+1)
if c == "<<" then
@@ -481,7 +629,7 @@ function visualizers.flush_nested(str, enable) -- no utf, kind of obsolete mess
c = sub(str,i,i)
if c == " " then
result = result .. "\\obs "
- elseif c:find("%a") then
+ elseif find(c,"%a") then
result = result .. c
else
result = result .. "\\char" .. byte(c) .. " "
@@ -546,6 +694,106 @@ function buffers.flush_result(result,nested)
end
end
+-- new
+
+function buffers.realign(name,forced_n) -- no, auto, <number>
+ local n, d
+ if type(name) == "string" then
+ d = data[name]
+ if type(d) == "string" then
+ d = d:splitlines()
+ end
+ else
+ d = name -- already a buffer
+ end
+ forced_n = (forced_n == variables.auto and huge) or tonumber(forced_n)
+ if forced_n then
+ for i=1, #d do
+ local spaces = find(d[i],"%S")
+ if not spaces then
+ -- empty line
+ elseif not n then
+ n = spaces
+ elseif spaces == 0 then
+ n = 0
+ break
+ elseif n > spaces then
+ n = spaces
+ end
+ end
+ if n > 0 then
+ if n > forced_n then
+ n = forced_n
+ end
+ for i=1,#d do
+ d[i] = sub(d[i],n)
+ end
+ end
+ end
+ return d
+end
+
+-- escapes: buffers.set_escape("tex","/BTEX","/ETEX")
+
+local function flush_escaped_line(str,pattern,flushline)
+ while true do
+ local a, b, c = match(str,pattern)
+ if a and a ~= "" then
+ flushline(a)
+ end
+ if b and b ~= "" then
+ texsprint(ctxcatcodes,"{",b,"}")
+ end
+ if c then
+ if c == "" then
+ break
+ else
+ str = c
+ end
+ else
+ flushline(str)
+ break
+ end
+ end
+end
+
+function buffers.set_escape(name,pair)
+ if pair and pair ~= "" then
+ local visualizer = buffers.getvisualizer(name)
+ visualizer.normal_flush_line = visualizer.normal_flush_line or visualizer.flush_line
+ if pair == variables.no then
+ visualizer.flush_line = visualizer.normal_flush_line or visualizer.flush_line
+ if trace_visualize then
+ logs.report("buffers","resetting escape range for visualizer '%s'",name)
+ end
+ else
+ local start, stop
+ if pair == variables.yes then
+ start, stop = "/BTEX", "/ETEX"
+ else
+ pair = string.split(pair,",")
+ start, stop = string.esc(pair[1] or ""), string.esc(pair[2] or "")
+ end
+ if start ~= "" then
+ local pattern
+ if stop == "" then
+ pattern = "^(.-)" .. start .. "(.*)(.*)$"
+ else
+ pattern = "^(.-)" .. start .. "(.-)" .. stop .. "(.*)$"
+ end
+ function visualizer.flush_line(str)
+ flush_escaped_line(str,pattern,visualizer.normal_flush_line)
+ end
+ if trace_visualize then
+ logs.report("buffers","setting escape range for visualizer '%s' to %s -> %s",name,start,stop)
+ end
+ elseif trace_visualize then
+ logs.report("buffers","problematic escape specification '%s' for visualizer '%s'",pair,name)
+ end
+ end
+ end
+end
+
-- THIS WILL BECOME A FRAMEWORK: the problem with prety printing is that
-- we deal with snippets and therefore we need tolerant parsing
@@ -587,6 +835,4 @@ end
--~ str = [[test 123 test $oeps$]]
---~ pattern:match(str)
-
-
+--~ lpegmatch(pattern,str)
diff --git a/Master/texmf-dist/tex/context/base/buff-ini.mkii b/Master/texmf-dist/tex/context/base/buff-ini.mkii
index 0f0655ea126..fc147d09041 100644
--- a/Master/texmf-dist/tex/context/base/buff-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/buff-ini.mkii
@@ -188,15 +188,15 @@
\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]}%
- \setevalue{\e!get #1}{\noexpand\dogetbuffer [#1][def-\nofdefinedbuffers]}%
- \setevalue{\e!type #1}{\noexpand\dotypebuffer [#1][def-\nofdefinedbuffers]}%
+ \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}
-\def\getbuffer
+\unexpanded\def\getbuffer
{\dodoubleempty\dogetbuffer}
\def\dogetbuffer[#1][#2]%
@@ -213,7 +213,7 @@
\dobuffer{16}{#2}\dogetbufferasis
\getvalue{\??bu#1\c!after}}
-\def\typebuffer
+\unexpanded\def\typebuffer
{\dodoubleempty\dotypebuffer}
\def\dogetfilebuffer{\typefile{\TEXbufferfile{\currentbuffer}}}
diff --git a/Master/texmf-dist/tex/context/base/buff-ini.mkiv b/Master/texmf-dist/tex/context/base/buff-ini.mkiv
index 29ce4687de9..86b0fa3c530 100644
--- a/Master/texmf-dist/tex/context/base/buff-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/buff-ini.mkiv
@@ -51,11 +51,7 @@
% \stoptext
\ifdefined\doinitializeverbatim \else% temp hack
- \ifdefined\mkinitializeverbatim
- \let\doinitializeverbatim\mkinitializeverbatim
- \else
- \def\doinitializeverbatim{\tttf}
- \fi
+ \def\doinitializeverbatim{\tttf}
\fi
\unprotect
@@ -150,7 +146,7 @@
\ctxlua{buffers.set("\currentbuffer", \!!bs\detokenize{#2}\!!es)}%
\endgroup}
-\def\setupbuffer
+\unexpanded\def\setupbuffer
{\dodoubleempty\dosetupbuffer}
\def\dosetupbuffer[#1][#2]%
@@ -165,16 +161,19 @@
\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]}%
- \setevalue{\e!get #1}{\noexpand\dogetbuffer [#1][def-\nofdefinedbuffers]}%
- \setevalue{\e!type #1}{\noexpand\dotypebuffer [#1][def-\nofdefinedbuffers]}%
+ \setuevalue{\e!start#1}{\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}% maybe also relax stop
+ \setuevalue{\e!get #1}{\noexpand\dogetbuffer [#1][def-\nofdefinedbuffers]}%
+ \setuevalue{\e!type #1}{\noexpand\dotypebuffer [#1][def-\nofdefinedbuffers]}%
\getparameters[\??bu#1][#2]%
\fi}
-\def\definebuffer
+\unexpanded\def\definebuffer
{\dodoubleempty\dodefinebuffer}
+
+\def\thebuffernumber#1%
+ {\csname\??bu#1\c!number\endcsname}
-\def\getbuffer
+\unexpanded\def\getbuffer
{\dodoubleempty\dogetbuffer}
\def\dogetbuffer[#1][#2]%
@@ -191,18 +190,18 @@
\dobuffer{16}{#2}\dogetbufferasis
\getvalue{\??bu#1\c!after}}
-\def\typebuffer
+\unexpanded\def\typebuffer
{\dodoubleempty\dotypebuffer}
\def\doprocessbufferverbatim
{\doinitializeverbatim
- \ctxlua{buffers.type("\currentbuffer")}}
+ \ctxlua{buffers.type("\currentbuffer","\typingparameter\c!strip")}}
\def\doprocessbufferlinesverbatim#1#2#3%
{#2%
% todo, set up numbers
\doinitializeverbatim
- \ctxlua{buffers.type("\currentbuffer")}
+ \ctxlua{buffers.type("\currentbuffer","\typingparameter\c!strip")}
#3}
\def\doifelsebuffer#1%
@@ -276,20 +275,20 @@
\ifsecondargument
\dosetbufferoffset{#1}%
\doifelse{#2}\v!all
- {\def\startbufferparagraph{\normalbufferparagraph{#1}}}
- {\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{#1}}%
+ {\unexpanded\def\startbufferparagraph{\normalbufferparagraph{#1}}}
+ {\unexpanded\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}%
+ \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{#1}}%
\def\next{\getparagraphedbuffer[#1]}%
\else
\dosetbufferoffset\empty
- \def\startbufferparagraph{\filterbufferparagraph{}{#1}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{}}%
+ \unexpanded\def\startbufferparagraph{\filterbufferparagraph{}{#1}}%
+ \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{}}%
\def\next{\getparagraphedbuffer[]}%
\fi
\else
\dosetbufferoffset\empty
- \def\startbufferparagraph{\normalbufferparagraph{}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{}}%
+ \unexpanded\def\startbufferparagraph{\normalbufferparagraph{}}%
+ \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{}}%
\def\next{\getparagraphedbuffer[]}%
\fi
\next}
@@ -329,7 +328,7 @@
\def\fakebufferparagraph#1%
{\bgroup
- \def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}%
+ \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}%
\setbox\scratchbox\vbox\bgroup\dostartbufferparagraph{#1}}
% definitions
@@ -342,8 +341,15 @@
\c!after=]
% only mkiv:
+%
+% \startbuffer[x]
+% x
+% \stopbuffer
+%
+% \savebuffer[x][temp.log]
+
+\unexpanded\def\savebuffer{\dodoubleempty\dosavebuffer}
-\def\savebuffer{\dosingleempty\dosavebuffer}
-\def\dosavebuffer[#1]{\ctxlua{buffers.save("#1")}}
+\def\dosavebuffer[#1][#2]{\ctxlua{commands.savebuffer("#1","#2")}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/buff-ver.mkii b/Master/texmf-dist/tex/context/base/buff-ver.mkii
index 6b3817a7028..e7ad5474f37 100644
--- a/Master/texmf-dist/tex/context/base/buff-ver.mkii
+++ b/Master/texmf-dist/tex/context/base/buff-ver.mkii
@@ -144,7 +144,6 @@
\let\obeycharacters\setupprettytype
\let\obeytabs\ignoretabs}
-
\def\setupcommonverbatim
{\recatcodeuppercharactersfalse % obey regime / encoding
%
@@ -577,11 +576,13 @@
\veryraggedright}
\def\ignorehyphens
- {% \language\minusone % extra bonus, the \null should do the job too
+ {% \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
@@ -634,6 +635,11 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/buff-ver.mkiv b/Master/texmf-dist/tex/context/base/buff-ver.mkiv
index 28e3e60d501..dacbdb7ac99 100644
--- a/Master/texmf-dist/tex/context/base/buff-ver.mkiv
+++ b/Master/texmf-dist/tex/context/base/buff-ver.mkiv
@@ -17,9 +17,9 @@
\unprotect
-\ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
-\ifx\stoplinenumbering \undefined \let\stoplinenumbering\relax \fi
-\ifx\setuplinenumbering\undefined \def\setuplinenumbering[#1]{} \fi
+\ifdefined\startlinenumbering\else \let\startlinenumbering \relax \fi
+\ifdefined\stoplinenumbering \else \let\stoplinenumbering \relax \fi
+\ifdefined\setuplinenumbering\else \unexpanded\def\setuplinenumbering[#1]{} \fi
% D \macros
% D {iflinepar}
@@ -66,16 +66,17 @@
\uppercasestring#2\to\asciib
\setevalue{\??ty\??ty\asciia}{\asciib}}
-\def\setupprettiesintype#1%
+\unexpanded\def\setupprettiesintype#1%
{\uppercasestring#1\to\ascii
\edef\prettyidentifier{\executeifdefined{\??ty\??ty\ascii}{TEX}}%
\begingroup
% we can move this to lua
- \lowercasestring \f!prettyprefix\prettyidentifier\to\filename
- \doonlyonce\filename{\ctxloadluafile\filename\empty}%
+ % \lowercasestring \f!prettyprefix\prettyidentifier\to\filename
+ % \doonlyonce\filename{\ctxloadluafile\filename\empty}%
+ \ctxlua{buffers.loadvisualizer("\ascii")}%
\endgroup}
-\def\setupprettytype
+\unexpanded\def\setupprettytype
{\processingverbatimtrue % will move
\ctxlua{buffers.visualizers.reset()}}
@@ -84,7 +85,7 @@
\spaceskip\wd\scratchbox
\xspaceskip\spaceskip}
-\let\obeycharacters\relax
+\let\obeycharacters\relax % tab mess can go
\setvalue{\??tp:\c!lines:\v!yes }{\obeybreakpoints}
\setvalue{\??tp:\c!lines:\v!hyphenated}{\obeyhyphens}
@@ -93,59 +94,65 @@
%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:\empty }{\let\obeycharacters\relax}
+\setvalue{\??tp:\c!option:\v!color }{\setupprettiesintype{\typingparameter\c!option}%
+ \let\obeycharacters\setupprettytype}
\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:\v!slanted }{\let\obeycharacters\setupslantedtype}
\setvalue{\??tp:\c!option:\s!unknown }{\setupprettiesintype{\typingparameter\c!option}%
- \let\obeycharacters\setupprettytype
- \let\obeytabs\ignoretabs}
+ \let\obeycharacters\setupprettytype}
+%setvalue{\??tp:\c!option:\v!commands }{\def\obeycharacters{\setupcommandsintype}}
\def\dosetverbatimfont
{\redoconvertfont\dosetfontattribute{\currenttypingclass\currenttyping}\c!style
\normalnoligatures\font}
-\def\setupcommonverbatim
+\unexpanded\def\setupcommonverbatim
{\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}}%
- %
\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
\setupverbatimcolor}
\newtoks \everyinitializeverbatim
-\def\doinitializeverbatim
+\def\ignorebeginofpretty [#1]{}
+\def\ignoreendofpretty {}
+
+\def\doverbatimbop{\bgroup\beginofpretty}
+\def\doverbatimeop{\endofpretty\egroup}
+\def\doverbatimsop{\endofpretty\egroup\bgroup\beginofpretty}
+
+\let\noverbatimbop\ignorebeginofpretty
+\let\noverbatimeop\ignoreendofpretty
+\let\noverbatimsop\ignorebeginofpretty
+
+\def\doinitializeverbatim % todo: combine all in one call is faster
{\ctxlua{buffers.visualizers.reset()}%
- \def\obs{\obeyedspace}%
+ \doifelse{\typingparameter\c!space}\v!on
+ {\let\obs\fastcontrolspace}%
+ {\let\obs\specialobeyedspace}%
+ \edef\askedverbatimtab{\typingparameter\c!tab}%
+ \doifelse\askedverbatimtab\v!no
+ {\ctxlua{buffers.settablength(1)}}
+ {\doifnumberelse{\askedverbatimtab}
+ {\ctxlua{buffers.settablength(\askedverbatimtab)}}
+ {\ctxlua{buffers.settablength()}}}%
\ctxlua{buffers.doifelsevisualizer("\prettyidentifier")}
{\ctxlua{buffers.setvisualizer("\prettyidentifier")}%
- \def\bop{\bgroup\beginofpretty}%
- \def\eop{\endofpretty\egroup}%
- \def\sop{\endofpretty\egroup\bgroup\beginofpretty}}%
- {\let\bop\donothing
- \let\eop\donothing
- \let\sop\donothing}%
+ \let\bop\doverbatimbop
+ \let\eop\doverbatimeop
+ \let\sop\doverbatimsop}%
+ {\ctxlua{buffers.setvisualizer("\v!typing")}% or resetdefaultvisualizer
+ \let\bop\noverbatimbop
+ \let\eop\noverbatimeop
+ \let\sop\noverbatimsop}%
\relax\the\everyinitializeverbatim\relax}
\appendtoks
@@ -163,14 +170,54 @@
% \typeTEX{\example---oeps}. this---ligates---again.
% \type {\example---oeps}. this---ligates---again.
-\def\setupcommandsintype % can also be \string\
- {\ctxlua{
- buffers.visualizers.enableescape = true
- buffers.visualizers.escapetoken = \!!bs\typingparameter\c!escape\!!es
- }%
- \setevalue{\typingparameter\c!escape}{\typingparameter\c!escape}}
+%D \startbuffer
+%D \setuptyping[TEX][escape=yes]
+%D
+%D \startTEX
+%D /BTEX\em sometex/ETEX
+%D /BTEX\em sometex/ETEX \after
+%D \before /BTEX\em sometex/ETEX
+%D \before /BTEX\em sometex/ETEX \after
+%D \before /BTEX\em sometex/ETEX \inbetween /BTEX\em sometex/ETEX \after
+%D \before \after
+%D \stopTEX
+%D \stopbuffer
+%D
+%D \typebuffer \start \getbuffer \stop
+%D
+%D \startbuffer
+%D \setuptyping[TEX][escape={[[,]]}]
+%D
+%D \startTEX
+%D [[\em sometex]]
+%D [[\em sometex]] \after
+%D \before [[\em sometex]]
+%D \before [[\em sometex]] \after
+%D \before [[\em sometex]] \inbetween [[\em sometex]] \after
+%D \before \after
+%D \stopTEX
+%D \stopbuffer
+%D
+%D \typebuffer \start \getbuffer \stop
+%D
+%D \startbuffer
+%D \setuptyping[TEX][escape=//]
+%D
+%D \startTEX
+%D //\em sometex
+%D \before //\em sometex
+%D \stopTEX
+%D
+%D \typebuffer \start \getbuffer \stop
+
+\unexpanded\def\setupcommandsintype
+ {\ctxlua{buffers.set_escape("\currenttyping",\!!bs\typingparameter\c!escape\!!es)}}
+
+\appendtoks
+ \setupcommandsintype
+\to \everyinitializeverbatim
-\def\setupslantedtype
+\unexpanded\def\setupslantedtype
{\slantedtypepermittedtrue}
\ifx\setupprettytype \undefined \let\setupprettytype \relax \fi
@@ -272,15 +319,6 @@
\catcode`\>=\@@other
\futurelet\next\dodotype}
-% \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}
-
\def\dodotype
{\ifx\next\bgroup
\@EA\dodotypeA
@@ -362,19 +400,15 @@
\setupcommonverbatim
%\dosetverbatimfont
%\setverbatimspaceskip
- %\let\obeytabs \ignoretabs % probably not needed
- %\let\obeylines\ignorelines % probably not needed
- %\let\obeypages\ignorepages % probably not needed
%\setupcopyverbatim % not needed
- \setcatcodetable\vrbcatcodes
- }
+ \setcatcodetable\vrbcatcodes}
%D \macros
%D {setuptype}
%D
%D Some characteristics of \type{\type} can be set up by:
-\def\setuptype
+\unexpanded\def\setuptype
{\dodoubleempty\dosetuptype}
\def\dosetuptype[#1][#2]%
@@ -407,7 +441,7 @@
\veryraggedright}
\def\ignorehyphens
- {% \language\minusone % extra bonus, the \null should do the job too
+ {\language\minusone % extra bonus, the \null should do the job too
\let\obeyedspace \specialobeyedspace
\let\controlspace\specialcontrolspace
\spaceskip.5em\relax}
@@ -465,6 +499,19 @@
\unexpanded\def\mat{\groupedcommand{\setgroupedtype\$}{\$}}
\unexpanded\def\dis{\groupedcommand{\setgroupedtype\$\$}{\$\$}}
+\let\normaltexttex\tex
+\let\normaltextarg\arg
+\let\normaltextmat\mat
+\let\normaltextdis\dis
+
+\def\astype
+ {\groupedcommand\dorawtype\relax}
+
+\def\dorawtype
+ {\let\currenttypingclass\??ty
+ \normalverbatimcolor % \verbatimcolor
+ \dosetverbatimfont}
+
%D \macros
%D {starttyping}
%D
@@ -491,9 +538,9 @@
{\setxvalue{\currenttypingclass\currenttyping#1}{#2}}
\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!small }{\smallskipamount}
+\setvalue{\??tp:\c!blank:\v!medium }{\medskipamount}
+\setvalue{\??tp:\c!blank:\v!big }{\bigskipamount}
\setvalue{\??tp:\c!blank:\v!halfline}{.5\baselineskip}
\setvalue{\??tp:\c!blank:\v!line }{\baselineskip}
\setvalue{\??tp:\c!blank:\v!none }{\zeropoint}
@@ -519,9 +566,11 @@
\else
\doadaptleftskip{\typingparameter\c!margin}%
\fi
+ % no symbolic blanks !
\edef\!!stringa{\executeifdefined{\??bo\typingparameter\c!blank}{\typingparameter\c!blank}}%
\scratchskip\executeifdefined{\??tp:\c!blank:\!!stringa}\!!stringa\relax
\ifgridsnapping
+ % this will be adapted
\ifdim\scratchskip=.5\baselineskip\relax
\edef\verbatimbaselineskip{\the\scratchskip}% new
\else
@@ -530,6 +579,7 @@
\else
\edef\verbatimbaselineskip{\the\scratchskip}%
\fi
+\doifsomething{\typingparameter\c!align}{\setupalign[\typingparameter\c!align]}%
\setupcommonverbatim}
%D The basic display verbatim commands are defined in an
@@ -582,22 +632,21 @@
\def\dotypefileverbatim
{\doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename")}}
+ \beginofverbatimlines
+ \ctxlua{buffers.typefile("\readfilename","\typingparameter\c!strip","\typingparameter\c!range")}%
+ \endofverbatimlines}
\def\dotypefilelinesverbatim#1#2%
- {#1%
- \doinitializeverbatim
- \ctxlua{buffers.typefile("\readfilename")}%
- #2}
+ {#1\dotypefileverbatim#2}
\unexpanded\def\dotypeblockverbatim#1#2%
- {\dowithbuffer{_typing_}{#1}{#2}
- {}
- {\doinitializeverbatim
- \beginofverbatimlines
- \ctxlua{buffers.type("_typing_")}%
- \endofverbatimlines
- \csname#2\endcsname}}
+ {\dowithbuffer{_typing_}{#1}{#2}
+ {}
+ {\doinitializeverbatim
+ \beginofverbatimlines
+ \ctxlua{buffers.type("_typing_","\typingparameter\c!strip","\typingparameter\c!range")}%
+ \endofverbatimlines
+ \csname#2\endcsname}}
\def\dododostarttyping[#1]%
{\typingparameter\c!before
@@ -612,8 +661,7 @@
{\stopverbatimcolor
\stoppacked % includes \egroup
\typingparameter\c!after
- \egroup
- \dochecknextindentation{\??tp#1}%
+ \normalexpanded{\egroup\checknextindentation[\typingparameter\c!indentnext]}%
\dorechecknextindentation}
%D Line numbering for files is combined with filtering, while
@@ -630,7 +678,7 @@
%D ...
%D \stopcode
%D
-%D \startcode[continue]
+%D \startcode[start=continue]
%D ...
%D ...
%D \stopcode
@@ -640,6 +688,27 @@
%D \stopcode
%D \stoptyping
+%D Ranges:
+%D
+%D \starttyping
+%D % label:start:one
+%D
+%D \def\MyMacro
+%D {just an example}
+%D
+%D % label:stop:one
+%D
+%D \starttext
+%D
+%D % \typefile[file][range={3,6}]{whatever.tex}
+%D
+%D % \typefile[file][range={3,+2}]{whatever.tex}
+%D
+%D \typefile[file][range={label:start:one,label:stop:one}]{whatever.tex}
+%D
+%D \stoptext
+%D \stoptyping
+
%D \macros
%D {setuptyping}
%D
@@ -655,7 +724,7 @@
\getparameters[\??tp][#1]%
\fi}
-\def\setuptyping
+\unexpanded\def\setuptyping
{\dodoubleempty\dosetuptyping}
%D \macros
@@ -664,11 +733,11 @@
%D Specific inline verbatim commands can be defined with the
%D following command.
-\def\definetype
+\unexpanded\def\definetype
{\dodoubleempty\dodefinetype}
\def\dodefinetype[#1][#2]%
- {\unexpanded\setvalue{#1}{\dotype{#1}}%
+ {\setuvalue{#1}{\dotype{#1}}%
\getparameters[\??ty#1][#2]}
%D \macros
@@ -688,7 +757,9 @@
%D
%D The definitions default to the standard typing values.
-\def\presettyping[#1][#2]%
+% TODO: parent etc !
+
+\def\presettyping[#1][#2]% brrr also use parent here
{\copyparameters[\??tp#1][\??tp][\c!color,\c!style]%
\getparameters [\??tp#1][#2]}
@@ -697,7 +768,7 @@
\setvalue{\e!stop #1}{\dostoptyping {#1}}%
\presettyping[#1][#2]}
-\def\definetyping
+\unexpanded\def\definetyping
{\dodoubleempty\dodefinetyping}
%D We can use some core color commands. These are faster than
@@ -705,7 +776,7 @@
%D line basis.
%D
%D \starttyping
-%D \def\setupverbatimcolor%
+%D \unexpanded\def\setupverbatimcolor%
%D {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}%
%D \def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}%
%D \def\endofpretty {\stopcolormode}}
@@ -720,10 +791,7 @@
\def\normalstopverbatimcolor {\stopcolor}
\def\normalverbatimcolor {\getvalue{\typingparameter\c!color}}% command !
-\def\ignorebeginofpretty [#1]{}
-\def\ignoreendofpretty {}
-
-\def\setupnormalprettyverbatim
+\unexpanded\def\setupnormalprettyverbatim
{\edef\prettypalet{\prettyidentifier\prettypalet}%
\let\beginofpretty \normalbeginofpretty
\let\endofpretty \normalendofpretty
@@ -731,7 +799,7 @@
\let\stopverbatimcolor \normalstopverbatimcolor
\let\verbatimcolor \normalverbatimcolor}
-\def\setupignoreprettyverbatim
+\unexpanded\def\setupignoreprettyverbatim
{\let\prettypalet \empty
\let\beginofpretty \ignorebeginofpretty
\let\endofpretty \ignoreendofpretty
@@ -739,7 +807,7 @@
\let\stopverbatimcolor \normalstopverbatimcolor
\let\verbatimcolor \normalverbatimcolor}
-\def\setupverbatimcolor
+\unexpanded\def\setupverbatimcolor
{\edef\prettypalet{\typingparameter\c!palet}%
\ifx\prettypalet\empty
\setupignoreprettyverbatim
@@ -799,33 +867,28 @@
\fi\fi}
\def\dosetuptypelinenumbering#1% fuzzy
- {\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else
- \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]%
- \fi
- \setuptyping[\currenttyping][#1]%
+ {%\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else
+ % \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!continue=\v!no,\c!nlines=]%
+ %\fi
+ \doifassignmentelse{#1}{\setuptyping[\currenttyping][#1]}\donothing
\doifelse{\typingparameter\c!numbering}\v!file
{% kind of special: filters lines !
- \setuplinenumbering[\c!method=\v!file]%
+ \setuplinenumbering[\currenttyping][\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]%
+ {\doifinset\v!continue{#1}{\setuptyping[\currenttyping][\c!continue=\v!yes]}% fails: \settypingparameter\c!continue{\v!yes}
\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}}%
+ \edef\beginofverbatimlines{\noexpand\startlinenumbering
+ [\currenttyping]%
+ [\c!continue=\typingparameter\c!continue,
+ \c!method=\v!type,
+ \c!start=\typingparameter\c!start,
+ \c!stop=\typingparameter\c!stop, % ?
+ \c!step=\typingparameter\c!step]%
+ }%
+ \def\endofverbatimlines{\stoplinenumbering}%
\fi}
\def\reporttypingerror#1% temp hack
@@ -880,7 +943,8 @@
{\doiflocfileelse{#1}
{\firstoftwoarguments}
{\doifinputfileelse{#1}
- {\def\readfilename{\pathplusfile\filepath{#1}}\firstoftwoarguments} % messy, looks wrong too
+% {\def\readfilename{\pathplusfile\filepath{#1}}\firstoftwoarguments} % messy, looks wrong too
+ {\def\readfilename{#1}\firstoftwoarguments} % messy, looks wrong too
{\secondoftwoarguments}}}
\def\dodotypefile[#1][#2]#3%
@@ -930,14 +994,16 @@
\c!evenmargin=\!!zeropoint,
\c!oddmargin=\!!zeropoint,
\c!blank=\v!line,
- \c!escape=/, % beware \string\ , should also be accepted
+ \c!escape=, % yes | no | START,STOP BTEX,ETEX
\c!numbering=\v!no,
\c!lines=,
+ \c!range=,
\c!empty=,
\c!start=1,
\c!stop=,
\c!step=1,
\c!continue=,
+ \c!strip=\v!no, % auto or number
\c!nlines=]
\definetyping[\v!typing]
diff --git a/Master/texmf-dist/tex/context/base/bxml-apa.mkiv b/Master/texmf-dist/tex/context/base/bxml-apa.mkiv
new file mode 100644
index 00000000000..5fc87e5efc6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/bxml-apa.mkiv
@@ -0,0 +1,613 @@
+%D \module
+%D [ file=bxml-apa,
+%D version=2010.05.14, % based on bibl-apa.tex
+%D title=APA bibliography style,
+%D subtitle=Publications,
+%D author={Taco Hoekwater \& Hans Hagen},
+%D date=\currentdate,
+%D copyright={Hans Hagen \& Taco Hoekwater}]
+%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
+
+% helpers (todo)
+
+\let\maybeyear\firstofoneargument
+\let\etalchar \firstofoneargument
+
+\setupbibtexcitationvariants
+ [author,year]
+ [\c!andtext={ and },
+ \c!otherstext={ et al.},
+ \c!pubsep={, },
+ \c!lastpubsep={ and },
+ \c!compress=\v!no,
+ \c!inbetween={ },
+ \c!left={(},
+ \c!right={)}]
+
+\setupbibtexcitationvariants
+ [authoryear]
+ [\c!andtext={ and },
+ \c!otherstext={ et al.},
+ \c!pubsep={, },
+ \c!lastpubsep={ and },
+ \c!compress=\v!yes,
+ \c!inbetween={ },
+ \c!left={(},
+ \c!right={)}]
+
+\setupbibtexcitationvariants
+ [authoryears]
+ [\c!andtext={ and },
+ \c!otherstext={ et al.},
+ \c!pubsep={, },
+ \c!lastpubsep={ and },
+ \c!compress=\v!yes,
+ \c!inbetween={, },
+ \c!left={(},
+ \c!right={)}]
+
+\setupbibtexcitationvariants
+ [key,serial,authornum,page,short,type,doi,url]
+ [\c!andtext={ and },
+ \c!otherstext={ et al.},
+ \c!pubsep={, },
+ \c!lastpubsep={ and },
+ \c!compress=\v!no,
+ \c!inbetween={ },
+ \c!left={[},
+ \c!right={]}]
+
+\setupbibtexcitationvariants
+ [num]
+ [\c!andtext={ and },
+ \c!otherstext={ et al.},
+ \c!pubsep={, },
+ \c!lastpubsep={ and },
+ \c!compress=\v!yes,
+ \c!inbetween={--},
+ \c!left={[},
+ \c!right={]}]
+
+\setupbibtexpublications
+ [\c!sorttype=,
+ \c!criterium=,
+ \c!refcommand=authoryears,
+ \c!numbering=\v!no,
+ \c!autohang=\v!no]
+
+\setupbibtexpublications
+ [\c!width=2em, % 24pt,
+ \c!artauthor=invertedshort,
+ \c!editor=invertedshort,
+ \c!author=invertedshort,
+ \c!namesep={, },
+ \c!lastnamesep={ and },
+ \c!finalnamesep={ and },
+ \c!firstnamesep={, },
+ \c!juniorsep={ },
+ \c!vonsep={ },
+ \c!surnamesep={, },
+ \c!authoretallimit=5,
+ \c!editoretallimit=5,
+ \c!artauthoretallimit=5,
+ \c!authoretaldisplay=5,
+ \c!editoretaldisplay=5,
+ \c!artauthoretaldisplay=5,
+ \c!authoretaltext={ et al.},
+ \c!editoretaltext={ et al.},
+ \c!artauthoretaltext={ et al.}]
+
+% common
+
+\startxmlsetups bibtex:apa:common:wherefrom
+ \bibxmldoifelse {address} {
+ \getvariable{bibtex:temp}{left}
+ \bibxmldoifelse {country} {
+ \bibxmldoifelse {\getvariable{bibtex:temp}{label}} {
+ \bibxmlflush{address}\bibtexcomma\bibxmlflush{country}: \bibxmlflush{\getvariable{bibtex:temp}{label}}
+ } {
+ \bibxmlflush{address}\bibtexcomma\bibxmlflush{country}
+ }
+ } {
+ \bibxmldoifelse {\getvariable{bibtex:temp}{label}} {
+ \bibxmlflush{address}\bibtexcomma\bibxmlflush{\getvariable{bibtex:temp}{label}}
+ } {
+ \bibxmlflush{address}
+ }
+ }
+ \getvariable{bibtex:temp}{right}
+ } {
+ \bibxmldoifelse {country} {
+ \getvariable{bibtex:temp}{left}
+ \bibxmldoifelse {\getvariable{bibtex:temp}{label}} {
+ \bibxmlflush{country}: \bibxmlflush{\getvariable{bibtex:temp}{label}}
+ } {
+ \bibxmlflush{country}
+ }
+ \getvariable{bibtex:temp}{right}
+ } {
+ \bibxmldoifelse {\getvariable{bibtex:temp}{label}} {
+ \getvariable{bibtex:temp}{left}
+ \bibxmlflush{\getvariable{bibtex:temp}{label}}
+ \getvariable{bibtex:temp}{right}
+ } {
+ \getvariable{bibtex:temp}{otherwise}
+ }
+ }
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:publisher
+ \setvariables[bibtex:temp][label=publisher,left=,right=,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:organization
+ \setvariables[bibtex:temp][label=organization,left=,right=,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:school
+ \setvariables[bibtex:temp][label=school,left=,right=,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:institution
+ \setvariables[bibtex:temp][label=institution,left=,right=,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:school:subsentence
+ \setvariables[bibtex:temp][label=school,left=\bibtexcomma,right=\bibtexperiod,otherwise=\bibtexperiod]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:institution:subsentence
+ \setvariables[bibtex:temp][label=institution,left=\bibtexcomma,right=\bibtexperiod,otherwise=\bibtexperiod]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:publisher:sentence
+ \setvariables[bibtex:temp][label=publisher,left=\bibtexspace,right=\bibtexperiod,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+\startxmlsetups bibtex:apa:common:organization:sentence
+ \setvariables[bibtex:temp][label=organization,left=\bibtexspace,right=\bibtexperiod,otherwise=]\relax
+ \bibxmlsetup{bibtex:apa:common:wherefrom}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:title-and-series
+ \bibxmldoif {title} {
+ \bibxmlflush{title}
+ \bibxmldoif {series} {
+ \bibtexlparent\bibxmlflush{series}\bibtexrparent
+ }
+ \bibtexperiod
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:title-it-and-series
+ \bibxmldoif {title} {
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ \bibxmldoif {series} {
+ \bibtexlparent\bibxmlflush{series}\bibtexrparent
+ }
+ \bibtexperiod
+ }
+\stopxmlsetups
+
+\disablemode[bibtex:apa:edited-book]
+
+\startxmlsetups bibtex:apa:common:author-and-year
+ \bibxmldoif {author} {
+ \bibxmlsetup{bibtex:format:author}
+ }
+ \bibxmldoif {year} {
+ \bibtexlparent\bibxmlflush{year}\bibtexrparent
+ }
+ \bibtexperiod
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:author-or-key-and-year
+ \bibxmldoifelse {author} {
+ \bibxmlsetup{bibtex:format:author}
+ } {
+ \bibxmldoif {key} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:key}\bibtexrbracket
+ }
+ }
+ \bibxmldoif {year} {
+ \bibtexlparent\bibxmlflush{year}\bibtexrparent
+ }
+ \bibtexperiod
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:author-editors-crossref-year
+ \bibxmldoif {author} {
+ \bibxmlsetup{bibtex:format:author}
+ } {
+ \bibxmldoifelse {editor} {
+ \enablemode[bibtex:apa:edited-book]
+ \xmlsetup{#1}{bibtex:format:editor}
+ \bibtexcomma\bibtexsingularplural{editor}{editors}
+ } {
+ % weird period
+ \bibxmldoif {crossref} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket\bibtexperiod
+ }
+ }
+ }
+ \bibxmldoif {year} {
+ \bibtexlparent\bibxmlflush{year}\bibtexrparent
+ }
+ \bibtexperiod
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:editor-or-key-and-year
+ \bibxmldoifelse {editor} {
+ \enablemode[bibtex:apa:edited-book]
+ \xmlsetup{#1}{bibtex:format:editor}
+ \bibtexcomma\bibtexsingularplural{editor}{editors}
+ } {
+ \bibxmldoif {key} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:key}\bibtexrbracket
+ }
+ }
+ \bibtexspace
+ \bibxmldoif {year} {
+ \bibtexlparent\bibxmlflush{year}\bibtexrparent
+ }
+ \bibtexperiod
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:note
+ \bibxmldoif {note} {
+ \bibtexspace\bibxmlflush{note}\bibtexperiod
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:comment
+ \bibxmldoif {comment} {
+ \bibtexspace\bibxmlflush{comment}\bibtexperiod
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:pages:p
+ \bibxmldoif {pages} {
+ \bibtexspace\bibxmlflush{pages}\bibtexspace p\bibtexperiod
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:pages:pp
+ \bibxmldoif {pages} {
+ \bibtexspace\bibxmlflush{pages}\bibtexspace pp\bibtexperiod
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:pages:pages
+ \bibxmldoif {pages} {
+ \bibtexcomma pages~\bibxmlflush{pages}
+ }
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:edition:sentense
+ \bibxmldoif {edition} {
+ \bibtexspace\bibxmlflush{edition}\bibtexspace edition\bibtexperiod
+ }
+\stopxmlsetups
+
+% check ewhen the next is used (no period)
+
+% \startxmlsetups bibtex:apa:common:edition
+% \bibxmldoif {edition} {
+% \bibtexspace\bibxmlflush{edition}\bibtexspace edition
+% }
+% \stopxmlsetups
+
+% we can share more, todo
+
+% specific
+
+\startxmlsetups bibtex:apa:article
+ \bibxmlsetup{bibtex:apa:common:author-or-key-and-year}
+ \bibxmldoif {title} {
+ \bibxmlflush{title}\bibtexperiod
+ }
+ \bibxmldoifelse {journal} {
+ \bgroup\it\bibxmlflush{journal}\/\egroup
+ } {
+ \bibxmldoif {crossref} {
+ In\bibtexspace\bibxmlflush{crossref}
+ }
+ }
+ \bibxmldoifelse {volume} {
+ \bibtexcomma\bgroup\it\bibxmlflush{volume}\/\egroup
+ \bibxmldoif {issue} {
+ \bibtexlparent\bibxmlflush{issue}\bibtexlparent
+ }
+ \bibxmldoif {pages} {
+ \bibtexcomma\bibxmlflush{pages}
+ }
+ \bibtexperiod
+ } {
+ \bibxmlsetup{bibtex:apa:common:pages:pp}
+ }
+ \bibxmlsetup{bibtex:apa:common:note}
+ \bibxmlsetup{bibtex:apa:common:comment}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:book
+ \bibxmlsetup{bibtex:apa:common:author-editors-crossref-year}
+ \bibxmldoif {title} {
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ \doifmodeelse {bibtex:apa:edited-book} {
+ \bibxmldoifelse {volume} {
+ \bibtexspace Number\nonbreakablespace\bibxmlflush{volume}
+ \bibxmldoifelse {series} {
+ \bibtexspace in\nonbreakablespace\bibxmlflush{series}\bibtexperiod
+ } {
+ \bibxmldoifelse {crossref} {
+ \bibtexspace in\bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket
+ } {
+ \bibtexperiod
+ }
+ }
+ } {
+ \bibxmldoif {series} {
+ \bibtexspace\bibxmlflush{series}
+ }
+ \bibtexperiod
+ }
+ } {
+ \bibxmldoifelse {crossref} {
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ \bibxmldoif {volume} {
+ Volume\nonbreakablespace\bibxmlflush{volume}\bibtexspace of\nonbreakablespace
+ }
+ } {
+ \bibxmldoif {volume} {
+ \bibtexcomma volume\nonbreakablespace\bibxmlflush{volume}
+ \bibxmldoif {series} {
+ \bibtexspace of\nonbreakablespace\bgroup\it\bibxmlflush{series}\/\egroup
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ }
+ }
+ }
+ }
+ \bibxmlsetup{bibtex:apa:common:edition:sentence}
+ \bibxmlsetup{bibtex:apa:common:publisher:sentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}% twice?
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:inbook
+ \bibxmlsetup{bibtex:apa:common:author-editors-crossref-year}
+ \bibxmldoifelse {title} {
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ } {
+ \doifmodeelse {bibtex:apa:edited-book} {
+ \bibxmldoifelse {volume} {
+ \bibtexspace number\nonbreakablespace\bibxmlflush{volume}
+ \bibxmldoifelse {series} {
+ \bibtexspace in\nonbreakablespace\bibxmlflush{series}\bibtexperiod
+ } {
+ \bibxmldoifelse {crossref} {
+ \bibtexspace in\bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket
+ } {
+ \bibtexperiod
+ }
+ }
+ } {
+ \bibxmldoif {series} {
+ \bibtexspace\bibxmlflush{series}\bibtexperiod
+ }
+ }
+ } {
+ \bibxmldoifelse {crossref} {
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibxmldoif {volume} {
+ Volume\nonbreakablespace\bibxmlflush{volume}\bibtexspace of\nonbreakablespace
+ }
+ \bibxmldoif {crossref} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket
+ }
+ } {
+ \bibxmldoif {volume} {
+ \bibtexcomma volume\nonbreakablespace\bibxmlflush{volume}
+ \bibxmldoif {series} {
+ \bibtexspace of\nonbreakablespace\bgroup\it\bibxmlflush{series}\/\egroup
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ }
+ }
+ }
+ }
+ \bibtexspace
+ \bibxmlsetup{bibtex:apa:common:edition:sentence}
+ \bibxmlsetup{bibtex:apa:common:publisher}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:booklet
+ \bibxmlsetup{bibtex:apa:common:author-or-key-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-it-and-series}
+ \bibxmlsetup{bibtex:apa:common:edition:sentence}
+ \bibxmlsetup{bibtex:apa:common:publication:sentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:manual
+ \bibxmlsetup{bibtex:apa:common:author-or-key-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-it-and-series}
+ \bibxmlsetup{bibtex:apa:common:edition:sentence}
+ \bibxmlsetup{bibtex:apa:common:organization:sentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:incollection
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmldoif {arttitle} {
+ \bibxmlflush{arttitle}\bibtexperiod
+ }
+ In\bibtexspace
+ \bibxmldoifelse {title} {
+ \bibxmlsetup{bibtex:format:editors}\bibtexcomma
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ \bibxmldoif {series} {
+ \bibxmldoif {volume} {
+ \bibtexcomma number\bibtexspace\bibxmlflush{volume}\bibtexspace in
+ }
+ \bibtexspace\bibxmlflush{series}
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}\bibtexspace
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibxmldoif {edition} {
+ \bibtexspace\bibxmlflush{edition}\bibtexspace edition
+ }
+ \bibxmlsetup{bibtex:apa:common:publisher:sentence}
+ } {
+ \bibxmldoif {crossref} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}
+ }
+ \bibtexspace
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ }
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:inproceedings
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmldoif {arttitle} {
+ \bibxmlflush{arttitle}\bibtexperiod
+ }
+ In\bibtexspace
+ \bibxmldoifelse {title} {
+ \bibxmldoif {editors} {
+ \bibxmlflush{bibtex:apa:format:editors}
+ \bibtexcomma\bibtexsingularplural{editor}{editors}\bibtexcomma
+ }
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ \bibxmldoif {series} {
+ \bibxmldoif {volume} {
+ \bibtexcomma number~\bibxmlflush{volume} in
+ }
+ \bibtexspace
+ \bibxmlflush{series}
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}\bibtexspace
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ \bibxmlsetup{bibtex:apa:common:organization:sentence}
+ } {
+ \bibxmldoif {crossref} {
+ \bibtexlbracket\bibxmlsetup{bibtex:format:crossref}\bibtexrbracket
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}\bibtexspace
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ }
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:proceedings
+ \bibxmlsetup{bibtex:apa:common:editor-or-key-and-year}
+ \bibxmldoif {title} {
+ \bgroup\it\bibxmlflush{title}\/\egroup
+ \bibxmldoif {volume} {
+ \bibtexcomma number\bibtexspace\bibxmlflush{volume}\bibtexspace in\bibtexspace
+ }
+ \bibxmldoif {chapter} {
+ \bibtexcomma\bibxmlflush{chapter}\bibtexspace
+ }
+ \bibxmlsetup{bibtex:apa:common:pages:pages}
+ \bibtexperiod
+ \bibxmlsetup{bibtex:apa:common:organization:sentence}
+ }
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:common:thesis
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-it-and-series}
+ \bibxmldoifelse {type} {
+ \bibxmlflush{type}
+ } {
+ \getvariable{bibtex:temp}{label}
+ }
+ \bibxmlsetup{bibtex:apa:common:school:subsentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:mastersthesis
+ \setvariables[bibtex:temp][label=Master's thesis]
+ \bibxmlsetup{bibtex:apa:common:thesis}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:phdthesis
+ \setvariables[bibtex:temp][label=PhD thesis]
+ \bibxmlsetup{bibtex:apa:common:thesis}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:techreport
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-and-series}
+ \bibxmldoifelse {type} {
+ \bibxmlflush{type}
+ \bibxmldoif {volume} {
+ \bibtexspace\bibxmlflush{volume}
+ }
+ } {
+ \bibtexspace Technical Report
+ }
+ \bibxmlsetup{bibtex:apa:common:institution:subsentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:misc
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-and-series}
+ \bibxmlsetup{bibtex:apa:common:publisher:sentence}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\startxmlsetups bibtex:apa:unpublished
+ \bibxmlsetup{bibtex:apa:common:author-and-year}
+ \bibxmlsetup{bibtex:apa:common:title-and-series}
+ \bibxmlsetup{bibtex:apa:common:pages:p}
+ \bibxmldoif {type} {
+ \bibtexlparent\bibxmlflush{type}\bibtexrparent
+ }
+ \bibxmlsetup{bibtex:apa:common:note}
+\stopxmlsetups
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/catc-ctx.tex b/Master/texmf-dist/tex/context/base/catc-ctx.tex
index 83e802e7773..21e7d013641 100644
--- a/Master/texmf-dist/tex/context/base/catc-ctx.tex
+++ b/Master/texmf-dist/tex/context/base/catc-ctx.tex
@@ -14,13 +14,13 @@
%D We prefer to define relevant catcode tables in this file instead
%D of everywhere around.
-\ifx\ctxcatcodes \undefined \newcatcodetable \ctxcatcodes \fi
-\ifx\mthcatcodes \undefined \newcatcodetable \mthcatcodes \fi % math, not used, too tricky
-\ifx\xmlcatcodesn\undefined \newcatcodetable \xmlcatcodesn \fi % normal
-\ifx\xmlcatcodese\undefined \newcatcodetable \xmlcatcodese \fi % entitle
-\ifx\xmlcatcodesr\undefined \newcatcodetable \xmlcatcodesr \fi % reduce
-\ifx\typcatcodesa\undefined \newcatcodetable \typcatcodesa \fi % { }
-\ifx\typcatcodesb\undefined \newcatcodetable \typcatcodesb \fi % < >
+\ifdefined \ctxcatcodes \else \newcatcodetable \ctxcatcodes \fi
+\ifdefined \mthcatcodes \else \newcatcodetable \mthcatcodes \fi % math, not used, too tricky
+\ifdefined \xmlcatcodesn \else \newcatcodetable \xmlcatcodesn \fi % normal
+\ifdefined \xmlcatcodese \else \newcatcodetable \xmlcatcodese \fi % entitle
+\ifdefined \xmlcatcodesr \else \newcatcodetable \xmlcatcodesr \fi % reduce
+\ifdefined \typcatcodesa \else \newcatcodetable \typcatcodesa \fi % { }
+\ifdefined \typcatcodesb \else \newcatcodetable \typcatcodesb \fi % < >
\startcatcodetable \ctxcatcodes
\catcode`\^^I = 10
@@ -202,7 +202,7 @@
\catcodetable \ctxcatcodes
\let\defaultcatcodetable\ctxcatcodes
-\let\xmlcatcodes \xmlcatcodesn
+\let\xmlcatcodes \xmlcatcodesn % beware, in mkiv we use \notcatcodes
\endinput
diff --git a/Master/texmf-dist/tex/context/base/catc-def.tex b/Master/texmf-dist/tex/context/base/catc-def.tex
index 0346f6dae7a..e80cfe12539 100644
--- a/Master/texmf-dist/tex/context/base/catc-def.tex
+++ b/Master/texmf-dist/tex/context/base/catc-def.tex
@@ -13,12 +13,12 @@
%D The following catcode tables are rather \CONTEXT\ independent.
-\ifx\nilcatcodes \undefined \newcatcodetable \nilcatcodes \fi
-\ifx\texcatcodes \undefined \newcatcodetable \texcatcodes \fi
-\ifx\luacatcodes \undefined \newcatcodetable \luacatcodes \fi
-\ifx\notcatcodes \undefined \newcatcodetable \notcatcodes \fi
-\ifx\vrbcatcodes \undefined \newcatcodetable \vrbcatcodes \fi
-\ifx\prtcatcodes \undefined \newcatcodetable \prtcatcodes \fi
+\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`\^^I = 10 % ascii tab is a blank space
diff --git a/Master/texmf-dist/tex/context/base/catc-ini.lua b/Master/texmf-dist/tex/context/base/catc-ini.lua
index e1558b459a0..2749f403c9c 100644
--- a/Master/texmf-dist/tex/context/base/catc-ini.lua
+++ b/Master/texmf-dist/tex/context/base/catc-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['catc-ini'] = {
version = 1.001,
- comment = "companion to catc-ini.tex",
+ comment = "companion to catc-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -17,7 +17,12 @@ storage.register("catcodes/names", catcodes.names, "catcodes.names")
function catcodes.register(name,number)
catcodes.numbers[name] = number
- catcodes.names[number] = name
+ local cnn = catcodes.names[number]
+ if cnn then
+ cnn[#cnn+1] = name
+ else
+ catcodes.names[number] = { name }
+ end
tex[name] = number
end
diff --git a/Master/texmf-dist/tex/context/base/catc-ini.mkiv b/Master/texmf-dist/tex/context/base/catc-ini.mkiv
index 668a55d3bdd..269330a1bbd 100644
--- a/Master/texmf-dist/tex/context/base/catc-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/catc-ini.mkiv
@@ -70,7 +70,7 @@
\catcode`\% \othercatcode
\catcode127 \othercatcode}
-\long\def\startcatcodetable#1#2\stopcatcodetable
+\long\normalprotected\def\startcatcodetable#1#2\stopcatcodetable
{\bgroup
\catcodetable\scratchcatcodes
\the\setdefaultcatcodes
@@ -80,7 +80,7 @@
\newcatcodetable\dummycatcodes
-\long\def\startextendcatcodetable#1#2\stopextendcatcodetable
+\long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable
{\bgroup
\catcodetable#1\relax
\globaldefs\plusone
@@ -90,7 +90,7 @@
% ==
%
-% \long\def\startextendcatcodetable#1#2\stopextendcatcodetable
+% \long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable
% {\bgroup
% \scratchcounter\the\catcodetable
% \catcodetable #1 #2
@@ -107,7 +107,9 @@
%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.
+%D chance for interference. Do we still need this complex
+%D mechanism? Future versions of \MKIV\ might only use
+%D active characters for very special cases.
\chardef\activehackcode=`\~
@@ -128,7 +130,7 @@
\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
+ \reinstatecatcodecommandua % unexpanded
\csname CCL:\number\cctcountera:\number\cctcounterb\endcsname}
% expandable def
@@ -165,8 +167,8 @@
\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
+ {\expandafter\normalprotected\expandafter\def\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname{##1}}%
+ \reinstatecatcodecommandua % unexpanded
\csname CCU:\number\cctcountera:\number\cctcounterb\endcsname}
\def\reinstatecatcodecommand{\afterassignment\reinstatecatcodecommanda\cctcounterb}
@@ -178,6 +180,13 @@
\uppercase{\xdef~{\noexpand\catcodecommand{\number\cctcounterb}}}%
\egroup}
+\def\reinstatecatcodecommandua % 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{\normalprotected\xdef~{\noexpand\catcodecommand{\number\cctcounterb}}}%
+ \egroup}
+
\chardef\defaultcatcodetable\zerocount
\def\catcodecommand#1%
@@ -270,5 +279,39 @@
% \tracecatcodetables
+%D Only in \MKIV\ (to be used when crossing pages with changed catcodes
+%D in the current vector):
+%D
+%D \starttyping
+%D \normalprotected\def\startcrap
+%D {\bgroup
+%D \pushcatcodes
+%D \whitespace
+%D \obeylines
+%D \activatespacehandler\v!yes
+%D \strut}
+%D
+%D \normalprotected\def\stopcrap
+%D {\popcatcodes
+%D \egroup}
+%D \stoptyping
+
+\newcount\catcodetablelevel
+
+\def\pushcatcodes
+ {\bgroup
+ \global\advance\catcodetablelevel\plusone
+ \ifcsname @@ccf:\number\catcodetablelevel\endcsname \else
+ \global\advance\cctdefcounter\plusone
+ \expandafter\global\expandafter\chardef\csname @@ccf:\number\catcodetablelevel\endcsname\cctdefcounter
+ \fi
+ \catcodetable\ctxcatcodes
+ \expandafter\savecatcodetable\csname @@ccf:\number\catcodetablelevel\endcsname
+ \egroup
+ \expandafter\catcodetable\csname @@ccf:\number\catcodetablelevel\endcsname}
+
+\def\popcatcodes
+ {\global\advance\catcodetablelevel\minusone}
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/char-act.mkiv b/Master/texmf-dist/tex/context/base/char-act.mkiv
index 34358784a2a..2dc7823f0bf 100644
--- a/Master/texmf-dist/tex/context/base/char-act.mkiv
+++ b/Master/texmf-dist/tex/context/base/char-act.mkiv
@@ -102,6 +102,19 @@
\prettynaturalfont{\scantextokens\expandafter{\ascii}\ifhmode\unskip\fi}%
\egroup}
+%D What-a-mess:
+
+% \def\normalspacecodes
+% {\catcode`\^^I = 10
+% \catcode`\^^M = 5
+% \catcode`\^^L = 5
+% \catcode`\ = 10
+% \catcode`\^^Z = 9 }
+
+% \appendtoks
+% \normalspacecodes
+% \to \everybeforeoutput
+
\endinput \protect
% obsolete (old hack for idris)
diff --git a/Master/texmf-dist/tex/context/base/char-cmp.lua b/Master/texmf-dist/tex/context/base/char-cmp.lua
index bd33604996a..c7deb79010f 100644
--- a/Master/texmf-dist/tex/context/base/char-cmp.lua
+++ b/Master/texmf-dist/tex/context/base/char-cmp.lua
@@ -1,12 +1,13 @@
if not modules then modules = { } end modules ['char-cmp'] = {
version = 1.001,
- comment = "companion to char-ini.tex",
+ 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 utf = unicode.utf8
+local unpack = unpack or table.unpack
characters = characters or { }
characters.uncomposed = characters.uncomposed or { }
diff --git a/Master/texmf-dist/tex/context/base/char-def.lua b/Master/texmf-dist/tex/context/base/char-def.lua
index 665572ee81f..b7abee0fbf6 100644
--- a/Master/texmf-dist/tex/context/base/char-def.lua
+++ b/Master/texmf-dist/tex/context/base/char-def.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['char-def'] = {
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"
@@ -586,6 +587,7 @@ characters.data={
adobename="at",
category="po",
cjkwd="na",
+ contextname="textat",
description="COMMERCIAL AT",
direction="on",
linebreak="al",
@@ -885,7 +887,7 @@ characters.data={
direction="on",
linebreak="op",
mathclass="open",
- mathname="lbracket",
+ mathname="lbrack",
mirror=0x005D,
unicodeslot=0x005B,
},
@@ -909,7 +911,7 @@ characters.data={
direction="on",
linebreak="cl",
mathclass="close",
- mathname="rbracket",
+ mathname="rbrack",
mirror=0x005B,
unicodeslot=0x005D,
},
@@ -8710,6 +8712,8 @@ characters.data={
description="GREEK CAPITAL LETTER ALPHA",
direction="l",
lccode=0x03B1,
+ mathclass="variable",
+ mathname="Alpha",
linebreak="al",
unicodeslot=0x0391,
},
@@ -8721,6 +8725,8 @@ characters.data={
description="GREEK CAPITAL LETTER BETA",
direction="l",
lccode=0x03B2,
+ mathclass="variable",
+ mathname="Beta",
linebreak="al",
unicodeslot=0x0392,
},
@@ -8731,6 +8737,8 @@ characters.data={
contextname="greekGamma",
description="GREEK CAPITAL LETTER GAMMA",
direction="l",
+ mathclass="variable",
+ mathname="Gamma",
lccode=0x03B3,
linebreak="al",
unicodeslot=0x0393,
@@ -8741,6 +8749,8 @@ characters.data={
contextname="greekDelta",
description="GREEK CAPITAL LETTER DELTA",
direction="l",
+ mathclass="variable",
+ mathname="Delta",
lccode=0x03B4,
linebreak="al",
unicodeslot=0x0394,
@@ -8752,6 +8762,8 @@ characters.data={
contextname="greekEpsilon",
description="GREEK CAPITAL LETTER EPSILON",
direction="l",
+ mathclass="variable",
+ mathname="Epsilon",
lccode=0x03B5,
linebreak="al",
unicodeslot=0x0395,
@@ -8763,6 +8775,8 @@ characters.data={
contextname="greekZeta",
description="GREEK CAPITAL LETTER ZETA",
direction="l",
+ mathclass="variable",
+ mathname="Zeta",
lccode=0x03B6,
linebreak="al",
unicodeslot=0x0396,
@@ -8774,6 +8788,8 @@ characters.data={
contextname="greekEta",
description="GREEK CAPITAL LETTER ETA",
direction="l",
+ mathclass="variable",
+ mathname="Eta",
lccode=0x03B7,
linebreak="al",
unicodeslot=0x0397,
@@ -8785,6 +8801,8 @@ characters.data={
contextname="greekTheta",
description="GREEK CAPITAL LETTER THETA",
direction="l",
+ mathclass="variable",
+ mathname="Theta",
lccode=0x03B8,
linebreak="al",
unicodeslot=0x0398,
@@ -8796,6 +8814,8 @@ characters.data={
contextname="greekIota",
description="GREEK CAPITAL LETTER IOTA",
direction="l",
+ mathclass="variable",
+ mathname="Iota",
lccode=0x03B9,
linebreak="al",
unicodeslot=0x0399,
@@ -8807,6 +8827,8 @@ characters.data={
contextname="greekKappa",
description="GREEK CAPITAL LETTER KAPPA",
direction="l",
+ mathclass="variable",
+ mathname="Kappa",
lccode=0x03BA,
linebreak="al",
unicodeslot=0x039A,
@@ -8818,6 +8840,8 @@ characters.data={
contextname="greekLambda",
description="GREEK CAPITAL LETTER LAMDA",
direction="l",
+ mathclass="variable",
+ mathname="Lambda",
lccode=0x03BB,
linebreak="al",
unicodeslot=0x039B,
@@ -8829,6 +8853,8 @@ characters.data={
contextname="greekMu",
description="GREEK CAPITAL LETTER MU",
direction="l",
+ mathclass="variable",
+ mathname="Mu",
lccode=0x03BC,
linebreak="al",
unicodeslot=0x039C,
@@ -8840,6 +8866,8 @@ characters.data={
contextname="greekNu",
description="GREEK CAPITAL LETTER NU",
direction="l",
+ mathclass="variable",
+ mathname="Nu",
lccode=0x03BD,
linebreak="al",
unicodeslot=0x039D,
@@ -8851,6 +8879,8 @@ characters.data={
contextname="greekXi",
description="GREEK CAPITAL LETTER XI",
direction="l",
+ mathclass="variable",
+ mathname="Xi",
lccode=0x03BE,
linebreak="al",
unicodeslot=0x039E,
@@ -8862,6 +8892,8 @@ characters.data={
contextname="greekOmicron",
description="GREEK CAPITAL LETTER OMICRON",
direction="l",
+ mathclass="variable",
+ mathname="Omicron",
lccode=0x03BF,
linebreak="al",
unicodeslot=0x039F,
@@ -8873,6 +8905,8 @@ characters.data={
contextname="greekPi",
description="GREEK CAPITAL LETTER PI",
direction="l",
+ mathclass="variable",
+ mathname="Pi",
lccode=0x03C0,
linebreak="al",
unicodeslot=0x03A0,
@@ -8884,6 +8918,8 @@ characters.data={
contextname="greekRho",
description="GREEK CAPITAL LETTER RHO",
direction="l",
+ mathclass="variable",
+ mathname="Rho",
lccode=0x03C1,
linebreak="al",
unicodeslot=0x03A1,
@@ -8895,6 +8931,8 @@ characters.data={
contextname="greekSigma",
description="GREEK CAPITAL LETTER SIGMA",
direction="l",
+ mathclass="variable",
+ mathname="Sigma",
lccode=0x03C3,
linebreak="al",
unicodeslot=0x03A3,
@@ -8906,6 +8944,8 @@ characters.data={
contextname="greekTau",
description="GREEK CAPITAL LETTER TAU",
direction="l",
+ mathclass="variable",
+ mathname="Tau",
lccode=0x03C4,
linebreak="al",
unicodeslot=0x03A4,
@@ -8917,6 +8957,8 @@ characters.data={
contextname="greekUpsilon",
description="GREEK CAPITAL LETTER UPSILON",
direction="l",
+ mathclass="variable",
+ mathname="Upsilon",
lccode=0x03C5,
linebreak="al",
unicodeslot=0x03A5,
@@ -8928,6 +8970,8 @@ characters.data={
contextname="greekPhi",
description="GREEK CAPITAL LETTER PHI",
direction="l",
+ mathclass="variable",
+ mathname="Phi",
lccode=0x03C6,
linebreak="al",
unicodeslot=0x03A6,
@@ -8939,6 +8983,8 @@ characters.data={
contextname="greekChi",
description="GREEK CAPITAL LETTER CHI",
direction="l",
+ mathclass="variable",
+ mathname="Chi",
lccode=0x03C7,
linebreak="al",
unicodeslot=0x03A7,
@@ -8950,6 +8996,8 @@ characters.data={
contextname="greekPsi",
description="GREEK CAPITAL LETTER PSI",
direction="l",
+ mathclass="variable",
+ mathname="Psi",
lccode=0x03C8,
linebreak="al",
unicodeslot=0x03A8,
@@ -8960,6 +9008,8 @@ characters.data={
contextname="greekOmega",
description="GREEK CAPITAL LETTER OMEGA",
direction="l",
+ mathclass="variable",
+ mathname="Omega",
lccode=0x03C9,
linebreak="al",
unicodeslot=0x03A9,
@@ -9055,6 +9105,8 @@ characters.data={
description="GREEK SMALL LETTER ALPHA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="alpha",
uccode=0x0391,
unicodeslot=0x03B1,
},
@@ -9066,6 +9118,8 @@ characters.data={
description="GREEK SMALL LETTER BETA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="beta",
uccode=0x0392,
unicodeslot=0x03B2,
},
@@ -9077,6 +9131,8 @@ characters.data={
description="GREEK SMALL LETTER GAMMA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="gamma",
uccode=0x0393,
unicodeslot=0x03B3,
},
@@ -9088,6 +9144,8 @@ characters.data={
description="GREEK SMALL LETTER DELTA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="delta",
uccode=0x0394,
unicodeslot=0x03B4,
},
@@ -9099,6 +9157,8 @@ characters.data={
description="GREEK SMALL LETTER EPSILON",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="varepsilon",
uccode=0x0395,
unicodeslot=0x03B5,
},
@@ -9110,6 +9170,8 @@ characters.data={
description="GREEK SMALL LETTER ZETA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="zeta",
uccode=0x0396,
unicodeslot=0x03B6,
},
@@ -9121,6 +9183,8 @@ characters.data={
description="GREEK SMALL LETTER ETA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="eta",
uccode=0x0397,
unicodeslot=0x03B7,
},
@@ -9132,6 +9196,8 @@ characters.data={
description="GREEK SMALL LETTER THETA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="theta",
uccode=0x0398,
unicodeslot=0x03B8,
},
@@ -9143,6 +9209,8 @@ characters.data={
description="GREEK SMALL LETTER IOTA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="iota",
uccode=0x0399,
unicodeslot=0x03B9,
},
@@ -9154,6 +9222,8 @@ characters.data={
description="GREEK SMALL LETTER KAPPA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="kappa",
uccode=0x039A,
unicodeslot=0x03BA,
},
@@ -9165,6 +9235,8 @@ characters.data={
description="GREEK SMALL LETTER LAMDA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="lambda",
uccode=0x039B,
unicodeslot=0x03BB,
},
@@ -9175,6 +9247,8 @@ characters.data={
description="GREEK SMALL LETTER MU",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="mu",
uccode=0x039C,
unicodeslot=0x03BC,
},
@@ -9186,6 +9260,8 @@ characters.data={
description="GREEK SMALL LETTER NU",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="nu",
uccode=0x039D,
unicodeslot=0x03BD,
},
@@ -9197,6 +9273,8 @@ characters.data={
description="GREEK SMALL LETTER XI",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="xi",
uccode=0x039E,
unicodeslot=0x03BE,
},
@@ -9208,6 +9286,8 @@ characters.data={
description="GREEK SMALL LETTER OMICRON",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="omicron",
uccode=0x039F,
unicodeslot=0x03BF,
},
@@ -9219,6 +9299,8 @@ characters.data={
description="GREEK SMALL LETTER PI",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="pi",
uccode=0x03A0,
unicodeslot=0x03C0,
},
@@ -9230,6 +9312,8 @@ characters.data={
description="GREEK SMALL LETTER RHO",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="rho",
uccode=0x03A1,
unicodeslot=0x03C1,
},
@@ -9240,6 +9324,8 @@ characters.data={
description="GREEK SMALL LETTER FINAL SIGMA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="varsigma",
uccode=0x03A3,
unicodeslot=0x03C2,
},
@@ -9251,6 +9337,8 @@ characters.data={
description="GREEK SMALL LETTER SIGMA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="sigma",
uccode=0x03A3,
unicodeslot=0x03C3,
},
@@ -9262,6 +9350,8 @@ characters.data={
description="GREEK SMALL LETTER TAU",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="tau",
uccode=0x03A4,
unicodeslot=0x03C4,
},
@@ -9273,6 +9363,8 @@ characters.data={
description="GREEK SMALL LETTER UPSILON",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="upsilon",
uccode=0x03A5,
unicodeslot=0x03C5,
},
@@ -9284,6 +9376,8 @@ characters.data={
description="GREEK SMALL LETTER PHI",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="varphi",
uccode=0x03A6,
unicodeslot=0x03C6,
},
@@ -9295,6 +9389,8 @@ characters.data={
description="GREEK SMALL LETTER CHI",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="chi",
uccode=0x03A7,
unicodeslot=0x03C7,
},
@@ -9306,6 +9402,8 @@ characters.data={
description="GREEK SMALL LETTER PSI",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="psi",
uccode=0x03A8,
unicodeslot=0x03C8,
},
@@ -9317,6 +9415,8 @@ characters.data={
description="GREEK SMALL LETTER OMEGA",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="omega",
uccode=0x03A9,
unicodeslot=0x03C9,
},
@@ -9396,6 +9496,8 @@ characters.data={
description="GREEK THETA SYMBOL",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="varTheta",
specials={ "compat", 0x03B8 },
uccode=0x0398,
unicodeslot=0x03D1,
@@ -9433,6 +9535,8 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x03C6 },
+ mathclass="variable",
+ mathname="phi",
uccode=0x03A6,
unicodeslot=0x03D5,
},
@@ -9443,6 +9547,8 @@ characters.data={
description="GREEK PI SYMBOL",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="varpi",
specials={ "compat", 0x03C0 },
uccode=0x03A0,
unicodeslot=0x03D6,
@@ -9706,6 +9812,8 @@ characters.data={
description="GREEK LUNATE EPSILON SYMBOL",
direction="l",
linebreak="al",
+ mathclass="variable",
+ mathname="epsilon",
specials={ "compat", 0x03B5 },
uccode=0x0395,
unicodeslot=0x03F5,
@@ -13907,6 +14015,7 @@ characters.data={
category="cf",
description="ARABIC NUMBER SIGN",
direction="an",
+ visible="yes",
linebreak="al",
unicodeslot=0x0600,
},
@@ -13914,6 +14023,7 @@ characters.data={
category="cf",
description="ARABIC SIGN SANAH",
direction="an",
+ visible="yes",
linebreak="al",
unicodeslot=0x0601,
},
@@ -13921,6 +14031,7 @@ characters.data={
category="cf",
description="ARABIC FOOTNOTE MARKER",
direction="an",
+ visible="yes",
linebreak="al",
unicodeslot=0x0602,
},
@@ -13928,6 +14039,7 @@ characters.data={
category="cf",
description="ARABIC SIGN SAFHA",
direction="an",
+ visible="yes",
linebreak="al",
unicodeslot=0x0603,
},
@@ -15448,6 +15560,7 @@ characters.data={
category="cf",
description="ARABIC END OF AYAH",
direction="an",
+ visible="yes",
linebreak="al",
unicodeslot=0x06DD,
},
@@ -15797,6 +15910,7 @@ characters.data={
category="cf",
description="SYRIAC ABBREVIATION MARK",
direction="bn",
+ visible="yes",
linebreak="al",
unicodeslot=0x070F,
},
@@ -48736,6 +48850,7 @@ characters.data={
[0x200C]={
adobename="afii61664",
category="cf",
+ contextname="zwnj",
description="ZERO WIDTH NON-JOINER",
direction="bn",
linebreak="cm",
@@ -48744,6 +48859,7 @@ characters.data={
[0x200D]={
adobename="afii301",
category="cf",
+ contextname="zwj",
description="ZERO WIDTH JOINER",
direction="bn",
linebreak="cm",
@@ -49444,7 +49560,7 @@ characters.data={
[0x2061]={
category="cf",
comment="maybe: nulloperator",
- contextcommand="relax",
+ contextname="relax",
description="FUNCTION APPLICATION",
direction="bn",
linebreak="al",
@@ -50038,6 +50154,8 @@ characters.data={
description="COMBINING THREE DOTS ABOVE",
direction="nsm",
linebreak="cm",
+ mathclass="accent",
+ mathname="dddot",
unicodeslot=0x20DB,
},
[0x20DC]={
@@ -59877,6 +59995,8 @@ characters.data={
description="BLACK RIGHT-POINTING TRIANGLE",
direction="on",
linebreak="ai",
+ mathclass="bin",
+ mathname="blacktriangleright",
unicodeslot=0x25B6,
},
[0x25B7]={
@@ -59892,6 +60012,8 @@ characters.data={
description="BLACK RIGHT-POINTING SMALL TRIANGLE",
direction="on",
linebreak="al",
+ mathclass="bin",
+ mathname="blacktriangleleft",
unicodeslot=0x25B8,
},
[0x25B9]={
@@ -108416,6 +108538,7 @@ characters.data={
category="cf",
description="INTERLINEAR ANNOTATION ANCHOR",
direction="on",
+ visible="yes",
linebreak="cm",
unicodeslot=0xFFF9,
},
@@ -108423,6 +108546,7 @@ characters.data={
category="cf",
description="INTERLINEAR ANNOTATION SEPARATOR",
direction="on",
+ visible="yes",
linebreak="cm",
unicodeslot=0xFFFA,
},
@@ -108430,6 +108554,7 @@ characters.data={
category="cf",
description="INTERLINEAR ANNOTATION TERMINATOR",
direction="on",
+ visible="yes",
linebreak="cm",
unicodeslot=0xFFFB,
},
@@ -126093,6 +126218,7 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL V",
direction="l",
linebreak="al",
+--mathclass="variable",
specials={ "font", 0x0056 },
unicodeslot=0x1D449,
},
@@ -131209,8 +131335,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL ALPHA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Alpha",
specials={ "font", 0x0391 },
unicodeslot=0x1D6E2,
},
@@ -131219,8 +131343,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL BETA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Beta",
specials={ "font", 0x0392 },
unicodeslot=0x1D6E3,
},
@@ -131229,8 +131351,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL GAMMA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Gamma",
specials={ "font", 0x0393 },
unicodeslot=0x1D6E4,
},
@@ -131239,8 +131359,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL DELTA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Delta",
specials={ "font", 0x0394 },
unicodeslot=0x1D6E5,
},
@@ -131249,8 +131367,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL EPSILON",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Epsilon",
specials={ "font", 0x0395 },
unicodeslot=0x1D6E6,
},
@@ -131259,8 +131375,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL ZETA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Zeta",
specials={ "font", 0x0396 },
unicodeslot=0x1D6E7,
},
@@ -131269,8 +131383,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL ETA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Eta",
specials={ "font", 0x0397 },
unicodeslot=0x1D6E8,
},
@@ -131279,8 +131391,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL THETA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Theta",
specials={ "font", 0x0398 },
unicodeslot=0x1D6E9,
},
@@ -131289,8 +131399,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL IOTA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Iota",
specials={ "font", 0x0399 },
unicodeslot=0x1D6EA,
},
@@ -131299,8 +131407,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL KAPPA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Kappa",
specials={ "font", 0x039A },
unicodeslot=0x1D6EB,
},
@@ -131309,8 +131415,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL LAMDA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Lambda",
specials={ "font", 0x039B },
unicodeslot=0x1D6EC,
},
@@ -131319,8 +131423,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL MU",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Mu",
specials={ "font", 0x039C },
unicodeslot=0x1D6ED,
},
@@ -131329,8 +131431,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL NU",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Nu",
specials={ "font", 0x039D },
unicodeslot=0x1D6EE,
},
@@ -131339,8 +131439,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL XI",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Xi",
specials={ "font", 0x039E },
unicodeslot=0x1D6EF,
},
@@ -131349,8 +131447,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL OMICRON",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Omicron",
specials={ "font", 0x039F },
unicodeslot=0x1D6F0,
},
@@ -131359,8 +131455,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL PI",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Pi",
specials={ "font", 0x03A0 },
unicodeslot=0x1D6F1,
},
@@ -131369,8 +131463,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL RHO",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Rho",
specials={ "font", 0x03A1 },
unicodeslot=0x1D6F2,
},
@@ -131379,8 +131471,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL THETA SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="varTheta",
specials={ "font", 0x03F4 },
unicodeslot=0x1D6F3,
},
@@ -131389,8 +131479,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL SIGMA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Sigma",
specials={ "font", 0x03A3 },
unicodeslot=0x1D6F4,
},
@@ -131399,8 +131487,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL TAU",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Tau",
specials={ "font", 0x03A4 },
unicodeslot=0x1D6F5,
},
@@ -131409,8 +131495,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL UPSILON",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Upsilon",
specials={ "font", 0x03A5 },
unicodeslot=0x1D6F6,
},
@@ -131419,8 +131503,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL PHI",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Phi",
specials={ "font", 0x03A6 },
unicodeslot=0x1D6F7,
},
@@ -131429,8 +131511,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL CHI",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Chi",
specials={ "font", 0x03A7 },
unicodeslot=0x1D6F8,
},
@@ -131439,8 +131519,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL PSI",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Psi",
specials={ "font", 0x03A8 },
unicodeslot=0x1D6F9,
},
@@ -131449,8 +131527,6 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL OMEGA",
direction="l",
linebreak="al",
- mathclass="variable",
- mathname="Omega",
specials={ "font", 0x03A9 },
unicodeslot=0x1D6FA,
},
@@ -131469,8 +131545,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL ALPHA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="alpha",
specials={ "font", 0x03B1 },
unicodeslot=0x1D6FC,
},
@@ -131479,8 +131553,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL BETA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="beta",
specials={ "font", 0x03B2 },
unicodeslot=0x1D6FD,
},
@@ -131489,8 +131561,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL GAMMA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="gamma",
specials={ "font", 0x03B3 },
unicodeslot=0x1D6FE,
},
@@ -131499,8 +131569,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL DELTA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="delta",
specials={ "font", 0x03B4 },
unicodeslot=0x1D6FF,
},
@@ -131509,8 +131577,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL EPSILON",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="varepsilon",
specials={ "font", 0x03B5 },
unicodeslot=0x1D700,
},
@@ -131519,8 +131585,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL ZETA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="zeta",
specials={ "font", 0x03B6 },
unicodeslot=0x1D701,
},
@@ -131529,8 +131593,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL ETA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="eta",
specials={ "font", 0x03B7 },
unicodeslot=0x1D702,
},
@@ -131539,8 +131601,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL THETA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="theta",
specials={ "font", 0x03B8 },
unicodeslot=0x1D703,
},
@@ -131549,8 +131609,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL IOTA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="iota",
specials={ "font", 0x03B9 },
unicodeslot=0x1D704,
},
@@ -131559,8 +131617,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL KAPPA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="kappa",
specials={ "font", 0x03BA },
unicodeslot=0x1D705,
},
@@ -131569,8 +131625,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL LAMDA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="lambda",
specials={ "font", 0x03BB },
unicodeslot=0x1D706,
},
@@ -131579,8 +131633,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL MU",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="mu",
specials={ "font", 0x03BC },
unicodeslot=0x1D707,
},
@@ -131589,8 +131641,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL NU",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="nu",
specials={ "font", 0x03BD },
unicodeslot=0x1D708,
},
@@ -131599,8 +131649,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL XI",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="xi",
specials={ "font", 0x03BE },
unicodeslot=0x1D709,
},
@@ -131609,8 +131657,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL OMICRON",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="omicron",
specials={ "font", 0x03BF },
unicodeslot=0x1D70A,
},
@@ -131619,8 +131665,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL PI",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="pi",
specials={ "font", 0x03C0 },
unicodeslot=0x1D70B,
},
@@ -131629,8 +131673,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL RHO",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="rho",
specials={ "font", 0x03C1 },
unicodeslot=0x1D70C,
},
@@ -131639,8 +131681,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL FINAL SIGMA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="varsigma",
specials={ "font", 0x03C2 },
unicodeslot=0x1D70D,
},
@@ -131649,8 +131689,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL SIGMA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="sigma",
specials={ "font", 0x03C3 },
unicodeslot=0x1D70E,
},
@@ -131659,8 +131697,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL TAU",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="tau",
specials={ "font", 0x03C4 },
unicodeslot=0x1D70F,
},
@@ -131669,8 +131705,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL UPSILON",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="upsilon",
specials={ "font", 0x03C5 },
unicodeslot=0x1D710,
},
@@ -131679,8 +131713,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL PHI",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="varphi",
specials={ "font", 0x03C6 },
unicodeslot=0x1D711,
},
@@ -131689,8 +131721,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL CHI",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="chi",
specials={ "font", 0x03C7 },
unicodeslot=0x1D712,
},
@@ -131699,8 +131729,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL PSI",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="psi",
specials={ "font", 0x03C8 },
unicodeslot=0x1D713,
},
@@ -131709,8 +131737,6 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL OMEGA",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="omega",
specials={ "font", 0x03C9 },
unicodeslot=0x1D714,
},
@@ -131727,8 +131753,6 @@ characters.data={
description="MATHEMATICAL ITALIC EPSILON SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="epsilon",
specials={ "font", 0x03F5 },
unicodeslot=0x1D716,
},
@@ -131757,8 +131781,6 @@ characters.data={
description="MATHEMATICAL ITALIC PHI SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="phi",
specials={ "font", 0x03D5 },
unicodeslot=0x1D719,
},
@@ -131767,7 +131789,7 @@ characters.data={
description="MATHEMATICAL ITALIC RHO SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="variable",
mathname="varrho",
specials={ "font", 0x03F1 },
unicodeslot=0x1D71A,
@@ -131777,8 +131799,6 @@ characters.data={
description="MATHEMATICAL ITALIC PI SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
- mathname="varpi",
specials={ "font", 0x03D6 },
unicodeslot=0x1D71B,
},
diff --git a/Master/texmf-dist/tex/context/base/char-enc.lua b/Master/texmf-dist/tex/context/base/char-enc.lua
index a4e5ac77d58..45f404ee985 100644
--- a/Master/texmf-dist/tex/context/base/char-enc.lua
+++ b/Master/texmf-dist/tex/context/base/char-enc.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['char-syn'] = {
version = 1.001,
- comment = "companion to char-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/char-ini.lua b/Master/texmf-dist/tex/context/base/char-ini.lua
index ff42d91eeaa..5c4a40bad51 100644
--- a/Master/texmf-dist/tex/context/base/char-ini.lua
+++ b/Master/texmf-dist/tex/context/base/char-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['char-ini'] = {
version = 1.001,
- comment = "companion to char-ini.tex",
+ 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"
@@ -11,7 +11,7 @@ xml = xml or { }
local utf = unicode.utf8
-local utfchar, utfbyte = utf.char, utf.byte
+local utfchar, utfbyte, utfvalues = utf.char, utf.byte, string.utfvalues
local concat = table.concat
local next, tonumber = next, tonumber
local texsprint, texprint = tex.sprint, tex.print
@@ -422,6 +422,7 @@ function characters.define(tobelettered, tobeactivated) -- catcodetables
end
end
elseif is_command[category] then
+ -- this might change: contextcommand ipv contextname
-- texprint(format("{\\catcode %s=13\\unexpanded\\gdef %s{\\%s}}",u,utfchar(u),contextname))
texsprint("{\\catcode",u,"=13\\unexpanded\\gdef ",utfchar(u),"{\\"..contextname,"}}") -- no texprint
activated[#activated+1] = "\\c"..u.."\\a"
@@ -607,28 +608,91 @@ function characters.n_is_of_category(n,category) -- by name (string)
return cd and cd.category == category
end
--- xml support
-
-characters.active_offset = 0x10000
-
-xml.entities = xml.entities or { }
-
-storage.register("xml/entities",xml.entities,"xml.entities") -- this will move to lxml
+-- xml support (moved)
function characters.remapentity(chr,slot)
texsprint(format("{\\catcode%s=13\\xdef%s{\\string%s}}",slot,utfchar(slot),chr))
end
-function characters.setmkiventities()
- local entities = xml.entities
- entities.lt = "<"
- entities.amp = "&"
- entities.gt = ">"
+characters.active_offset = 0x10000 -- there will be remapped in that byte range
+
+-- xml.entities = xml.entities or { }
+--
+-- storage.register("xml/entities",xml.entities,"xml.entities") -- this will move to lxml
+--
+-- function characters.setmkiventities()
+-- local entities = xml.entities
+-- entities.lt = "<"
+-- entities.amp = "&"
+-- entities.gt = ">"
+-- end
+--
+-- function characters.setmkiientities()
+-- local entities = xml.entities
+-- entities.lt = utfchar(characters.active_offset + utfbyte("<"))
+-- entities.amp = utfchar(characters.active_offset + utfbyte("&"))
+-- entities.gt = utfchar(characters.active_offset + utfbyte(">"))
+-- end
+
+-- some day we will make a table
+
+function characters.lower(str)
+ local new = { }
+ for u in utfvalues(str) do
+ new[#new+1] = utfchar(data[u].lccode or u)
+ end
+ return concat(new)
end
-function characters.setmkiientities()
- local entities = xml.entities
- entities.lt = utfchar(characters.active_offset + utfbyte("<"))
- entities.amp = utfchar(characters.active_offset + utfbyte("&"))
- entities.gt = utfchar(characters.active_offset + utfbyte(">"))
+function characters.upper(str)
+ local new = { }
+ for u in utfvalues(str) do
+ new[#new+1] = utfchar(data[u].uccode or u)
+ end
+ return concat(new)
end
+
+-- -- some day we might go this route, but it does not really save that much
+-- -- so not now (we can generate a lot using mtx-unicode that operates on the
+-- -- database)
+--
+-- -- category cjkwd direction linebreak
+--
+-- -- adobename comment contextcommand contextname description fallback lccode
+-- -- mathclass mathfiller mathname mathspec mathstretch mathsymbol mirror
+-- -- range shcode specials uccode uccodes unicodeslot
+--
+-- local data = {
+-- ['one']={
+-- common = {
+-- category="cc",
+-- direction="bn",
+-- linebreak="cm",
+-- },
+-- vector = {
+-- [0x0000] = {
+-- description="NULL",
+-- group='one',
+-- unicodeslot=0x0000,
+-- },
+-- {
+-- description="START OF HEADING",
+-- group='one',
+-- unicodeslot=0x0001,
+-- },
+-- }
+-- }
+-- }
+--
+-- local chardata, groupdata = { }, { }
+--
+-- for group, gdata in next, data do
+-- local common, vector = { __index = gdata.common }, gdata.vector
+-- for character, cdata in next, vector do
+-- chardata[character] = cdata
+-- setmetatable(cdata,common)
+-- end
+-- groupdata[group] = gdata
+-- end
+
+--~ characters.data, characters.groups = chardata, groupdata
diff --git a/Master/texmf-dist/tex/context/base/char-ini.mkiv b/Master/texmf-dist/tex/context/base/char-ini.mkiv
index daa20e72867..0d5e16bb04b 100644
--- a/Master/texmf-dist/tex/context/base/char-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/char-ini.mkiv
@@ -17,6 +17,7 @@
\registerctxluafile{char-ini}{1.001}
\registerctxluafile{char-cmp}{1.001} % maybe we will load this someplace else
\registerctxluafile{char-map}{1.001} % maybe we will load this someplace else
+\registerctxluafile{char-tex}{1.001}
\unprotect
@@ -69,6 +70,7 @@
\number\xmlcatcodesr,
}
)
+ catcodes.register("xmlcatcodes",\number\xmlcatcodes)
}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/char-map.lua b/Master/texmf-dist/tex/context/base/char-map.lua
index 0d8422bc2d3..3f8cc3b3d3c 100644
--- a/Master/texmf-dist/tex/context/base/char-map.lua
+++ b/Master/texmf-dist/tex/context/base/char-map.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['char-map'] = {
version = 1.001,
- comment = "companion to char-ini.tex",
+ comment = "companion to char-ini.mkiv",
author = "Hans Hagen & Arthur Reutenauer",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/char-tex.lua b/Master/texmf-dist/tex/context/base/char-tex.lua
new file mode 100644
index 00000000000..ed9a244d781
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/char-tex.lua
@@ -0,0 +1,89 @@
+if not modules then modules = { } end modules ['char-tex'] = {
+ 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"
+}
+
+characters = characters or { }
+characters.tex = characters.tex or { }
+
+local find = string.find
+
+local accent_map = {
+ ['~'] = "̃" , -- ̃ Ẽ
+ ['"'] = "̈" , -- ̈ Ë
+ ["`"] = "̀" , -- ̀ È
+ ["'"] = "́" , -- ́ É
+ ["^"] = "̂" , -- ̂ Ê
+ -- ̄ Ē
+ -- ̆ Ĕ
+ -- ̇ Ė
+ -- ̉ Ẻ
+ -- ̌ Ě
+ -- ̏ Ȅ
+ -- ̑ Ȇ
+ -- ̣ Ẹ
+ -- ̧ Ȩ
+ -- ̨ Ę
+ -- ̭ Ḙ
+ -- ̰ Ḛ
+}
+
+local accents = table.concat(table.keys(accent_map))
+
+local function remap_accents(a,c,braced)
+ local m = accent_map[a]
+ if m then
+ return c .. m
+ elseif braced then
+ return "\\" .. a .. "{" .. c .. "}"
+ else
+ return "\\" .. a .. c
+ end
+end
+
+local command_map = {
+ ["i"] = "ı"
+}
+
+local function remap_commands(c)
+ local m = command_map[c]
+ if m then
+ return m
+ else
+ return "\\" .. c
+ end
+end
+
+local P, C, R, S, Cs, Cc = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cs, lpeg.Cc
+local U, lpegmatch = lpeg.patterns.utf8, lpeg.match
+
+local accents = (P('\\') * C(S(accents)) * (P("{") * C(U) * P("}" * Cc(true)) + C(U) * Cc(false))) / remap_accents
+local commands = (P('\\') * C(R("az","AZ")^1)) / remap_commands
+
+local convert_accents = Cs((accents + P(1))^0)
+local convert_commands = Cs((commands + P(1))^0)
+
+local no_l = P("{") / ""
+local no_r = P("}") / ""
+
+local convert_accents_strip = Cs((no_l * accents * no_r + accents + P(1))^0)
+local convert_commands_strip = Cs((no_l * commands * no_r + commands + P(1))^0)
+
+function characters.tex.toutf(str,strip)
+ if find(str,"\\") then -- we can start at teh found position
+ if strip then
+ str = lpegmatch(convert_commands_strip,str)
+ str = lpegmatch(convert_accents_strip,str)
+ else
+ str = lpegmatch(convert_commands,str)
+ str = lpegmatch(convert_accents,str)
+ end
+ end
+ return str
+end
+
+--~ print(characters.tex.toutf([[\"{e}]]),true)
+--~ print(characters.tex.toutf([[{\"{e}}]],true))
diff --git a/Master/texmf-dist/tex/context/base/char-utf.lua b/Master/texmf-dist/tex/context/base/char-utf.lua
index 7dd5d914f79..6dd85fdc87d 100644
--- a/Master/texmf-dist/tex/context/base/char-utf.lua
+++ b/Master/texmf-dist/tex/context/base/char-utf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['char-utf'] = {
version = 1.001,
- comment = "companion to char-utf.tex",
+ comment = "companion to char-utf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/char-utf.mkiv b/Master/texmf-dist/tex/context/base/char-utf.mkiv
index d21cd842cc2..16b4029d8cb 100644
--- a/Master/texmf-dist/tex/context/base/char-utf.mkiv
+++ b/Master/texmf-dist/tex/context/base/char-utf.mkiv
@@ -41,7 +41,7 @@
%D \definecomposedutf 318 108 126 % lcaron
%D \stoptyping
-\def\definecomposedutf#1 #2 #3 %
+\unexpanded\def\definecomposedutf#1 #2 #3 %
{\ctxlua{characters.filters.utf.add_grapheme("#1","#2","#3")}}
\protect
diff --git a/Master/texmf-dist/tex/context/base/chem-ini.lua b/Master/texmf-dist/tex/context/base/chem-ini.lua
index 27b73484008..90874909207 100644
--- a/Master/texmf-dist/tex/context/base/chem-ini.lua
+++ b/Master/texmf-dist/tex/context/base/chem-ini.lua
@@ -1,12 +1,13 @@
if not modules then modules = { } end modules ['chem-ini'] = {
version = 1.001,
- comment = "companion to chem-ini.tex",
+ comment = "companion to chem-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local format, texsprint = string.format, tex.sprint
+local lpegmatch = lpeg.match
local trace_molecules = false trackers.register("chemistry.molecules", function(v) trace_molecules = v end)
@@ -60,15 +61,15 @@ local parser = lpeg.Cs((csname + lowhigh + highlow + low + high + sign + any
chemicals.moleculeparser = parser -- can be used to avoid functioncall
function chemicals.molecule(str)
- return parser:match(str)
+ return lpegmatch(parser,str)
end
function commands.molecule(str)
if trace_molecules then
- local rep = parser:match(str)
+ local rep = lpegmatch(parser,str)
logs.report("chemistry", "molecule %s => %s",str,rep)
texsprint(ctxcatcodes,rep)
else
- texsprint(ctxcatcodes,parser:match(str))
+ texsprint(ctxcatcodes,lpegmatch(parser,str))
end
end
diff --git a/Master/texmf-dist/tex/context/base/chem-ini.mkiv b/Master/texmf-dist/tex/context/base/chem-ini.mkiv
index da240dbace5..5184fe1a7a0 100644
--- a/Master/texmf-dist/tex/context/base/chem-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/chem-ini.mkiv
@@ -17,7 +17,7 @@
\unprotect
%D \macros
-%D {\molecule}
+%D {molecule}
%D
%D Quick and dirty:
%D
diff --git a/Master/texmf-dist/tex/context/base/chem-str.lua b/Master/texmf-dist/tex/context/base/chem-str.lua
index 8ab48fca2af..ad4cc6c1be4 100644
--- a/Master/texmf-dist/tex/context/base/chem-str.lua
+++ b/Master/texmf-dist/tex/context/base/chem-str.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['chem-str'] = {
version = 1.001,
- comment = "companion to chem-str.tex",
+ comment = "companion to chem-str.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -17,6 +17,7 @@ local format, gmatch, match, lower, gsub = string.format, string.gmatch, string.
local concat, insert, remove = table.concat, table.insert, table.remove
local apply = structure.processors.apply
local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local lpegmatch = lpeg.match
local variables = interfaces.variables
@@ -59,7 +60,7 @@ local one_keys = {
sb = "line", db = "line", tb = "line",
ep = "line", es = "line", ed = "line", et = "line",
sd = "line", ldd = "line", rdd = "line",
- hb = "line", bb = "line", oe = "line",
+ hb = "line", bb = "line", oe = "line", bd = "line", bw = "line",
z = "text", cz = "text", zt = "text", zn = "number",
zbt = "text", zbn = "number", ztt = "text", ztn = "number",
mov = "transform", sub = "transform", dir = "transform", off = "transform",
@@ -141,10 +142,11 @@ local syntax = {
local definitions = { }
function chemicals.undefine(name)
- definitions[name] = nil
+ definitions[lower(name)] = nil
end
function chemicals.define(name,spec,text)
+ name = lower(name)
local dn = definitions[name]
if not dn then dn = { } definitions[name] = dn end
dn[#dn+1] = {
@@ -154,7 +156,7 @@ function chemicals.define(name,spec,text)
end
local metacode, kind, keys, bonds, max, txt, textsize, rot, pstack
-local molecule = chemicals.molecule -- or use chemicals.moleculeparser:match(...)
+local molecule = chemicals.molecule -- or use lpegmatch(chemicals.moleculeparser,...)
local function fetch(txt)
local st = stack[txt]
@@ -197,12 +199,12 @@ local pattern =
lpeg.Cc(false) * lpeg.Cc(false) * lpeg.Cc(false) * text
)
---~ local n, operation, index, upto, set, text = pattern:match("RZ1357")
+--~ local n, operation, index, upto, set, text = lpegmatch(pattern,"RZ1357")
---~ print(pattern:match("RZ=x")) 1 RZ false false false x
---~ print(pattern:match("RZ1=x")) 1 RZ 1 false false x
---~ print(pattern:match("RZ1..3=x")) 1 RZ 1 3 false x
---~ print(pattern:match("RZ13=x")) 1 RZ false false table x
+--~ print(lpegmatch(pattern,"RZ=x")) 1 RZ false false false x
+--~ print(lpegmatch(pattern,"RZ1=x")) 1 RZ 1 false false x
+--~ print(lpegmatch(pattern,"RZ1..3=x")) 1 RZ 1 3 false x
+--~ print(lpegmatch(pattern,"RZ13=x")) 1 RZ false false table x
local function process(spec,text,n,rulethickness,rulecolor,offset)
insert(stack,{ spec=spec, text=text, n=n })
@@ -216,7 +218,7 @@ local function process(spec,text,n,rulethickness,rulecolor,offset)
process(di.spec,di.text,1,rulethickness,rulecolor)
end
else
- local rep, operation, special, index, upto, set, text = pattern:match(s)
+ local rep, operation, special, index, upto, set, text = lpegmatch(pattern,s)
if operation == "pb" then
insert(pstack,kind)
metacode[#metacode+1] = syntax.pb.direct
@@ -441,7 +443,7 @@ function chemicals.stop()
if trace_structure then
logs.report("chemical", "metapost code:\n%s", mpcode)
end
- metapost.graphic(chemicals.instance,chemicals.format,mpcode,"")
+ metapost.graphic(chemicals.instance,chemicals.format,mpcode)
metacode = nil
end
diff --git a/Master/texmf-dist/tex/context/base/chem-str.mkiv b/Master/texmf-dist/tex/context/base/chem-str.mkiv
index 29c6fe939bd..1e17218c875 100644
--- a/Master/texmf-dist/tex/context/base/chem-str.mkiv
+++ b/Master/texmf-dist/tex/context/base/chem-str.mkiv
@@ -49,7 +49,7 @@
\unprotect
-\def\setupchemical
+\unexpanded\def\setupchemical
{\dosingleempty\dosetupchemical}
\def\dosetupchemical
@@ -57,7 +57,7 @@
\let\setupchemicals\setupchemical
-\def\setupchemicalframed
+\unexpanded\def\setupchemicalframed
{\dosingleempty\dosetupchemicalframed}
\def\dosetupchemicalframed
@@ -65,7 +65,7 @@
\def\chemicalparameter#1{\csname\??cm#1\endcsname}
-\def\definechemical
+\unexpanded\def\definechemical
{\dosingleargument\dodefinechemical} % global
\def\dodefinechemical[#1]#2%
@@ -76,7 +76,7 @@
#2% flush
\stopnointerference}
-\def\definechemicalsymbol
+\unexpanded\def\definechemicalsymbol
{\dodoubleempty\dodefinechemicalsymbol}
\def\dodefinechemicalsymbol[#1][#2]%
@@ -100,6 +100,9 @@
\def\dochemicaltext#1% in ppchtex we had a more clever alignment
{\dosetchemicaltext\strut#1} % maybe also \setstrut
+\def\dochemicaltext#1%
+ {\mathematics{\dosetchemicaltext\strut\ifcase\currentxfontsize\or\scriptstyle\or\scriptscriptstyle\fi#1}}
+
\newconditional\indisplaychemical
\unexpanded\def\startchemical
@@ -437,7 +440,7 @@
\newif\ifinchemicalformula
-\def\startchemicalformula
+\unexpanded\def\startchemicalformula
{\mathortext\vcenter\vbox\bgroup
\forgetall
\inchemicalformulatrue
@@ -450,7 +453,7 @@
\setfalse\formulachemicalhastop
\setfalse\formulachemicalhasbot }
-\def\stopchemicalformula
+\unexpanded\def\stopchemicalformula
{\tabskip1em\relax
\nointerlineskip
\ifconditional\formulachemicalhastop
diff --git a/Master/texmf-dist/tex/context/base/colo-ext.mkii b/Master/texmf-dist/tex/context/base/colo-ext.mkii
index 06facd34ee2..473c010e028 100644
--- a/Master/texmf-dist/tex/context/base/colo-ext.mkii
+++ b/Master/texmf-dist/tex/context/base/colo-ext.mkii
@@ -42,12 +42,14 @@
%D handling. Here we deal with a per-document setting.
\setupcolors
- [\c!overprint=\v!no]
+ [\c!intent=\v!none]
\def\starttextoverprint
- {\doifelse\@@cloverprint\v!yes
- {\let\stoptextoverprint\dostopoverprint\dostartoverprint}
- {\let\stoptextoverprint\donothing}}
+ {\doifelse\@@clintent\v!overprint
+ {\glet\stoptextoverprint \dostopoverprint
+ \glet\starttextoverprint\dostartoverprint
+ \dostartoverprint}
+ {\glet\stoptextoverprint\donothing}}
\let\stoptextoverprint\donothing
diff --git a/Master/texmf-dist/tex/context/base/colo-ext.mkiv b/Master/texmf-dist/tex/context/base/colo-ext.mkiv
index 1c1f0d1afff..b17608f59c1 100644
--- a/Master/texmf-dist/tex/context/base/colo-ext.mkiv
+++ b/Master/texmf-dist/tex/context/base/colo-ext.mkiv
@@ -41,17 +41,63 @@
%D or independent. For the moment we only support independent overprint
%D handling. Here we deal with a per-document setting.
+\unexpanded\def\startcolorintent[#1]%
+ {\pushattribute\colorintentattribute
+ \dotriggercolorintent{#1}}
+
+\unexpanded\def\stopcolorintent
+ {\popattribute\colorintentattribute}
+
+\unexpanded\def\startoverprint{\startcolorintent[\v!overprint]}
+\unexpanded\def\stopoverprint {\stopcolorintent}
+
+\unexpanded\def\startknockout {\startcolorintent[\v!knockout ]}
+\unexpanded\def\stopknockout {\stopcolorintent}
+
+\let\starttextcolorintent\relax
+\let\stoptextcolorintent \relax
+
\setupcolors
[\c!overprint=\v!no]
-\def\starttextoverprint
- {\doifelse\@@cloverprint\v!yes
- {\let\stoptextoverprint\stopoverprintproperty\startoverprintproperty}
- {\let\stoptextoverprint\donothing}}
+\appendtoks
+ \dosettextcolorintent
+\to \everysetupcolors
+
+\def\dosettextcolorintent
+ {\doifnot\@@clintent\v!none
+ {\xdef\starttextcolorintent{\noexpand\dotriggercolorintent{\@@clintent}}%
+ \glet\dosettextcolorintent\relax
+ \dotriggercolorintent\@@clintent}}
+
+\appendtoks \starttextcolorintent \to \everystarttextproperties
+\appendtoks \stoptextcolorintent \to \everystoptextproperties
+
+\setupcolors[\c!intent=\v!none]
+
+% A goodie that replaces the startMPcolor hackery
+%
+% \definecolor[red-t] [r=1,t=0.5,a=1]
+% \definecolor[green-t][g=1,t=0.5,a=1]
+% \defineintermediatecolor[mycolora][0.5,red,green]
+% \defineintermediatecolor[mycolorb][0.5,red-t,green-t]
+% \starttext
+% test {\mycolora OEPS} test
+% test {\mycolorb OEPS} test
+% \stoptext
+
+\unexpanded\def\defineintermediatecolor
+ {\dotripleempty\dodefineintermediatecolor}
-\let\stoptextoverprint\donothing
+\def\dodefineintermediatecolor[#1][#2][#3]% \dotripleempty adds {} inside []
+ {\dododefineintermediatecolor[#1][#2][#3]}
-\appendtoks \starttextoverprint \to \everystarttextproperties
-\appendtoks \stoptextoverprint \to \everystoptextproperties
+\def\dododefineintermediatecolor[#1][#2,#3,#4][#5]%
+ {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi
+ \ctxlua{colors.defineintermediatecolor("#1","#2",
+ \thecolorattribute{#3},\thecolorattribute{#4},
+ \thetransparencyattribute{#3},\thetransparencyattribute{#4},
+ "#5",false,\iffreezecolors true\else false\fi)}% not global
+ \dodefinecolorcommand\setvalue{#1}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/colo-hex.mkii b/Master/texmf-dist/tex/context/base/colo-hex.mkii
index 7cef6e8a2ad..db67f184102 100644
--- a/Master/texmf-dist/tex/context/base/colo-hex.mkii
+++ b/Master/texmf-dist/tex/context/base/colo-hex.mkii
@@ -11,8 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifx\dodododefinecolor\undefined \else
- \endinput
+\ifdefined \hexcolorprefix
+ \expandafter \endinput
\fi
\writestatus{loading}{ConTeXt Color Macros / Hexadecimal}
diff --git a/Master/texmf-dist/tex/context/base/colo-hex.mkiv b/Master/texmf-dist/tex/context/base/colo-hex.mkiv
index dd8e039389b..f661b2445f1 100644
--- a/Master/texmf-dist/tex/context/base/colo-hex.mkiv
+++ b/Master/texmf-dist/tex/context/base/colo-hex.mkiv
@@ -23,4 +23,6 @@
% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part
% \stopMPpage
+\def\checkhexcolor[#1]{\doifcolorelse{#1}\donothing{\definecolor[#1][x=#1]}} % is this ok?
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/colo-ini.lua b/Master/texmf-dist/tex/context/base/colo-ini.lua
index a67df6a778e..342d6110dca 100644
--- a/Master/texmf-dist/tex/context/base/colo-ini.lua
+++ b/Master/texmf-dist/tex/context/base/colo-ini.lua
@@ -1,16 +1,19 @@
if not modules then modules = { } end modules ['colo-ini'] = {
version = 1.000,
- comment = "companion to colo-ini.tex",
+ comment = "companion to colo-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 concat = table.concat
-local format, gmatch, gsub, lower, match = string.format, string.gmatch, string.gsub, string.lower, string.match
+local format, gmatch, gsub, lower, match, find = string.format, string.gmatch, string.gsub, string.lower, string.match, string.find
local texsprint = tex.sprint
local ctxcatcodes = tex.ctxcatcodes
+local trace_define = false trackers.register("colors.define",function(v) trace_define = v end)
+
local settings_to_hash_strict = aux.settings_to_hash_strict
colors = colors or { }
@@ -23,89 +26,93 @@ local a_transparency = attributes.private('transparency')
local a_colorspace = attributes.private('colormodel')
local a_background = attributes.private('background')
-local a_l_c_template = "\\setevalue{(ca:%s)}{%s}" ..
- "\\setevalue{(cs:%s)}{\\dosetattribute{color}{%s}}"
-local a_g_c_template = "\\setxvalue{(ca:%s)}{%s}" ..
- "\\setxvalue{(cs:%s)}{\\dosetattribute{color}{%s}}"
-local f_l_c_template = "\\setvalue {(ca:%s)}{\\doinheritca{%s}}" ..
- "\\setvalue {(cs:%s)}{\\doinheritcs{%s}}"
-local f_g_c_template = "\\setgvalue{(ca:%s)}{\\doinheritca{%s}}" ..
- "\\setgvalue{(cs:%s)}{\\doinheritcs{%s}}"
-local r_l_c_template = "\\localundefine{(ca:%s)}" ..
- "\\localundefine{(cs:%s)}"
-local r_g_c_template = "\\globalundefine{(ca:%s)}" ..
- "\\globalundefine{(cs:%s)}"
-
-local a_l_t_template = "\\setevalue{(ta:%s)}{%s}" ..
- "\\setevalue{(ts:%s)}{\\dosetattribute{transparency}{%s}}"
-local a_g_t_template = "\\setxvalue{(ta:%s)}{%s}" ..
- "\\setxvalue{(ts:%s)}{\\dosetattribute{transparency}{%s}}"
-local f_l_t_template = "\\setvalue {(ta:%s)}{\\doinheritta{%s}}" ..
- "\\setvalue {(ts:%s)}{\\doinheritts{%s}}"
-local f_g_t_template = "\\setgvalue{(ta:%s)}{\\doinheritta{%s}}" ..
- "\\setgvalue{(ts:%s)}{\\doinheritts{%s}}"
-local r_l_t_template = "\\localundefine{(ta:%s)}" ..
- "\\localundefine{(ts:%s)}"
-local r_g_t_template = "\\globalundefine{(ta:%s)}" ..
- "\\globalundefine{(ts:%s)}"
+local register_color = colors.register
+local attributes_list = attributes.list
local function definecolor(name, ca, global)
if ca and ca > 0 then
if global then
- texsprint(ctxcatcodes,format(a_g_c_template, name, ca, name, ca))
+ if trace_define then
+ commands.writestatus("color","define global color '%s' with attribute: %s",name,ca)
+ end
+ context.colordefagc(name,ca)
else
- texsprint(ctxcatcodes,format(a_l_c_template, name, ca, name, ca))
+ if trace_define then
+ commands.writestatus("color","define local color '%s' with attribute: %s",name,ca)
+ end
+ context.colordefalc(name,ca)
end
else
if global then
- texsprint(ctxcatcodes,format(r_g_c_template, name, name))
+ context.colordefrgc(name)
else
- texsprint(ctxcatcodes,format(r_l_c_template, name, name))
+ context.colordefrlc(name)
end
end
end
+
local function inheritcolor(name, ca, global)
if ca and ca ~= "" then
if global then
- texsprint(ctxcatcodes,format(f_g_c_template, name, ca, name, ca))
+ if trace_define then
+ commands.writestatus("color","inherit global color '%s' with attribute: %s",name,ca)
+ end
+ context.colordeffgc(name,ca)
else
- texsprint(ctxcatcodes,format(f_l_c_template, name, ca, name, ca))
+ if trace_define then
+ commands.writestatus("color","inherit local color '%s' with attribute: %s",name,ca)
+ end
+ context.colordefflc(name,ca)
end
else
if global then
- texsprint(ctxcatcodes,format(r_g_c_template, name, name))
+ context.colordefrgc(name)
else
- texsprint(ctxcatcodes,format(r_l_c_template, name, name))
+ context.colordefrlc(name)
end
end
end
+
local function definetransparent(name, ta, global)
if ta and ta > 0 then
if global then
- texsprint(ctxcatcodes,format(a_g_t_template, name, ta, name, ta))
+ if trace_define then
+ commands.writestatus("color","define global transparency '%s' with attribute: %s",name,ta)
+ end
+ context.colordefagt(name,ta)
else
- texsprint(ctxcatcodes,format(a_l_t_template, name, ta, name, ta))
+ if trace_define then
+ commands.writestatus("color","define local transparency '%s' with attribute: %s",name,ta)
+ end
+ context.colordefalt(name,ta)
end
else
if global then
- texsprint(ctxcatcodes,format(r_g_t_template, name, name))
+ context.colordefrgt(name)
else
- texsprint(ctxcatcodes,format(r_l_t_template, name, name))
+ context.colordefrlt(name)
end
end
end
+
local function inherittransparent(name, ta, global)
if ta and ta ~= "" then
if global then
- texsprint(ctxcatcodes,format(f_g_t_template, name, ta, name, ta))
+ if trace_define then
+ commands.writestatus("color","inherit global transparency '%s' with attribute: %s",name,ta)
+ end
+ context.colordeffgt(name,ta)
else
- texsprint(ctxcatcodes,format(f_l_t_template, name, ta, name, ta))
+ if trace_define then
+ commands.writestatus("color","inherit local transparency '%s' with attribute: %s",name,ta)
+ end
+ context.colordefflt(name,ta)
end
else
if global then
- texsprint(ctxcatcodes,format(r_g_t_template, name, name))
+ context.colordefrgt(name)
else
- texsprint(ctxcatcodes,format(r_l_t_template, name, name))
+ context.colordefrlt(name)
end
end
end
@@ -144,6 +151,9 @@ local function do_registerspotcolor(parent,name,parentnumber,e,f,d,p)
if v then
local kind = colors.default -- else problems with shading etc
if kind == 1 then kind = v[1] end
+ if e and e ~= "" then
+ registrations.spotcolorname(parent,e) -- before registration of the color
+ end
if kind == 2 then -- name noffractions names p's r g b
registrations.grayspotcolor(parent,f,d,p,v[2])
elseif kind == 3 then
@@ -151,9 +161,6 @@ local function do_registerspotcolor(parent,name,parentnumber,e,f,d,p)
elseif kind == 4 then
registrations.cmykspotcolor(parent,f,d,p,v[6],v[7],v[8],v[9])
end
- if e and e ~= "" then
- registrations.spotcolorname(parent,e)
- end
end
registered[parentnumber] = true
end
@@ -178,45 +185,64 @@ local function do_registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- sa
end
function colors.definesimplegray(name,s)
- return colors.register(name,'gray',s) -- we still need to get rid of 'color'
+ return register_color(name,'gray',s) -- we still need to get rid of 'color'
end
function colors.defineprocesscolor(name,str,global,freeze) -- still inconsistent color vs transparent
- local r = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so)
- local t = (r and { h = r }) or settings_to_hash_strict(str)
- if t then
- if t.h then
- local r, g, b = match(t.h .. "000000","(..)(..)(..)") -- watch the 255
- definecolor(name, colors.register(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255 ), global)
- elseif t.r or t.g or t.b then
- definecolor(name, colors.register(name,'rgb', tonumber(t.r) or 0, tonumber(t.g) or 0, tonumber(t.b) or 0 ), global)
- elseif t.c or t.m or t.y or t.k then
- definecolor(name, colors.register(name,'cmyk',tonumber(t.c) or 0, tonumber(t.m) or 0, tonumber(t.y) or 0, tonumber(t.k) or 0), global)
+ local x = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so)
+ if x then
+ local r, g, b = match(x .. "000000","(..)(..)(..)") -- watch the 255
+ definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global)
+ else
+ local settings = settings_to_hash_strict(str)
+ if settings then
+ local r, g, b = settings.r, settings.g, settings.b
+ if r or g or b then
+ definecolor(name, register_color(name,'rgb', tonumber(r) or 0, tonumber(g) or 0, tonumber(b) or 0), global)
+ else
+ local c, m, y, k = settings.c, settings.m, settings.y, settings.k
+ if c or m or y or b then
+ definecolor(name, register_color(name,'cmyk',tonumber(c) or 0, tonumber(m) or 0, tonumber(y) or 0, tonumber(k) or 0), global)
+ else
+ local h, s, v = settings.h, settings.s, settings.v
+ if v then
+ r, g, b = colors.hsvtorgb(tonumber(h) or 0, tonumber(s) or 1, tonumber(v) or 1) -- maybe later native
+ definecolor(name, register_color(name,'rgb',r,g,b), global)
+ else
+ local x = settings.x or h
+ if x then
+ r, g, b = match(x .. "000000","(..)(..)(..)") -- watch the 255
+ definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global)
+ else
+ definecolor(name, register_color(name,'gray',tonumber(s) or 0), global)
+ end
+ end
+ end
+ end
+ local a, t = settings.a, settings.t
+ if a and t then
+ definetransparent(name, transparencies.register(name,transparent[a] or tonumber(a) or 1,tonumber(t) or 1), global)
+ elseif colors.couple then
+ -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up
+ definetransparent(name, 0, global) -- can be sped up
+ end
+ elseif freeze then
+ local ca = attributes_list[a_color] [str]
+ local ta = attributes_list[a_transparency][str]
+ if ca then
+ definecolor(name, ca, global)
+ end
+ if ta then
+ definetransparent(name, ta, global)
+ end
else
- definecolor(name, colors.register(name,'gray',tonumber(t.s) or 0), global)
- end
- if t.a and t.t then
- definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global)
- elseif colors.couple then
- -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up
- definetransparent(name, 0, global) -- can be sped up
+ inheritcolor(name, str, global)
+ inherittransparent(name, str, global)
+ -- if global and str ~= "" then -- For Peter Rolf who wants access to the numbers in Lua. (Currently only global is supported.)
+ -- attributes_list[a_color] [name] = attributes_list[a_color] [str] or attributes.unsetvalue -- reset
+ -- attributes_list[a_transparency][name] = attributes_list[a_transparency][str] or attributes.unsetvalue
+ -- end
end
- elseif freeze then
- local ca = attributes.list[a_color] [str]
- local ta = attributes.list[a_transparency][str]
- if ca then
- definecolor(name, ca, global)
- end
- if ta then
- definetransparent(name, ta, global)
- end
- else
- inheritcolor(name, str, global)
- inherittransparent(name, str, global)
- -- if global and str ~= "" then -- For Peter Rolf who wants access to the numbers in Lua. (Currently only global is supported.)
- -- attributes.list[a_color] [name] = attributes.list[a_color] [str] or attributes.unsetvalue -- reset
- -- attributes.list[a_transparency][name] = attributes.list[a_transparency][str] or attributes.unsetvalue
- -- end
end
end
@@ -226,19 +252,20 @@ function colors.isblack(ca) -- maybe commands
end
function colors.definespotcolor(name,parent,str,global)
- if parent == "" or parent:find("=") then
+ if parent == "" or find(parent,"=") then
colors.registerspotcolor(name, parent)
elseif name ~= parent then
- local cp = attributes.list[a_color][parent]
+ local cp = attributes_list[a_color][parent]
if cp then
local t = settings_to_hash_strict(str)
if t then
- t.p = tonumber(t.p) or 1
- do_registerspotcolor(parent, name, cp, t.e, 1, "", t.p) -- p not really needed, only diagnostics
+ local tp = tonumber(t.p) or 1
+ do_registerspotcolor(parent, name, cp, t.e, 1, "", tp) -- p not really needed, only diagnostics
if name and name ~= "" then
- definecolor(name, colors.register(name,'spot', parent, 1, "", t.p), true)
- if t.a and t.t then
- definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global)
+ definecolor(name, register_color(name,'spot', parent, 1, "", tp), true)
+ local ta, tt = t.a, t.t
+ if ta and tt then
+ definetransparent(name, transparencies.register(name,transparent[ta] or tonumber(ta) or 1,tonumber(tt) or 1), global)
elseif colors.couple then
--~ definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up
definetransparent(name, 0, global) -- can be sped up
@@ -250,7 +277,7 @@ function colors.definespotcolor(name,parent,str,global)
end
function colors.registerspotcolor(parent, str)
- local cp = attributes.list[a_color][parent]
+ local cp = attributes_list[a_color][parent]
if cp then
local e = ""
if str then
@@ -275,11 +302,11 @@ function colors.definemultitonecolor(name,multispec,colorspec,selfspec)
dd, pp, nn = concat(dd,','), concat(pp,','), concat(nn,'_')
local parent = gsub(lower(nn),"[^%d%a%.]+","_")
colors.defineprocesscolor(parent,colorspec..","..selfspec,true,true)
- local cp = attributes.list[a_color][parent]
+ local cp = attributes_list[a_color][parent]
if cp then
do_registerspotcolor(parent, name, cp, "", nof, dd, pp)
do_registermultitonecolor(parent, name, cp, "", nof, dd, pp)
- definecolor(name, colors.register(name, 'spot', parent, nof, dd, pp), true)
+ definecolor(name, register_color(name, 'spot', parent, nof, dd, pp), true)
local t = settings_to_hash_strict(selfspec)
if t and t.a and t.t then
definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global)
@@ -350,7 +377,7 @@ function colors.formatgray(ca,separator)
return format("%0.3f",(cv and cv[2]) or 0)
end
-function colors.colorcomponents(ca)
+function colors.colorcomponents(ca) -- return list
local cv = colors.value(ca)
if cv then
local model = cv[1]
@@ -405,3 +432,49 @@ function colors.spotcolorvalue(ca,default)
end
return tostring(v)
end
+
+-- experiment (a bit of a hack, as we need to get the attribute number)
+
+local min = math.min
+
+-- a[b,c] -> b+a*(c-b)
+
+local function f(one,two,i,fraction)
+ local o, t = one[i], two[i]
+ local otf = o + fraction * (t - o)
+ if otf > 1 then
+ otf = 1
+ end
+ return otf
+end
+
+function colors.defineintermediatecolor(name,fraction,c_one,c_two,a_one,a_two,specs,global,freeze)
+ fraction = tonumber(fraction) or 1
+ local one, two = colors.value(c_one), colors.value(c_two)
+ if one and two then
+ local csone, cstwo = one[1], two[1]
+ if csone == cstwo then
+ -- actually we can set all 8 values at once here but this is cleaner as we avoid
+ -- problems with weighted gray conversions and work with original values
+ local ca
+ if csone == 2 then
+ ca = register_color(name,'gray',f(one,two,2,fraction))
+ elseif csone == 3 then
+ ca = register_color(name,'rgb',f(one,two,3,fraction),f(one,two,4,fraction),f(one,two,5,fraction))
+ elseif csone == 4 then
+ ca = register_color(name,'cmyk',f(one,two,6,fraction),f(one,two,7,fraction),f(one,two,8,fraction),f(one,two,9,fraction))
+ else
+ ca = register_color(name,'gray',f(one,two,2,fraction))
+ end
+ definecolor(name,ca,global,freeze)
+ end
+ end
+ local one, two = transparencies.value(a_one), transparencies.value(a_two)
+ local t = settings_to_hash_strict(specs)
+ local ta = tonumber((t and t.a) or (one and one[1]) or (two and two[1]))
+ local tt = tonumber((t and t.t) or (one and two and f(one,two,2,fraction)))
+ if ta and tt then
+--~ print(ta,tt)
+ definetransparent(name,transparencies.register(name,ta,tt),global)
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/colo-ini.mkiv b/Master/texmf-dist/tex/context/base/colo-ini.mkiv
index e7a84980578..1bceb5aa70a 100644
--- a/Master/texmf-dist/tex/context/base/colo-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/colo-ini.mkiv
@@ -59,6 +59,7 @@
\newif\ifSPOTsupported
\newif\ifpreferGRAY
\newif\ifGRAYprefered
+\newif\ifconvertGRAY \convertGRAYtrue
\newif\ifreduceCMYK
\newif\ifconverttoGRAY
\newif\ifweightGRAY \weightGRAYtrue
@@ -109,11 +110,11 @@
%D
%D \getbuffer \typebuffer
-\def\definecolor {\dodoubleargument\dodefinecolor}
-\def\defineglobalcolor {\dodoubleargument\dodefineglobalcolor}
-\def\definenamedcolor {\dodoubleargument\dodefinenamedcolor}
-\def\definespotcolor {\dotripleargument\dodefinespotcolor}
-\def\definemultitonecolor{\doquadrupleempty\dodefinemultitonecolor}
+\unexpanded\def\definecolor {\dodoubleargument\dodefinecolor}
+\unexpanded\def\defineglobalcolor {\dodoubleargument\dodefineglobalcolor}
+\unexpanded\def\definenamedcolor {\dodoubleargument\dodefinenamedcolor}
+\unexpanded\def\definespotcolor {\dotripleargument\dodefinespotcolor}
+\unexpanded\def\definemultitonecolor{\doquadrupleempty\dodefinemultitonecolor}
%D \macros
%D {startcolor,stopcolor,
@@ -143,15 +144,15 @@
\unexpanded\def\color [#1]{\groupedcommand{\doactivatecolor{#1}}{}}
\unexpanded\def\startcolor [#1]{\begingroup\doactivatecolor{#1}}
\unexpanded\def\stopcolor {\endgroup}
-\unexpanded\def\graycolor [#1]{\groupedcommand{\setcolormodel{gray}\getvalue{#1}}{}}
+\unexpanded\def\graycolor [#1]{\groupedcommand{\dosetcolormodel{gray}\getvalue{#1}}{}}
\unexpanded\def\colored [#1]{\groupedcommand{\definecolor[@colored@][#1]\doactivatecolor{@colored@}}{}}
\unexpanded\def\fastcolored [#1]#2{\begingroup\dodefinefastcolor[@colored@][#1]\doactivatecolor{@colored@}#2\endgroup}
\def\predefinecolor [#1]{\flushatshipout{\hbox{\color[#1]{}}}}
\def\predefineindexcolor[#1]{\flushatshipout{\hbox{\color[#1]{}}}}
- \def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}
- \def\stopcolorpage {\stopcolor}
- \def\startraster [#1]{\dosetrastercolor{#1}}
- \def\stopraster {}
+ \unexpanded\def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}
+ \unexpanded\def\stopcolorpage {\stopcolor}
+ \unexpanded\def\startraster [#1]{\dosetrastercolor{#1}}
+ \unexpanded\def\stopraster {}
\def\raster [#1]{\groupedcommand{\dosetrastercolor{#1}}{}}
\def\faststartcolor [#1]{\doactivatecolor{#1}}
\def\faststopcolor {}
@@ -159,11 +160,30 @@
\let\grey\graycolor
+%D Stacking:
+
+% \colormodelattribute \colorattribute \transparencyattribute
+
+\newcount\currentcolornesting
+
+\unexpanded\def\pushcolor[#1]%
+ {\global\advance\currentcolornesting\plusone
+ \expandafter\edef\csname\??cl:s:\number\currentcolornesting\endcsname
+ {\attribute\colormodelattribute \the\attribute\colormodelattribute
+ \attribute\colorattribute \the\attribute\colorattribute
+ \attribute\transparencyattribute\the\attribute\transparencyattribute
+ \space}% stack
+ \doactivatecolor{#1}}
+
+\unexpanded\def\popcolor
+ {\csname\??cl:s:\number\currentcolornesting\endcsname
+ \global\advance\currentcolornesting\minusone}
+
%D \macros
%D {startcurrentcolor,stopcurrentcolor}
-\def\startcurrentcolor{\startcolor[\outercolorname]}
-\def\stopcurrentcolor {\stopcolor}
+\unexpanded\def\startcurrentcolor{\startcolor[\outercolorname]}
+\unexpanded\def\stopcurrentcolor {\stopcolor}
%D \macros
%D {setupcolor}
@@ -188,7 +208,7 @@
\let\colorstyle\empty
-\def\setupcolor
+\unexpanded\def\setupcolor
{\dosingleargument\dosetupcolor}
\def\dosetupcolor[#1]%
@@ -213,7 +233,7 @@
%D
%D This command numbers to names:
-\def\definetransparency
+\unexpanded\def\definetransparency
{\dodoubleargument\dodefinetransparency}
\unexpanded\def\setupcolors
@@ -221,6 +241,8 @@
\let\showcolormessage\gobblethreearguments
+\newtoks\everysetupcolors
+
\def\dosetupcolors[#1]% some no longer make sense in MkIV
{\getparameters[\??cl][#1]%
\doifelse\@@clspot\v!yes
@@ -248,9 +270,12 @@
{\ifMPspotcolors \showcolormessage\m!colors {9}{\v!mp\v!spot}\MPspotcolorsfalse \fi}
{\ifMPspotcolors \else\showcolormessage\m!colors{10}{\v!mp\v!spot}\MPspotcolorstrue \fi}%
\preferGRAYfalse
+ \convertGRAYtrue
\processaction
[\@@clconversion]
[ \v!yes=>\preferGRAYtrue,
+ \v!no=>\convertGRAYfalse,
+ \v!never=>\convertGRAYfalse,
\v!always=>\preferGRAYtrue\RGBsupportedfalse\CMYKsupportedfalse]%
\ifRGBsupported
\converttoGRAYfalse
@@ -273,7 +298,7 @@
{\incolorfalse\forcegrayMPcolorstrue}%
{\ifincolor\else\showcolormessage\m!colors1\colorstyle\fi\incolortrue\let\@@clstate\v!start}%
\dosetupcolormodel
- \initializemaintextcolor}
+ \the\everysetupcolors}
%D In this documentation we will not go into too much details
%D on palets. Curious users can find more information on this
@@ -340,7 +365,7 @@
%D This saves us some typing in for instance the modules that
%D deal with pretty verbatim typesetting.
-\def\definepalet
+\unexpanded\def\definepalet
{\dodoubleargument\dodefinepalet}
\def\dodefinepalet[#1][#2]%
@@ -383,7 +408,7 @@
\let\currentpalet\empty
-\def\setuppalet
+\unexpanded\def\setuppalet
{\dosingleempty\dosetuppalet}
\def\dosetuppalet[#1]%
@@ -447,7 +472,7 @@
%D defining each color separate, it also loads faster and takes
%D less bytes.
-\def\definecolorgroup
+\unexpanded\def\definecolorgroup
{\dotripleempty\dodefinecolorgroup}
\def\dododefinecolorgroupgray [#1][#2:#3]{\definecolor [#1:\the\colorcount][s=#2]}
@@ -689,32 +714,43 @@
\ifx\currentcolormodel\undefined \newcount\currentcolormodel \fi
-\def\setcolormodel#1%
- {\showcolormessage\m!colors1{#1}%
- \currentcolormodel\ctxlua{tex.print(colors.setmodel('#1',\ifweightGRAY true\else false\fi))}%
- \dosetattribute{colormodel}{\the\currentcolormodel}}
+% \def\setcolormodel#1%
+% {\showcolormessage\m!colors1{#1}%
+% \dosetcolormodel{#1}}
+
+\def\dosetcolormodel#1% no message
+ {\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1',\ifweightGRAY true\else false\fi))}%
+ \attribute\colormodelattribute\currentcolormodel}
+
+\dosetcolormodel{all}
-\setcolormodel{all}
\def\dosetupcolormodel
{\ifincolor
\ifRGBsupported
\ifCMYKsupported
- \setcolormodel{all}%
+ \dosetcolormodel{all}%
\else
- \setcolormodel{rgb}%
+ \dosetcolormodel{rgb}%
\fi
\else
\ifCMYKsupported
- \setcolormodel{cmyk}%
+ \dosetcolormodel{cmyk}%
\else
- \setcolormodel{gray}%
+ \ifconvertGRAY
+ \dosetcolormodel{gray}%
+ \else
+ \dosetcolormodel{none}%
+ \fi
\fi
\fi
\else
- \setcolormodel{gray}%
- \fi
- }%\aftergroup\dosetupcolormodel}
+ \ifconvertGRAY
+ \dosetcolormodel{gray}%
+ \else
+ \dosetcolormodel{none}%
+ \fi
+ \fi}
\appendtoks
\dosetupcolormodel
@@ -749,7 +785,7 @@
\def\doactivatecolor
{\ifproductionrun
- \ctxlua{colors.enabled=true transparencies.enabled=true}% not that efficient but at least robust
+ \ctxlua{colors.enable() transparencies.enable()}% not that efficient but at least robust
\let\doactivatecolor\normaldoactivatecolor
\expandafter\doactivatecolor
\else
@@ -802,7 +838,7 @@
\ifx\@@rastervalue\empty
\let\@@rastervalue\@@rsscreen
\fi
- \dosetattribute\s!color{\ctxlua{tex.sprint(colors.definesimplegray("_raster_",\@@rastervalue))}}}
+ \attribute\colorattribute\ctxlua{tex.sprint(colors.definesimplegray("_raster_",\@@rastervalue))}\relax}
\def\dodefinefastcolor[#1][#2]% still not fast but ok
{\ctxlua{colors.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}%
@@ -874,19 +910,14 @@
\def\defaulttextcolor {black}
\def\@@themaintextcolor{themaintextcolor}
-\appendtoks\deactivatecolor\to\everybeforeoutput
-
-\def\startregistercolor[#1]% probably obsolete
- {\doifelsenothing{#1}
- {\let\stopregistercolor\relax}
- {\edef\stopregistercolor
- {\dosetattribute\s!color {\dogetattribute\s!color }%
- \dosetattribute\s!transparency{\dogetattribute\s!transparency}}%
- \doactivatecolor{#1}}}
+\appendtoks
+ \deactivatecolor
+ \ifx\maintextcolor\empty\else\doactivatecolor\maintextcolor\fi
+\to \everybeforeoutput
\def\registermaintextcolor{\ctxlua{colors.main = \thecolorattribute\maintextcolor}}
-\def\starttextcolor[#1]%
+\unexpanded\def\starttextcolor[#1]%
{\doifsomething{#1}
{\definecolor[\@@themaintextcolor][#1]%
\let\maintextcolor\@@themaintextcolor
@@ -904,6 +935,7 @@
\registermaintextcolor}
\appendtoks \initializemaintextcolor \to \everyjob
+\appendtoks \initializemaintextcolor \to \everysetupcolors
\def\dodefinepaletcolor#1#2#3%
{\doifassignmentelse{#3}% \definepalet[test][xx={y=.4}]
@@ -927,6 +959,23 @@
\def\doinheritta#1{\csname(ta:\ifcsname(ta:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ta:#1)\endcsname#1\fi\fi)\endcsname}
\def\doinheritts#1{\csname(ts:\ifcsname(ts:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ts:#1)\endcsname#1\fi\fi)\endcsname}
+%D Low level defs:
+
+\def\colordefalc#1#2{\setevalue{(ca:#1)}{#2}\setvalue {(cs:#1)}{\attribute\colorattribute #2 }}
+\def\colordefagc#1#2{\setxvalue{(ca:#1)}{#2}\setvalue {(cs:#1)}{\attribute\colorattribute #2 }}
+\def\colordefalt#1#2{\setevalue{(ta:#1)}{#2}\setvalue {(ts:#1)}{\attribute\transparencyattribute#2 }}
+\def\colordefagt#1#2{\setxvalue{(ta:#1)}{#2}\setgvalue{(ts:#1)}{\attribute\transparencyattribute#2 }}
+
+\def\colordefflc#1#2{\setvalue {(ca:#1)}{\doinheritca{#2}}\setvalue {(cs:#1)}{\doinheritcs{#2}}}
+\def\colordeffgc#1#2{\setgvalue{(ca:#1)}{\doinheritca{#2}}\setvalue {(cs:#1)}{\doinheritcs{#2}}}
+\def\colordefflt#1#2{\setvalue {(ta:#1)}{\doinheritta{#2}}\setvalue {(ts:#1)}{\doinheritts{#2}}}
+\def\colordeffgt#1#2{\setgvalue{(ta:#1)}{\doinheritta{#2}}\setgvalue{(ts:#1)}{\doinheritts{#2}}}
+
+\def\colordefrlc #1{\localundefine {(ca:#1)}\localundefine {(cs:#1)}}
+\def\colordefrgc #1{\globalundefine{(ca:#1)}\globalundefine{(cs:#1)}}
+\def\colordefrlt #1{\localundefine {(ta:#1)}\localundefine {(ts:#1)}}
+\def\colordefrgt #1{\globalundefine{(ta:#1)}\globalundefine{(ts:#1)}}
+
%D \macros
%D {colorvalue, grayvalue}
%D
diff --git a/Master/texmf-dist/tex/context/base/colo-new.mkii b/Master/texmf-dist/tex/context/base/colo-new.mkii
deleted file mode 100644
index 5413d7a1208..00000000000
--- a/Master/texmf-dist/tex/context/base/colo-new.mkii
+++ /dev/null
@@ -1,1857 +0,0 @@
-%D \module
-%D [ file=colo-ini,
-%D version=1997.04.01,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-\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}
-
-\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
- {#1\addtocommalist{#5}\colorlist % optional
- \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
- \doglobal\addtocommalist{#1}\colorlist % optional
- \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
- \doglobal\addtocommalist{#1}\colorlist % optional
- \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}
-
-%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 Slow but ok \unknown
-
-\def\colorcomponents#1%
- {\startnointerference
- \localcolortrue
- \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
- \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
- \thecolorcomponents}
-
-%D \macros
-%D {everyshapebox}
-%D
-%D A terrible hack, needed because we cannot have marks in
-%D shape boxes.
-
-\appendtoks \localcolortrue \to \everyshapebox
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/colo-new.mkiv b/Master/texmf-dist/tex/context/base/colo-new.mkiv
deleted file mode 100644
index d054095fe97..00000000000
--- a/Master/texmf-dist/tex/context/base/colo-new.mkiv
+++ /dev/null
@@ -1,331 +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 / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-\chardef\colorversion=2
-
-% todo: palets in definecolor
-% todo: {\red xx} vs \red{xx}
-
-% check: registerusedspotcolors
-% check: registerusedcolorchannels
-% check: \currentcolorname
-% check: \outercolorname
-% check: \chardef\currentcolorchannel=0
-% check: \startcolormode
-% check: \newif\iffilterspotcolor \filterspotcolorfalse
-% check: \newif\ifdoingspotcolor \doingspotcolorfalse
-% check: \registercolorchannel
-
-% \def\mptexcolor#1{"\dogetattributeid\s!color \somecolorattribute{#1} A"}
-%
-% \startMPpage
-% fill fullcircle scaled 10cm ;
-% fill fullcircle scaled 5cm withprescript \mptexcolor{red} withpostscript \mptexcolor{black} ;
-% fill fullcircle scaled 3cm ;
-% draw btex test etex withprescript \mptexcolor{blue} ;
-% \stopMPpage
-
-\registerctxluafile{colo-new}{1.000}
-
-\ifx\currentcolormodel\undefined \newcount\currentcolormodel \fi
-
-\def\setcolormodel#1%
- {\currentcolormodel\ctxlua{tex.print(colors.setmodel('colormodel','#1'))}%
- \dosetattribute{colormodel}{\the\currentcolormodel}}
-
-\setcolormodel{all}
-
-\def\dosetupcolormodel
- {\ifincolor
- \ifRGBsupported
- \ifCMYKsupported
- \setcolormodel{all}%
- \else
- \setcolormodel{rgb}%
- \fi
- \else
- \ifCMYKsupported
- \setcolormodel{cmyk}%
- \else
- \setcolormodel{gray}%
- \fi
- \fi
- \else
- \setcolormodel{gray}%
- \fi}
-
-\appendtoks
- \dosetupcolormodel
-\to \everyjob
-
-% Currently in mkiv transparency is implemented independent of color. This costs
-% a bit more processing time but gives the possibility to apply transparency
-% independently in the future. Is this useful? If not we may as well combine them
-% again in the future. By coupling we are downward compatible. When we decouple we
-% need to do more tricky housekeeping (e.g. persist color independent transparencies
-% when color bound ones are nil.
-
-% Since we couple definitions, we could stick to one test. Todo. Same for mpcolor.
-
-% \def\doactivatecolor#1% : in currentpalet, maybe not, ugly
-% {\ifcsname(cs:\currentpalet#1)\endcsname
-% \csname(cs:\currentpalet#1)\endcsname
-% \csname(ts:\currentpalet#1)\endcsname
-% \else
-% \csname(cs:#1)\endcsname
-% \csname(ts:#1)\endcsname
-% \fi}
-
-% \def\doactivatecolor#1% : in currentpalet, maybe not, ugly
-% {\csname(cs:\ifcsname(cs:\currentpalet#1)\endcsname\currentpalet\fi#1)\endcsname}
-% \csname(ts:\ifcsname(ts:\currentpalet#1)\endcsname\currentpalet\fi#1)\endcsname}
-%
-% more robust test, else we get \relaxed non-colors which may confuse e.g. mpcolor
-
-\letvalue{(cs:-}\empty
-\letvalue{(ts:-}\empty
-
-% \def\doactivatecolor#1% : in currentpalet, maybe not, ugly
-% {\csname(cs:\ifcsname(cs:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(cs:#1)\endcsname#1\else-\fi\fi)\endcsname
-% \csname(ts:\ifcsname(ts:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ts:#1)\endcsname#1\else-\fi\fi)\endcsname}
-
-\def\doactivatecolor#1% : in currentpalet, maybe not, ugly
- {\ifcsname(cs:\currentpalet#1)\endcsname
- \csname(cs:\currentpalet#1)\endcsname
- \csname(ts:\currentpalet#1)\endcsname
- \else\ifcsname(cs:#1)\endcsname
- \csname(cs:#1)\endcsname
- \csname(ts:#1)\endcsname
- \fi\fi}
-
-\let\normaldoactivatecolor\doactivatecolor
-
-% if it becomes a bottleneck we can set up a more complex system with one shared
-% attribute for colorspace, color and transparency
-
-\def\doactivatecolor
- {\ifproductionrun
- \ctxlua{colors.enabled=true transparencies.enabled=true}% not that efficient but at least robust
- \let\doactivatecolor\normaldoactivatecolor
- \expandafter\doactivatecolor
- \else
- \expandafter\normaldoactivatecolor
- \fi}
-
-\def\deactivatecolor
- {\doresetattribute\s!color
- \doresetattribute\s!transparency}
-
-\def\dodefinecolorcommand#1#2%
- {\unexpanded#1{#2}{\doactivatecolor{#2}}}
-
-\def\dodefinecolor[#1][#2]%
- {\addtocommalist{#1}\colorlist
- \ctxlua{ctx.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}%
- \dodefinecolorcommand\setvalue{#1}}
-
-\def\dodefineglobalcolor[#1][#2]%
- {\doglobal\addtocommalist{#1}\colorlist
- \ctxlua{ctx.defineprocesscolor("#1","#2",true,\iffreezecolors true\else false\fi)}%
- \dodefinecolorcommand\setgvalue{#1}}
-
-\def\dodefinenamedcolor[#1][#2]%
- {\doglobal\addtocommalist{#1}\colorlist
- \ctxlua{ctx.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}%
- \dodefinecolorcommand\setvalue{#1}}
-
-\def\dodefinespotcolor[#1][#2][#3]%
- {\doglobal\addtocommalist{#1}\colorlist % optional
- \doglobal\addtocommalist{#2}\allspotcolors
- \ctxlua{ctx.definespotcolor("#1","#2","#3",true)}%
- \dodefinecolorcommand\setxvalue{#1}}
-
-\def\dodefinemultitonecolor[#1][#2][#3][#4]%
- {\ctxlua{ctx.definemultitonecolor("#1","#2","#3","#4",true)}%
- \dodefinecolorcommand\setxvalue{#1}}
-
-\def\dodefinetransparency[#1][#2]%
- {\ctxlua{ctx.definetransparency("#1",#2)}}
-
-\def\dosetrastercolor#1% slow, we need a fast one
- {\edef\@@rastervalue{#1}%
- \ifx\@@rastervalue\empty
- \let\@@rastervalue\@@rsscreen
- \fi
- \dosetattribute\s!color{\ctxlua{tex.sprint(ctx.definesimplegray("_raster_",\@@rastervalue))}}}
-
-\def\doifcolorelse#1%
- {\ifcsname(ca:\currentpalet#1)\endcsname
- \@EA\firstoftwoarguments
- \else\ifcsname(ca:#1)\endcsname
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\secondoftwoarguments
- \fi\fi}
-
-\def\doifcolor#1%
- {\ifcsname(ca:\currentpalet#1)\endcsname
- \@EA\firstofoneargument
- \else\ifcsname(ca:#1)\endcsname
- \@EAEAEA\firstofoneargument
- \else
- \@EAEAEA\gobbleoneargument
- \fi\fi}
-
-% currentcolor, then we can push pop in register
-
- \def\switchtocolor [#1]{\getvalue{#1}}
-\unexpanded\def\color [#1]{\groupedcommand{\doactivatecolor{#1}}{}}
-\unexpanded\def\startcolor [#1]{\begingroup\doactivatecolor{#1}}
-\unexpanded\def\stopcolor {\endgroup}
-\unexpanded\def\graycolor [#1]{\groupedcommand{\setcolormodel{gray}\getvalue{#1}}{}}
- \def\predefinecolor [#1]{\flushatshipout{\hbox{\color[#1]{}}}}
- \def\predefineindexcolor[#1]{\flushatshipout{\hbox{\color[#1]{}}}}
- \def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}
- \def\stopcolorpage {\stopcolor}
- \def\localstartraster [#1]{\dosetrastercolor{#1}}
- \def\localstopraster {}
- \def\startraster [#1]{\dosetrastercolor{#1}}
- \def\stopraster {}
- \def\raster [#1]{\groupedcommand{\dosetrastercolor{#1}}{}}
- \def\faststartcolor [#1]{\doactivatecolor{#1}}
- \def\faststopcolor {}
-
-\def\startregistercolor[#1]%
- {\doifelsenothing{#1}
- {\let\stopregistercolor\relax}
- {\edef\stopregistercolor
- {\dosetattribute\s!color {\dogetattribute\s!color }%
- \dosetattribute\s!transparency{\dogetattribute\s!transparency}}%
- \doactivatecolor{#1}}}
-
-\let\resynccolor \relax % ?
-\let\pushcolor \relax
-\let\popcolor \relax
-\let\popsplitcolor\relax
-
-\def\restorecolormode
- {\ifincolor
- \deactivatecolor
- \ifx\maintextcolor\empty \else
- \doactivatecolor\maintextcolor
- \fi
- \fi}
-
-\def\pushpostponedpagecolor
- {\edef\savedtopofpagecolor{\topofpagecolor}%
- \doifsomething\savedtopofpagecolor\restorecolormode}
-
-\def\poppostponedpagecolor
- {\doifsomething\savedtopofpagecolor\doactivatecolor\savedtopofpagecolor}
-
-% \def\pushcolor
-% {\edef\popcolor
-% {\dosetattribute\s!color {\dogetattribute\s!color }%
-% \dosetattribute\s!transparency{\dogetattribute\s!transparency}}%
-% \let\popsplitcolor\popcolor
-% \deactivatecolor}
-
-\appendtoks\deactivatecolor\to\everybeforeoutput % maybe we don't need push pop now
-
-\def\startregistercolor[#1]%
- {\doifelsenothing{#1}
- {\let\stopregistercolor\relax}
- {\edef\stopregistercolor
- {\dosetattribute\s!color {\dogetattribute\s!color }%
- \dosetattribute\s!transparency{\dogetattribute\s!transparency}}%
- \doactivatecolor{#1}}}
-
-\let\grey \graycolor
-\let\localstartcolor \startcolor
-\let\localstopcolor \stopcolor
-\let\globalstartcolor\startcolor
-\let\globalstopcolor \stopcolor
-
-\def\registermaintextcolor{\ctxlua{colors.main = \thecolorattribute\maintextcolor}}
-
-\def\starttextcolor[#1]%
- {\doifsomething{#1}
- {\definecolor[\@@themaintextcolor][#1]%
- \let\maintextcolor\@@themaintextcolor
- \doactivatecolor\maintextcolor
- \registermaintextcolor}}
-
-\let\stoptextcolor\relax
-
-\def\initializemaintextcolor
- {\doifelsenothing\@@cltextcolor
- {\definecolor[\@@themaintextcolor][\defaulttextcolor]}
- {\definecolor[\@@themaintextcolor][\@@cltextcolor]}%
- \let\maintextcolor\@@themaintextcolor
- \doactivatecolor\maintextcolor
- \registermaintextcolor}
-
-\appendtoks \initializemaintextcolor \to \everyjob
-
-\def\localstarttextcolor{\expanded{\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}}
-\let\localstoptextcolor \stopcolor
-\let\restoretextcolor \firstofoneargument
-
-\def\dodefinepaletcolor#1#2#3%
- {\doifassignmentelse{#3}% \definepalet[test][xx={y=.4}]
- {\definecolor[\??pa#1:#2][#3]%
- \iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{(cs:#1:#2)}{\csname(cs:\??pa#1:#2)\endcsname}%
- \iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{(ca:#1:#2)}{\csname(ca:\??pa#1:#2)\endcsname}}
- {\doifdefinedelse{(cs:#3)}% \definepalet[test][xx=green]
- {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{(cs:#1:#2)}{\csname(cs:#3)\endcsname}%
- \iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{(ca:#1:#2)}{\csname(ca:#3)\endcsname}}
- {\letvalue{(cs:#1:#2)}\undefined
- \letvalue{(ca:#1:#2)}\undefined}}}
-
-\setvalue{(cs:)}{} \setvalue{(ca:)}{0}
-\setvalue{(ts:)}{} \setvalue{(ta:)}{0}
-
-\def\doinheritca#1{\csname(ca:\ifcsname(ca:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ca:#1)\endcsname#1\fi\fi)\endcsname}
-\def\doinheritcs#1{\csname(cs:\ifcsname(cs:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(cs:#1)\endcsname#1\fi\fi)\endcsname}
-\def\doinheritta#1{\csname(ta:\ifcsname(ta:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ta:#1)\endcsname#1\fi\fi)\endcsname}
-\def\doinheritts#1{\csname(ts:\ifcsname(ts:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ts:#1)\endcsname#1\fi\fi)\endcsname}
-
-\def\MPcolor#1{\ctxlua{tex.sprint(ctx.mpcolor(\number\currentcolormodel,\number\doinheritca{#1},\number\doinheritta{#1}))}}
-
-\def\currentcolorname{\s!black} % todo
-\def\outercolorname {\s!black} % todo
-
-\def\thecolorattribute #1{\number\csname(ca:\ifcsname(ca:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ca:#1)\endcsname#1\fi\fi)\endcsname}
-\def\thetransparencyattribute#1{\number\csname(ta:\ifcsname(ta:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ta:#1)\endcsname#1\fi\fi)\endcsname}
-
-\def\PDFcolor #1{\ctxlua{tex.sprint(ctx.pdfcolor (\number\currentcolormodel, \thecolorattribute{#1}))}}
-\def\PDFcolorvalue#1{\ctxlua{tex.sprint(ctx.pdfcolorvalue(\number\currentcolormodel, \thecolorattribute{#1}))}}
-\def\FDFcolor #1{\ctxlua{tex.sprint(ctx.fdfcolor (\number\currentcolormodel, \thecolorattribute{#1}))}}
-
-\def\internalspotcolorname#1{\ctxlua{tex.sprint(ctx.spotcolorname (\thecolorattribute{#1}))}}
-\def\internalspotcolorsize#1{\ctxlua{tex.sprint(ctx.spotcolorvalue(\thecolorattribute{#1}))}}
-
-\def\colorcomponents #1{\ctxlua{tex.sprint(ctx.colorcomponents (\thecolorattribute {#1}))}}
-\def\transparencycomponents#1{\ctxlua{tex.sprint(ctx.transparencycomponents(\thetransparencyattribute{#1}))}}
-
-\def\colorvalue#1{\ctxlua{tex.sprint(ctx.formatcolor(\thecolorattribute{#1},"\colorformatseparator"))}}
-\def\grayvalue #1{\ctxlua{tex.sprint(ctx.formatgray (\thecolorattribute{#1},"\colorformatseparator"))}}
-
-% hack, till we have adapted backend: (move it there)
-
-\def\presetPDFtransparencybynumber#1#2#3%
- {\initializetransparency
- \ifcase#1\else
- \global\PDFcurrenttransparency\numexpr#1+\minusone\relax
- \presetPDFtransparency{#2}{#3}%
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/colo-new.tex b/Master/texmf-dist/tex/context/base/colo-new.tex
deleted file mode 100644
index 04b2ef716f7..00000000000
--- a/Master/texmf-dist/tex/context/base/colo-new.tex
+++ /dev/null
@@ -1,1051 +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 / 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 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.
-
-\startmessages dutch library: colors
- title: kleur
- 1: systeem -- is globaal actief
- 2: systeem -- is lokaal actief
- 3: -- is niet gedefinieerd --
- 4: systeem -- wordt geladen
- 5: onbekend systeem --
- 6: palet -- is beschikbaar
- 7: palet -- is niet beschikbaar
- 8: specificatie -- bij -- wordt zwart
- 9: -- kleurruimte wordt niet ondersteund
- 10: -- kleurruimte wordt ondersteund
- 11: kleur wordt vertaald in grijs
- 12: -- is geregistreerd
-\stopmessages
-
-\startmessages english library: colors
- title: color
- 1: system -- is global activated
- 2: system -- is local activated
- 3: -- is not defined --
- 4: system -- is loaded
- 5: unknown system --
- 6: palette -- is available
- 7: palette -- is not available
- 8: specification -- at color -- becomes black
- 9: -- color space is not supported
- 10: -- color space is supported
- 11: color is converted to gray
- 12: -- is registered
-\stopmessages
-
-\startmessages german library: colors
- title: farbe
- 1: system -- ist global aktiviert
- 2: system -- ist lokal aktiviert
- 3: -- ist undefiniert --
- 4: system -- ist geladen
- 5: unbekanntes System --
- 6: palette -- ist verfuegbar
- 7: palette -- ist nicht verfuegbar
- 8: Spezifikation -- bei Farbe -- wird schwarz
- 9: -- Farbraum wird nicht unterstuetzt
- 10: -- Farbraum wird unterstuetzt
- 11: Farbe wird in Grau umgewandelt
- 12: -- is registered
-\stopmessages
-
-\startmessages czech library: colors
- title: barva
- 1: system -- je globalne aktivovana
- 2: system -- je lokalne activovana
- 3: -- neni definovana --
- 4: system -- je nacten
- 5: neznamy system --
- 6: palette -- je k dispozici
- 7: palette -- neni k dispozici
- 8: specifikace -- v barve -- bude cerna
- 9: -- prostor barev neni podporovan
- 10: -- prostor barev je podporovan
- 11: barva je prevedena na sed
- 12: -- is registered
-\stopmessages
-
-\startmessages italian library: colors
- title: colore
- 1: sistema -- attivato globalmente
- 2: sistema -- attivato localmente
- 3: -- non definito --
- 4: sistema -- caricato
- 5: sistema -- sconosciuto
- 6: tavolozza -- resa disponibile
- 7: tavolozza -- non disponibile
- 8: specifica -- del colore -- convertita in nero
- 9: spazio dei colori -- non supportato
- 10: spazio dei colori -- supportato
- 11: il colore ø convertito in grigio
- 12: -- is registered
-\stopmessages
-
-\startmessages norwegian library: colors
- title: farge
- 1: system -- er aktivert globalt
- 2: system -- er aktivert lokalt
- 3: -- er udefinert --
- 4: system -- er lest inn
- 5: ukjent system --
- 6: palett -- er tilgjengelig
- 7: palett -- er ikke tilgjengelig
- 8: spesifikasjon -- for farge -- gir kun svart
- 9: -- fargerom er ikke støttet
- 10: -- fargerom er støttet
- 11: fargen vil bli vist som grø
- 12: -- is registered
-\stopmessages
-
-\startmessages romanian library: colors
- title: culori
- 1: sistem -- este activata global
- 2: sistem -- este activata local
- 3: -- nu este definita --
- 4: sistem -- este incarcata
- 5: sistem -- necunoscuta
- 6: paleta -- este disponibila
- 7: palette -- nu este disponibila
- 8: specificatia -- la culoarea -- devine neagra
- 9: spatiul de culoare -- nu este suportat
- 10: spatiul de culoare -- este suportat
- 11: culoarea este convertita la gri
- 12: -- is registered
-\stopmessages
-
-\startmessages french library: colors
- title: couleurs
- 1: le système -- est globalement activé
- 2: le système -- est localement activé
- 3: -- n'est pas défini --
- 4: le système -- est chargé
- 5: système -- inconnu
- 6: la palette -- est disponible
- 7: le palette -- n'est pas disponible
- 8: la spécification -- de la couleur -- devient noire
- 9: l'espace de couleur -- n'est pas supporté
- 10: -- l'espace de couleur est supporté
- 11: la couleur est convertie en niveau de gris
- 12: -- est enregistré
-\stopmessages
-
-\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
- {\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 \showmessage\m!colors {9}\v!rgb\RGBsupportedfalse\fi}
- {\ifRGBsupported\else\showmessage\m!colors{10}\v!rgb\RGBsupportedtrue \fi}%
- \doifelse\@@clcmyk\v!no
- {\ifCMYKsupported \showmessage\m!colors {9}\v!cmyk\CMYKsupportedfalse\fi}
- {\ifCMYKsupported\else\showmessage\m!colors{10}\v!cmyk\CMYKsupportedtrue \fi}%
- \doifelse\@@clmpcmyk\v!no
- {\ifMPcmykcolors \showmessage\m!colors {9}{\v!mp\v!cmyk}\MPcmykcolorsfalse\fi}
- {\ifMPcmykcolors\else\showmessage\m!colors{10}{\v!mp\v!cmyk}\MPcmykcolorstrue \fi}%
- \doifelse\@@clmpspot\v!no
- {\ifMPspotcolors \showmessage\m!colors {9}{\v!mp\v!spot}\MPspotcolorsfalse\fi}
- {\ifMPspotcolors\else\showmessage\m!colors{10}{\v!mp\v!spot}\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]{\definespotolor[#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!
-
-% \appendtoks\setupcolors[\c!expansie=\v!ja]\to\everyjob
-
-\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 load the low level macros:
-
-\loadmarkfile{colo-new}
-
-%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]
-
-\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/colo-x11.tex b/Master/texmf-dist/tex/context/base/colo-x11.tex
new file mode 100644
index 00000000000..45d3aac6248
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/colo-x11.tex
@@ -0,0 +1,677 @@
+%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/cont-cz.tex b/Master/texmf-dist/tex/context/base/cont-cz.tex
deleted file mode 100644
index b86b21e869a..00000000000
--- a/Master/texmf-dist/tex/context/base/cont-cz.tex
+++ /dev/null
@@ -1,35 +0,0 @@
-%D \module
-%D [ file=cont-cz,
-%D version=1998.12.02,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Czech Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!cz]
-
-\loaduserspecifications
-
-\installlanguage [\s!en] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!sk] [\c!state=\v!start]
-\installlanguage [\s!cz] [\c!state=\v!start]
-
-% \setupbodyfont [cmr,ams,rm,12pt]
-%
-% \setupencoding[default=ec] \usetypescript[modern][\defaultencoding] \setupbodyfont[modern,rm,12pt]
-
-\setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-
-\protect \errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-fil.tex b/Master/texmf-dist/tex/context/base/cont-fil.tex
index 28b6b6f55b8..b295872ca0c 100644
--- a/Master/texmf-dist/tex/context/base/cont-fil.tex
+++ b/Master/texmf-dist/tex/context/base/cont-fil.tex
@@ -20,7 +20,8 @@
\definefilesynonym [eenheid] [units]
\definefilesynonym [einheit] [units]
-\definefilesynonym [pstricks] [pstric]
+\definefilesynonym [pstric] [pstricks]
+\definefilesynonym [pstrick] [pstricks]
\definefilesynonym [finance] [financ]
diff --git a/Master/texmf-dist/tex/context/base/cont-log.tex b/Master/texmf-dist/tex/context/base/cont-log.tex
index a22c1d2c4e2..9bfec299992 100644
--- a/Master/texmf-dist/tex/context/base/cont-log.tex
+++ b/Master/texmf-dist/tex/context/base/cont-log.tex
@@ -89,7 +89,7 @@
\kern-.11em\TeX}
\def\AMSswitch#1%
- {$\fam2\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$}
+ {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$}
\unexpanded\def\AmSTeX
{\AMSswitch A%
@@ -210,6 +210,7 @@
\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,
@@ -286,14 +287,15 @@
\fi
-\let\ETEX \eTeX
-\let\PDFTEX \pdfTeX
-\let\PDFETEX \pdfeTeX
-\let\LUATEX \luaTeX
-\let\XETEX \XeTeX
+\let\ETEX \eTeX
+\let\PDFTEX \pdfTeX
+\let\PDFETEX\pdfeTeX
+\let\LUATEX \luaTeX
+\let\LuaTeX \luaTeX
+\let\XETEX \XeTeX
-\def\MkApproved
- {\rotate
+\unexpanded\def\MkApproved
+ {\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,
@@ -306,4 +308,52 @@
\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/cont-new.mkii b/Master/texmf-dist/tex/context/base/cont-new.mkii
index 8b5bed657a5..2defba6d787 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.mkii
+++ b/Master/texmf-dist/tex/context/base/cont-new.mkii
@@ -16,4 +16,7 @@
\long\def\startluacode#1\stopluacode{}
\long\def\ctxlua #1{}
+\def\enabletrackers [#1]{}
+\def\disabletrackers[#1]{}
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv
index 35b716ed46f..6269e5a6160 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.mkiv
+++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv
@@ -11,25 +11,15 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% 2009-07-15 / vista sp 2 / 2.2G duo dell M90 precision:
-%
-% \dorecurse{10000}{test \page} % 300 pps
-% \dorecurse {2000}{test \page} % 260 pps
-% \dorecurse {300}{test \page} % 135 pps
-
-% \ctxlua { fonts.define.method = 2 } % normally 3
-
-\enablemode[mkiv] \setsystemmode{mkiv}
-
% potential new defaults:
%
% \setbreakpoints[compound]
\unprotect
-% % % % % % needs testing but saves runtime
+\ctxlua{logs.report = commands.report} % this will become default
-\let\checknotes\relax % probably not needed, checking already done
+\def\immediatemessage#1{\ctxlua{commands.writestatus("message","#1")}}
% we need to figure this out (to be discussed)
@@ -43,106 +33,8 @@
\unexpanded\def\textplus
{\char"002B } % plus
-% \def\registerviewerlayer#1#2% global !
-% {\setxvalue{(vl:#1)}{\global\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}}
-
-% \setevalue{(vl:)}{\global\doresetattribute{viewerlayer}}
-
-\let\\=\crlf % till we fixed all styles
-
-% \def\pagedir{\expandafter\gobblethreearguments}
-% \def\bodydir{\expandafter\gobblethreearguments}
-
-%D Since this can be a showstopper, we report the path at the beginning
-%D as well as at the end of a run.
-
-% \writestatus\m!lua{used config path - \ctxlua{tex.print(caches.configpath())}}
-% \writestatus\m!lua{used cache path - \ctxlua{tex.print(caches.path)}}
-
-\startluacode
- statistics.register("result saved in file", function()
- return string.format( "%s.%s", "\outputfilename", (tex.pdfoutput>0 and "pdf") or "dvi")
- end)
-\stopluacode
-
-%D For the moment we report some statistics. Later this will become an option,
-%D but for now we need this information.
-
-\def\nomkivstatistics{\ctxlua{statistics.enable = false}} % for taco
-
-\def\resettimer {\ctxlua{environment.starttime = os.clock()}}
-\def\elapsedtime {\ctxlua{tex.sprint(os.clock()-environment.starttime)}}
-\let\elapsedseconds \elapsedtime
+% till we fixed all styles
-% we will have a bunch of extra tracers (--dumphash --dumpdelta)
-
-\def\tracersdumphash {\ctxlua{tracers.register_dump_hash(false)}}
-\def\tracersdumpdelta{\ctxlua{tracers.register_dump_hash(true)}}
-
-\resettimer
-
-%D For me.
-
-\def\traceluausage
- {\dosingleempty\dotraceluausage}
-
-\def\dotraceluausage[#1]%
- {\ctxlua{debugger.enable()}%
- \appendtoks\ctxlua{debugger.disable() debugger.showstats(print,\doifnumberelse{#1}{#1}{5000})}\to\everybye}
-
-%D Fonts (experimental AFM loading}
-
-% \ctxlua {
-% remapper.define('encoding','^lm' ,'^(.*)$','lm-\letterpercent1')
-% remapper.define('encoding','^qbk','^(.*)$','q-\letterpercent1')
-% remapper.define('encoding','^qcs','^(.*)$','q-\letterpercent1')
-% remapper.define('encoding','^qpl','^(.*)$','q-\letterpercent1')
-% remapper.define('encoding','^qtm','^(.*)$','q-\letterpercent1')
-% }
-
-% \appendtoksonce \loadallXfontmapfiles \to \pdfbackendeveryximage
-% \appendtoksonce \loadallXfontmapfiles \to \pdfbackendeveryxform
-% \appendtoksonce \loadallXfontmapfiles \to \everystarttext
-% \appendtoksonce \loadallXfontmapfiles \to \everybeforepagebody
-
-% \def\loadallXfontmapfiles{\ctxlua{fonts.map.flush("pdftex")}}
-
-% \ctxlua{
-% do
-% local pth = "." .. io.fileseparator .. "tmp" .. io.fileseparator .. "\jobname"
-% texio.write_nl("CREATING "..pth)
-% os.execute("mkdir " .. pth)
-% end
-% resolvers.output_files = { }
-% callback.register('find_write_file', function(id,name)
-% resolvers.output_files[name] = file.join(".","tmp","\jobname",name)
-% texio.write_nl("REDIRECTING OUTPUT "..name.. " TO " .. resolvers.output_files[name])
-% return resolvers.output_files[name]
-% end)
-% callback.register('find_read_file', function(id,name)
-% local sname = string.gsub(name,"^\letterpercent./","")
-% if resolvers.output_files[sname] then
-% return resolvers.output_files[name]
-% elseif string.find(sname,"^\jobname[\letterpercent.\letterpercent-]") then
-% local n = file.join(".","tmp","\jobname",sname)
-% local f = io.open(n)
-% if f then
-% resolvers.output_files[name] = n
-% texio.write_nl("REDIRECTING INPUT "..sname.. " TO " .. n)
-% f:close()
-% return n
-% else
-% return resolvers.findtexfile(name)
-% end
-% else
-% return resolvers.findtexfile(name)
-% end
-% end)
-% }
-
-\definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=]
+\let\\=\crlf
\protect \endinput
-
-% \expanded{\defineactivecharacter \number"2000E} {\textdir TRT\relax}
-% \expanded{\defineactivecharacter \number"2000F} {\textdir TLT\relax}
diff --git a/Master/texmf-dist/tex/context/base/cont-new.tex b/Master/texmf-dist/tex/context/base/cont-new.tex
index 161d4c9182e..9c4fdba18f9 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.tex
+++ b/Master/texmf-dist/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2009.08.19 17:10}
+\newcontextversion{2010.05.24 13:05}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/Master/texmf-dist/tex/context/base/cont-uk.tex b/Master/texmf-dist/tex/context/base/cont-uk.tex
deleted file mode 100644
index d900217e1dc..00000000000
--- a/Master/texmf-dist/tex/context/base/cont-uk.tex
+++ /dev/null
@@ -1,38 +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 / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english}
-
-\input context.tex
-
-\unprotect
-
-\setupcurrentlanguage[\s!uk]
-
-\loaduserspecifications
-
-\installlanguage [\s!en] [\c!state=\v!start]
-\installlanguage [\s!uk] [\c!state=\v!start]
-\installlanguage [\s!de] [\c!state=\v!start]
-\installlanguage [\s!fr] [\c!state=\v!start]
-\installlanguage [\s!es] [\c!state=\v!start]
-\installlanguage [\s!nl] [\c!state=\v!start]
-\installlanguage [\s!it] [\c!state=\v!start]
-
-% \setupbodyfont [cmr,ams,rm,12pt]
-%
-% \setupencoding[default=ec] \usetypescript[modern][\defaultencoding] \setupbodyfont[modern,rm,12pt]
-
-\setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
-
-\protect \errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/context-base.lmx b/Master/texmf-dist/tex/context/base/context-base.lmx
index 5c96b497953..fd27927bf82 100644
--- a/Master/texmf-dist/tex/context/base/context-base.lmx
+++ b/Master/texmf-dist/tex/context/base/context-base.lmx
@@ -14,25 +14,63 @@
<head>
<title><?lua pv('title') ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <?lua if (v('refreshtime') and (tonumber(v('refreshtime')) or 0) > 0) and v('refreshurl') then ?>
+ <meta http-equiv='refresh' content="<?lua pv('refreshtime') ?>; <?lua pv('refreshurl') ?>"/>
+ <?lua end ?>
<style type="text/css">
<?lmx-include context.css ?>
</style>
+ <?lua if v('styles') then for k, v in ipairs(v('styles')) do ?>
+ <link rel="StyleSheet" href="<?lua p(v) ?>" type="text/css" />
+ <?lua end end ?>
</head>
+ <?lua if v('action') then ?>
+ <form action="<?lua pv(action) ?>" enctype="multi-part/form-data" method="post">
+ <?lua end ?>
<body>
- <div id="top"><div id="top-one"><div id="top-two">
- <?lua pv('title') ?>
- </div></div></div>
- <div id="left"><div id="left-one"><div id="left-two">
- <?lua pv('lefttext') ?>
- </div></div></div>
- <div id="right"><div id="right-safari"><div id="right-one"><div id="right-two"><div id="right-three"><div id="right-four"><div id="right-five">
- <?lua pv('righttext') ?>
- </div></div></div></div></div></div></div>
- <div id="main"><div id='main-settings'>
- <div class='title'><?lua pv('maintext') ?></div>
- </div></div>
- <div id="bottom"><div id="bottom-one"><div id="bottom-two">
- <?lua pv('bottomtext') ?>
- </div></div></div>
+ <div id="top">
+ <div id="top-one">
+ <div id="top-two">
+ <?lua pv('title') ?>
+ </div>
+ </div>
+ </div>
+ <div id="bottom">
+ <div id="bottom-one">
+ <div id="bottom-two">
+ <?lua pv('bottomtext') ?>
+ </div>
+ </div>
+ </div>
+ <div id="left">
+ <div id="left-one">
+ <div id="left-two">
+ <?lua pv('lefttext') ?>
+ </div>
+ </div>
+ </div>
+ <div id="right">
+ <div id="right-safari">
+ <div id="right-one">
+ <div id="right-two">
+ <div id="right-three">
+ <div id="right-four">
+ <div id="right-five">
+ <?lua pv('righttext') ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="main">
+ <div id='main-settings'>
+ <?lua pv('maintext') ?>
+ </div>
+ </div>
</body>
+ <?lua if v('action') then ?>
+ </form>
+ <?lua end ?>
</html>
diff --git a/Master/texmf-dist/tex/context/base/context-characters.lmx b/Master/texmf-dist/tex/context/base/context-characters.lmx
index b2ddee64e83..f018e412ba9 100644
--- a/Master/texmf-dist/tex/context/base/context-characters.lmx
+++ b/Master/texmf-dist/tex/context/base/context-characters.lmx
@@ -12,7 +12,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <script language="JavaScript">
+ <script type='text/javascript'>
<!--
window.focus();
-->
diff --git a/Master/texmf-dist/tex/context/base/context-debug.lmx b/Master/texmf-dist/tex/context/base/context-debug.lmx
index 8ca2573a9fa..51b18c83729 100644
--- a/Master/texmf-dist/tex/context/base/context-debug.lmx
+++ b/Master/texmf-dist/tex/context/base/context-debug.lmx
@@ -12,7 +12,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <script language="JavaScript">
+ <script type='text/javascript'>
<!--
window.focus();
-->
diff --git a/Master/texmf-dist/tex/context/base/context-error.lmx b/Master/texmf-dist/tex/context/base/context-error.lmx
index 015d74c9f0f..b82b552f88f 100644
--- a/Master/texmf-dist/tex/context/base/context-error.lmx
+++ b/Master/texmf-dist/tex/context/base/context-error.lmx
@@ -12,7 +12,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <script language="JavaScript">
+ <script type='text/javascript'>
<!--
window.focus();
-->
diff --git a/Master/texmf-dist/tex/context/base/context-fonttest.lmx b/Master/texmf-dist/tex/context/base/context-fonttest.lmx
index b90af179db2..fddb8196b38 100644
--- a/Master/texmf-dist/tex/context/base/context-fonttest.lmx
+++ b/Master/texmf-dist/tex/context/base/context-fonttest.lmx
@@ -12,7 +12,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <script type="text/javascript">
+ <script type='text/javascript'>
<!--
window.focus() ;
<?lua pv('javascripts')?> ;
diff --git a/Master/texmf-dist/tex/context/base/context-help.lmx b/Master/texmf-dist/tex/context/base/context-help.lmx
index 3c663b0acc3..5401fb65db0 100644
--- a/Master/texmf-dist/tex/context/base/context-help.lmx
+++ b/Master/texmf-dist/tex/context/base/context-help.lmx
@@ -12,7 +12,7 @@
<html>
<head>
- <script language="JavaScript">
+ <script type='text/javascript'>
<!--
window.focus();
-->
diff --git a/Master/texmf-dist/tex/context/base/context-timing.lmx b/Master/texmf-dist/tex/context/base/context-timing.lmx
index eea9db822ef..57b5879bad8 100644
--- a/Master/texmf-dist/tex/context/base/context-timing.lmx
+++ b/Master/texmf-dist/tex/context/base/context-timing.lmx
@@ -16,7 +16,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <script language="JavaScript">
+ <script type='text/javascript'>
<!--
window.focus();
-->
diff --git a/Master/texmf-dist/tex/context/base/context.mkii b/Master/texmf-dist/tex/context/base/context.mkii
index 4f8f1616350..4be60cbfcbc 100644
--- a/Master/texmf-dist/tex/context/base/context.mkii
+++ b/Master/texmf-dist/tex/context/base/context.mkii
@@ -34,6 +34,7 @@
\loadmarkfile{syst-ext}
\loadmarkfile{syst-new}
\loadmarkfile{syst-con}
+\loadcorefile{syst-ltx}
\loadmarkfile{thrd-trg} % based on: David Carlisle
\loadmarkfile{syst-fnt}
@@ -81,7 +82,7 @@
\loadmarkfile{supp-ran}
\loadmarkfile{supp-mps}
\loadmarkfile{supp-tpi}
-\loadcorefile{supp-mat}
+\loadmarkfile{supp-mat}
\loadcorefile{supp-ali}
\loadcorefile{supp-num}
@@ -181,8 +182,9 @@
%D macros' that are seen by the users. The order of loading
%D is important, due to dependancies.
-\loadmarkfile{core-spa}
-\loadmarkfile{core-grd}
+\loadmarkfile{spac-gen}
+\loadmarkfile{spac-grd}
+
\loadmarkfile{strc-mar}
\loadmarkfile{anch-pos}
@@ -192,6 +194,7 @@
\loadmarkfile{pack-rul}
\loadmarkfile{trac-vis}
\loadmarkfile{strc-num}
+\loadmarkfile{tabl-com}
\loadmarkfile{tabl-pln}
\loadmarkfile{tabl-tab}
\loadmarkfile{tabl-tsp}
@@ -274,7 +277,7 @@
\loadmarkfile{enco-pfr}
\loadmarkfile{type-ini}
-\loadcorefile{type-def}
+\loadmarkfile{type-set}
%D Properties. Don't ask.
@@ -333,6 +336,10 @@
\loadcorefile{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.
diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv
index 03f26c8f000..33fa3a901ac 100644
--- a/Master/texmf-dist/tex/context/base/context.mkiv
+++ b/Master/texmf-dist/tex/context/base/context.mkiv
@@ -20,14 +20,18 @@
\loadcorefile{syst-ini}
-\ifnum\luatexversion<43
- \writestatus{!!!!}{Your luatex binary is way too old, you need at least version 0.42.}
+\ifnum\luatexversion<60 % also change message
+ \writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.60!}
\expandafter\end
\fi
+\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion} % at the lua end
+
\loadcorefile{norm-ctx}
\loadcorefile{syst-pln}
+\newif\ifCONTEXT \CONTEXTtrue % will disappear
+
\loadmarkfile{luat-cod}
\loadmarkfile{luat-bas}
\loadmarkfile{luat-lib}
@@ -38,11 +42,13 @@
\loadcorefile{catc-ctx}
\loadcorefile{catc-sym}
-\newif\ifCONTEXT \CONTEXTtrue % will disappear
+% From here on we have \unexpanded being \normalprotected, as we
+% already had \unexpanded long before etex came around.
\loadmarkfile{syst-aux}
\loadmarkfile{syst-lua}
\loadmarkfile{syst-con}
+\loadcorefile{syst-ltx}
\loadmarkfile{syst-fnt}
\loadmarkfile{syst-str}
@@ -68,12 +74,15 @@
\loadmarkfile{node-ini}
\loadmarkfile{node-fin}
+\loadmarkfile{node-mig}
\loadmarkfile{node-par}
+%loadmarkfile{node-pag}
\loadmarkfile{core-var}
\loadmarkfile{back-ini}
\loadmarkfile{lpdf-ini} % some day back-ini will load this
+\loadmarkfile{lpdf-pdx} % might be merged into lpdf-ini
\loadmarkfile{back-pdf} % some day back-ini will load this
\loadmarkfile{attr-ini}
@@ -84,13 +93,15 @@
\loadmarkfile{trac-lmx}
\loadmarkfile{trac-deb}
+\loadmarkfile{blob-ini} % not to be used, we only use a helper
+
\loadcorefile{supp-box}
\loadcorefile{supp-vis}
\loadcorefile{supp-fun}
\loadmarkfile{supp-ran}
-\loadcorefile{supp-mat}
+\loadmarkfile{supp-mat}
\loadcorefile{supp-ali}
\loadcorefile{supp-num}
@@ -109,6 +120,7 @@
\loadmarkfile{lang-ini}
\loadmarkfile{lang-lab}
+\loadmarkfile{lang-wrd}
\loadmarkfile{unic-ini}
@@ -148,6 +160,7 @@
\loadmarkfile{pack-rul}
\loadmarkfile{lxml-ini}
+\loadmarkfile{lxml-sor}
\loadmarkfile{strc-ini}
\loadmarkfile{strc-doc}
@@ -164,10 +177,14 @@
\loadmarkfile{strc-ref}
\loadmarkfile{strc-reg}
-\loadmarkfile{bibl-bib}
-
-\loadmarkfile{core-spa}
-\loadmarkfile{core-grd}
+\loadmarkfile{spac-hor}
+\loadmarkfile{spac-ver}
+\loadmarkfile{spac-ali}
+\loadmarkfile{spac-pag}
+\loadmarkfile{spac-fnt}
+\loadmarkfile{spac-par}
+\loadmarkfile{spac-def}
+\loadmarkfile{spac-grd}
\loadmarkfile{anch-pos}
@@ -181,6 +198,7 @@
\loadmarkfile{core-sys}
\loadmarkfile{page-ini}
+\loadmarkfile{page-flt}
\loadmarkfile{page-bck}
\loadmarkfile{page-not}
\loadmarkfile{page-one}
@@ -215,6 +233,7 @@
\loadmarkfile{scrn-bar}
\loadmarkfile{strc-bkm} % bookmarks
+\loadmarkfile{tabl-com}
\loadmarkfile{tabl-pln}
\loadcorefile{thrd-tab}
\loadmarkfile{tabl-tab}
@@ -235,15 +254,18 @@
\loadmarkfile{font-tra}
\loadmarkfile{font-uni}
\loadmarkfile{font-col}
+\loadmarkfile{font-gds}
\loadmarkfile{typo-spa}
\loadmarkfile{typo-krn}
\loadmarkfile{typo-mir}
\loadmarkfile{typo-brk}
\loadmarkfile{typo-cap}
+\loadmarkfile{typo-dig}
+\loadmarkfile{typo-rep}
\loadmarkfile{type-ini}
-\loadcorefile{type-def}
+\loadmarkfile{type-set}
\loadmarkfile{scrp-ini}
@@ -283,6 +305,7 @@
\loadmarkfile{math-del}
\loadmarkfile{math-inl}
\loadmarkfile{math-dis}
+\loadmarkfile{math-lan}
\loadmarkfile{strc-mat}
@@ -290,6 +313,7 @@
\loadmarkfile{chem-str}
\loadmarkfile{core-fnt}
+\loadmarkfile{node-rul}
\loadmarkfile{strc-not}
\loadmarkfile{strc-lnt}
@@ -305,14 +329,14 @@
\loadmarkfile{page-app}
\loadmarkfile{meta-fig}
+\loadmarkfile{node-bck} % overloads anch-pgr (experimental and undocumented)
+
\loadcorefile{lang-spa}
-\loadcorefile{xtag-ini} % might go away
-\loadcorefile{xtag-ext} % might go away
-\loadcorefile{xtag-exp} % will go away
-\loadcorefile{xtag-pre} % has old encoding code
-\loadcorefile{xtag-xsd} % will go away (stub anyway)
-\loadcorefile{xtag-rng} % will go away (stub anyway)
+\loadmarkfile{bibl-bib}
+\loadmarkfile{bibl-tra}
+
+\loadmarkfile{x-xtag} % at some point this will not be preloaded
\loadcorefile{meta-xml}
diff --git a/Master/texmf-dist/tex/context/base/context.tex b/Master/texmf-dist/tex/context/base/context.tex
index 5f9615230f0..47489658ea6 100644
--- a/Master/texmf-dist/tex/context/base/context.tex
+++ b/Master/texmf-dist/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2009.08.19 17:10}
+\edef\contextversion{2010.05.24 13:05}
%D For those who want to use this:
diff --git a/Master/texmf-dist/tex/context/base/core-bar.tex b/Master/texmf-dist/tex/context/base/core-bar.tex
deleted file mode 100644
index 9b7acf17f34..00000000000
--- a/Master/texmf-dist/tex/context/base/core-bar.tex
+++ /dev/null
@@ -1,194 +0,0 @@
-%D \module
-%D [ file=core-bar,
-%D version=2003.03.16,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Margin Bars and alike,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright=PRAGMA-ADE]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{Context Plus Macros / Margin Bars etc}
-
-\unprotect
-
-%D We will implement a sidebar mechanism using the
-%D functionality from \type {core-pos}.
-%D
-%D \starttyping
-%D \definesidebar[whow][rulecolor=green,distance=]
-%D
-%D \input tufte \par
-%D \startsidebar
-%D \input tufte \par
-%D \input tufte \par
-%D \startsidebar[whow]
-%D \input tufte \par
-%D \input tufte \par
-%D \input tufte
-%D \stopsidebar \par
-%D \input tufte \par
-%D \input tufte
-%D \stopsidebar \par
-%D \input tufte \par
-%D \input tufte \par
-%D \startsidebar
-%D \input tufte \par
-%D \input tufte \par
-%D \input tufte \par
-%D \input tufte \par
-%D \input tufte
-%D \stopsidebar \par
-%D \input tufte \par
-%D \input tufte \par
-%D \startsidebar
-%D \input tufte
-%D \input tufte
-%D \input tufte
-%D \input tufte
-%D \input tufte
-%D \stopsidebar
-%D \stoptyping
-
-\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/core-blk.tex b/Master/texmf-dist/tex/context/base/core-blk.tex
deleted file mode 100644
index 8de1099e6e8..00000000000
--- a/Master/texmf-dist/tex/context/base/core-blk.tex
+++ /dev/null
@@ -1,676 +0,0 @@
-%D \module
-%D [ file=core-blk, % split off core-buf.tex
-%D version=2000.01.05,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Blockmoves,
-%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.
-
-% investigate etex's \readline and \scantokens
-
-\writestatus{loading}{Context Core Macros / Blockmoves}
-
-\startmessages dutch library: textblocks
- title: tekstblokken
- 1: nieuwe versie, tweede run nodig
- 2: wegschrijven blokken naar --
- 3: inlezen blokken uit --
- 4: er is een tweede run nodig
- 5: -- niet verborgen
- 6: -- verborgen en verwerkt
- 7: -- verborgen
- 8: -- gehandhaafd
- 9: -- niet gehandhaafd
- 10: -- geladen en verwerkt
- 11: -- geladen en geplaatst
- 12: -- overgeslagen
-\stopmessages
-
-\startmessages english library: textblocks
- title: textblocks
- 1: new version, second pass needed
- 2: writing blocks to --
- 3: reading blocks from --
- 4: second pass needed
- 5: -- not hidden
- 6: -- hidden and processed
- 7: -- hidden
- 8: -- typeset
- 9: -- not typeset
- 10: -- loaded and processed
- 11: -- loaded and typeset
- 12: -- skipped
-\stopmessages
-
-\startmessages german library: textblocks
- title: textblock
- 1: neue Version, zweiter Durchlauf benoetigt
- 2: schreibe Bloecke zu --
- 3: lese Bloecke von --
- 4: zweiter Durchlauf benoetigt
- 5: -- nicht verborgen
- 6: -- verborgen und verarbeitet
- 7: -- verborgen
- 8: -- gesetzt
- 9: -- nicht gesetzt
- 10: -- geladen und verarbeitet
- 11: -- geladen und gesetzt
- 12: -- ausgelassen
-\stopmessages
-
-\startmessages czech library: textblocks
- title: textovyblok
- 1: nova verze, je treba druhy beh
- 2: zapisuji bloky do --
- 3: ctu bloky z --
- 4: je treba druhy beh
- 5: -- neni skryto
- 6: -- skryto a zpracovano
- 7: -- skryto
- 8: -- vysazeno
- 9: -- nevysazeno
- 10: -- nacteno a zpracovano
- 11: -- nacteno a vysazeno
- 12: -- preskoceno
-\stopmessages
-
-\startmessages italian library: textblocks
- title: blocchi di testo
- 1: nuova versione, seconda passata necessaria
- 2: scrittura dei blocchi su --
- 3: lettura dei blocchi da --
- 4: seconda passata necessaria
- 5: -- non nascosto
- 6: -- nascosto ed elaborato
- 7: -- nascosto
- 8: -- composto
- 9: -- non composto
- 10: -- caricato ed elaborato
- 11: -- caricato e composto
- 12: -- saltato
-\stopmessages
-
-\startmessages norwegian library: textblocks
- title: tekstblokker
- 1: ny versjon, andre gjennomkjøring nødvendig
- 2: skriver blokker til --
- 3: leser blokker fra --
- 4: andre gjennomkjøring nødvendig
- 5: -- ikke skjult
- 6: -- skjult og behandlet
- 7: -- skjult
- 8: -- tegnsatt
- 9: -- ikke tegnsatt
- 10: -- lest inn og behandlet
- 11: -- lest inn og tegnsatt
- 12: -- utelatt
-\stopmessages
-
-\startmessages romanian library: textblocks
- title: blocuri de text
- 1: o noua versiune, este nevoie de inca o trecere
- 2: se scriu blocurile in --
- 3: se citesc blocurile din --
- 4: este nevoie de inca o trecere
- 5: -- nu este ascuns
- 6: -- ascuns si procesat
- 7: -- ascuns
- 8: -- cules
- 9: -- nu este cules
- 10: -- incarcat si procesat
- 11: -- incarcat si cules
- 12: -- sarit peste
-\stopmessages
-
-\startmessages french library: textblocks
- title: blocs de texte
- 1: nouvelle version, une seconde passe est nécessaire
- 2: ecriture des blocs vers --
- 3: lecture des blocs en provenance de --
- 4: seconde passe nécessaire
- 5: -- non caché
- 6: -- caché et traité
- 7: -- caché
- 8: -- composé
- 9: -- non composé
- 10: -- chargé et traité
- 11: -- chargé et composé
- 12: -- sauté
-\stopmessages
-
-\unprotect
-
-\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/core-box.tex b/Master/texmf-dist/tex/context/base/core-box.tex
deleted file mode 100644
index dd84fbc1abf..00000000000
--- a/Master/texmf-dist/tex/context/base/core-box.tex
+++ /dev/null
@@ -1,953 +0,0 @@
-%D \module
-%D [ file=core-box,
-%D version=2002.04.12,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Boxes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{Context Core Macros / 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 itsel fis 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
- \global\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]%
- {\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
- \ifdone
- \if!!donea
- \advance\scratchdimen\MPx{\??bg:\number\nofbleeds}%
- \else\if!!doneb
- \scratchdimen\paperwidth
- \advance\scratchdimen-\MPx{\??bg:\number\nofbleeds}%
- \fi\fi
- \fi
- \advance\scratchdimen\@@bghoffset
- \xdef\bleedwidth{\the\scratchdimen}%
- \scratchdimen\@@bgheight
- \ifdone
- \if!!donec
- \scratchdimen\paperheight
- \advance\scratchdimen-\MPy{\??bg:\number\nofbleeds}%
- \else\if!!doned
- \advance\scratchdimen\MPy{\??bg:\number\nofbleeds}%
- \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{\??bg:\number\nofbleeds}{\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]}
-
-\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}
-
-\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
-
-\def\offset {\dodoubleempty\dooffsetbox [\hbox]} % yes or no
-\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}
-
-\def\ltabbed{\dotabbed\relax\hss}
-\def\rtabbed{\dotabbed\hss \relax}
-\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
-
-\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]}
-
-\def\backgroundimage#1#2#3% repeat hsize vsize
- {\bgroup
- \dowithnextbox
- {\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\scratchbox\hbox{\expanded{\clip[\c!width=#2,\c!height=\the\nextboxht]{\box\scratchbox}}}%
- \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/core-con.lua b/Master/texmf-dist/tex/context/base/core-con.lua
index e13f68456b4..dca1c7d10cc 100644
--- a/Master/texmf-dist/tex/context/base/core-con.lua
+++ b/Master/texmf-dist/tex/context/base/core-con.lua
@@ -1,6 +1,6 @@
-if not modules then modules = { } end modules ['char-con'] = {
+if not modules then modules = { } end modules ['core-con'] = {
version = 1.001,
- comment = "companion to core-con.tex",
+ comment = "companion to core-con.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -16,7 +16,7 @@ slower but look nicer this way.</p>
local utf = unicode.utf8
-local floor, mod, date, time, concat = math.floor, math.mod, os.date, os.time, table.concat
+local floor, date, time, concat = math.floor, os.date, os.time, table.concat
local lower, format, rep = string.lower, string.format, string.rep
local texsprint, utfchar = tex.sprint, utf.char
local tonumber, tostring = tonumber, tostring
@@ -147,42 +147,64 @@ converters.chr = chr
converters.chrs = chrs
converters.maxchrs = maxchrs
-local function do_alphabetic(n,max,chr)
- if n > max then
- do_alphabetic(floor((n-1)/max),max,chr)
- n = (n-1)%max+1
- end
- characters.flush(chr(n))
-end
-
--~ more efficient but needs testing
--~
--~ local escapes = utffilters.private.escapes
--~
---~ local function do_alphabetic(n,max,chr)
+--~ local function do_alphabetic(n,mapping,chr)
+--~ local max = #mapping
--~ if n > max then
--~ do_alphabetic(floor((n-1)/max),max,chr)
--~ n = (n-1)%max+1
--~ end
---~ n = chr(n)
+--~ n = chr(n,mapping)
--~ texsprint(ctxcatcodes,escapes[n] or utfchar(n))
--~ end
--~ local lccodes, uccodes = characters.lccode, characters.uccode
-local function lowercased(n) return characters.lccode(code[n] or fallback) end
-local function uppercased(n) return characters.uccode(code[n] or fallback) end
+--~ local function do_alphabetic(n,mapping,chr)
+--~ local max = #mapping
+--~ if n > max then
+--~ do_alphabetic(floor((n-1)/max),mapping,chr)
+--~ n = (n-1)%max+1
+--~ end
+--~ characters.flush(chr(n,mapping))
+--~ end
+--~
+--~ local function lowercased(n,mapping) return characters.lccode(mapping[n] or fallback) end
+--~ local function uppercased(n,mapping) return characters.uccode(mapping[n] or fallback) end
+--~
+--~ function converters.alphabetic(n,code)
+--~ do_alphabetic(n,counters[code] or counters['**'],lowercased) -- lccode catches wrong tables
+--~ end
+--~
+--~ function converters.Alphabetic(n,code)
+--~ do_alphabetic(n,counters[code] or counters['**'],uppercased)
+--~ end
+
+--
+
+local function do_alphabetic(n,mapping,mapper)
+ local chr = mapper(mapping[n] or fallback)
+ local max = #mapping
+ if n > max then
+ do_alphabetic(floor((n-1)/max),mapping,mapper)
+ n = (n-1)%max+1
+ end
+ characters.flush(chr)
+end
function converters.alphabetic(n,code)
- local code = counters[code] or counters['**']
- do_alphabetic(n,#code,lowercased) -- lccode catches wrong tables
+ do_alphabetic(n,counters[code] or counters['**'],characters.lccode)
end
function converters.Alphabetic(n,code)
- local code = counters[code] or counters['**']
- do_alphabetic(n,#code,uppercased)
+ do_alphabetic(n,counters[code] or counters['**'],characters.uccode)
end
+--
+
function converters.character (n) chr (n,96) end
function converters.Character (n) chr (n,64) end
function converters.characters(n) chrs(n,96) end
@@ -274,10 +296,10 @@ function converters.toabjad(n,what)
return medium[n]
else
local a, b, c, d
- a, n = floor(n/1000), mod(n,1000)
- b, n = floor(n/ 100), mod(n, 100)
- c, n = floor(n/ 10), mod(n, 10)
- d, n = floor(n/ 1), mod(n, 1)
+ a, n = floor(n/1000), n % 1000 -- mod(n,1000)
+ b, n = floor(n/ 100), n % 100 -- mod(n, 100)
+ c, n = floor(n/ 10), n % 10 -- mod(n, 10)
+ d, n = floor(n/ 1), n % 1 -- mod(n, 1)
return (large[4][a] or "") .. (large[3][b] or "") .. (large[2][c] or "") .. (large[1][d] or "")
end
end
@@ -287,7 +309,7 @@ function converters.abjadnodotnumerals(n) return texsprint(converters.toabjad(n,
local vector = {
normal = {
- [0] = "○",
+ [0] = "〇",
[1] = "一",
[2] = "二",
[3] = "三",
@@ -321,7 +343,7 @@ local vector = {
[100000000] = "亿",
},
all = {
- [0] = "○",
+ [0] = "〇",
[1] = "一",
[2] = "二",
[3] = "三",
@@ -341,7 +363,63 @@ local vector = {
}
}
+--~ function tochinese(n,name) -- normal, caps, all
+--~ local result = { }
+--~ local vector = vector[name] or vector.normal
+--~ while true do
+--~ if n == 0 then
+--~ break
+--~ elseif n >= 100000000 then
+--~ local m = floor(n/100000000)
+--~ if m > 1 then result[#result+1] = tochinese(m) end
+--~ result[#result+1] = vector[100000000]
+--~ n = n % 100000000
+--~ elseif n >= 10000000 then
+--~ result[#result+1] = tochinese(floor(n/10000))
+--~ result[#result+1] = vector[10000]
+--~ n = n % 10000
+--~ elseif n >= 1000000 then
+--~ result[#result+1] = tochinese(floor(n/10000))
+--~ result[#result+1] = vector[10000]
+--~ n = n % 10000
+--~ elseif n >= 100000 then
+--~ result[#result+1] = tochinese(floor(n/10000))
+--~ result[#result+1] = vector[10000]
+--~ n = n % 10000
+--~ elseif n >= 10000 then
+--~ local m = floor(n/10000)
+--~ if m > 1 then result[#result+1] = vector[m] end
+--~ result[#result+1] = vector[10000]
+--~ n = n % 10000
+--~ elseif n >= 1000 then
+--~ local m = floor(n/1000)
+--~ if m > 1 then result[#result+1] = vector[m] end
+--~ result[#result+1] = vector[1000]
+--~ n = n % 1000
+--~ elseif n >= 100 then
+--~ local m = floor(n/100)
+--~ if m > 1 then result[#result+1] = vector[m] end
+--~ result[#result+1] = vector[100]
+--~ n = n % 100
+--~ elseif n >= 10 then
+--~ local m = floor(n/10)
+--~ if vector[m*10] then
+--~ result[#result+1] = vector[m*10]
+--~ else
+--~ result[#result+1] = vector[m]
+--~ result[#result+1] = vector[10]
+--~ end
+--~ n = n % 10
+--~ else
+--~ result[#result+1] = vector[n]
+--~ break
+--~ end
+--~ end
+--~ return concat(result)
+--~ end
+
function tochinese(n,name) -- normal, caps, all
+ -- improved version by Li Yanrui
local result = { }
local vector = vector[name] or vector.normal
while true do
@@ -349,39 +427,56 @@ function tochinese(n,name) -- normal, caps, all
break
elseif n >= 100000000 then
local m = floor(n/100000000)
- if m > 1 then result[#result+1] = tochinese(m) end
+ result[#result+1] = tochinese(m,name)
result[#result+1] = vector[100000000]
+ local z = n - m * 100000000
+ if z > 0 and z < 10000000 then result[#result+1] = vector[0] end
n = n % 100000000
elseif n >= 10000000 then
- result[#result+1] = tochinese(floor(n/10000))
+ local m = floor(n/10000)
+ result[#result+1] = tochinese(m,name)
result[#result+1] = vector[10000]
+ local z = n - m * 10000
+ if z > 0 and z < 1000 then result[#result+1] = vector[0] end
n = n % 10000
elseif n >= 1000000 then
- result[#result+1] = tochinese(floor(n/10000))
+ local m = floor(n/10000)
+ result[#result+1] = tochinese(m,name)
result[#result+1] = vector[10000]
+ local z = n - m * 10000
+ if z > 0 and z < 1000 then result[#result+1] = vector[0] end
n = n % 10000
elseif n >= 100000 then
- result[#result+1] = tochinese(floor(n/10000))
+ local m = floor(n/10000)
+ result[#result+1] = tochinese(m,name)
result[#result+1] = vector[10000]
+ local z = n - m * 10000
+ if z > 0 and z < 1000 then result[#result+1] = vector[0] end
n = n % 10000
- elseif n >= 10000 then
+ elseif n >= 10000 then
local m = floor(n/10000)
- if m > 1 then result[#result+1] = vector[m] end
+ result[#result+1] = vector[m]
result[#result+1] = vector[10000]
+ local z = n - m * 10000
+ if z > 0 and z < 1000 then result[#result+1] = vector[0] end
n = n % 10000
- elseif n >= 1000 then
+ elseif n >= 1000 then
local m = floor(n/1000)
- if m > 1 then result[#result+1] = vector[m] end
+ result[#result+1] = vector[m]
result[#result+1] = vector[1000]
+ local z = n - m * 1000
+ if z > 0 and z < 100 then result[#result+1] = vector[0] end
n = n % 1000
- elseif n >= 100 then
+ elseif n >= 100 then
local m = floor(n/100)
- if m > 1 then result[#result+1] = vector[m] end
+ result[#result+1] = vector[m]
result[#result+1] = vector[100]
+ local z = n - m * 100
+ if z > 0 and z < 10 then result[#result+1] = vector[0] end
n = n % 100
- elseif n >= 10 then
+ elseif n >= 10 then
local m = floor(n/10)
- if vector[m*10] then
+ if m > 1 and vector[m*10] then
result[#result+1] = vector[m*10]
else
result[#result+1] = vector[m]
@@ -393,10 +488,15 @@ function tochinese(n,name) -- normal, caps, all
break
end
end
+ if (result[1] == vector[1] and result[2] == vector[10]) then
+ result[1] = ""
+ end
return concat(result)
end
---~ for k, v in ipairs { 1,10,15,25,35,45,11,100,111,1111,10000,11111,100000,111111,1111111,11111111,111111111,100000000,1111111111,11111111111,111111111111,1111111111111 } do
+--~ local t = { 1,10,15,25,35,45,11,100,111,1111,10000,11111,100000,111111,1111111,11111111,111111111,100000000,1111111111,11111111111,111111111111,1111111111111 }
+--~ for k=1,#t do
+--~ local v = t[k]
--~ print(v,tochinese(v),tochinese(v,"all"),tochinese(v,"cap"))
--~ end
diff --git a/Master/texmf-dist/tex/context/base/core-con.mkiv b/Master/texmf-dist/tex/context/base/core-con.mkiv
index b9dc0b44980..2d2e5d5d78e 100644
--- a/Master/texmf-dist/tex/context/base/core-con.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-con.mkiv
@@ -596,10 +596,10 @@
% \setvalue{\??cv#1}##1{\csname\??cv#1##1\endcsname}}
% {\setvalue{\??cv#1}{#2}}}
%
-% \def\defineconversion%
+% \unexpanded\def\defineconversion%
% {\dodoubleargument\dodefineconversion}
-\def\defineconversion
+\unexpanded\def\defineconversion
{\dotripleempty\dodefineconversion}
\def\dodefineconversion[#1][#2][#3]%
diff --git a/Master/texmf-dist/tex/context/base/core-ctx.lua b/Master/texmf-dist/tex/context/base/core-ctx.lua
index eb9003bf1fb..1dad7c2d73a 100644
--- a/Master/texmf-dist/tex/context/base/core-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/core-ctx.lua
@@ -1,6 +1,6 @@
-if not modules then modules = { } end modules ['supp-fil'] = {
+if not modules then modules = { } end modules ['core-ctx'] = {
version = 1.001,
- comment = "companion to supp-fil.tex",
+ comment = "companion to core-ctx.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -18,20 +18,19 @@ function commands.loadctxpreplist()
local x = xml.load(ctlname)
if x then
islocal = xml.found(x,"ctx:preplist[@local=='yes']")
- if trace_prepfiles then
+--~ if trace_prepfiles then
if islocal then
commands.writestatus("systems","loading ctx log file (local)") -- todo: m!systems
else
commands.writestatus("systems","loading ctx log file (specified)") -- todo: m!systems
end
- end
- for r, d, k in xml.elements(x,"ctx:prepfile") do
- local dk = d[k]
- local name = xml.content(dk)
+--~ end
+ for e in xml.collected(x,"ctx:prepfile") do
+ local name = xml.text(e)
if islocal then
name = file.basename(name)
end
- local done = dk.at['done'] or 'no'
+ local done = e.at['done'] or 'no'
if trace_prepfiles then
commands.writestatus("systems","registering %s -> %s",done)
end
@@ -73,16 +72,16 @@ end
local processfile = commands.processfile
local doifinputfileelse = commands.doifinputfileelse
-function commands.processfile(name,depth)
- local prepname = found and resolve(name)
+function commands.processfile(name,maxreadlevel) -- overloaded
+ local prepname = resolve(name)
if prepname then
return processfile(prepname,0)
end
- return processfile(name,depth)
+ return processfile(name,maxreadlevel)
end
function commands.doifinputfileelse(name,depth)
- local prepname = found and resolve(name)
+ local prepname = resolve(name)
if prepname then
return doifinputfileelse(prepname,0)
end
@@ -90,5 +89,5 @@ function commands.doifinputfileelse(name,depth)
end
function commands.preparedfile(name)
- return (found and resolve(name)) or name
+ return resolve(name) or name
end
diff --git a/Master/texmf-dist/tex/context/base/core-ctx.mkiv b/Master/texmf-dist/tex/context/base/core-ctx.mkiv
index c401b09f0b9..9bf4569520b 100644
--- a/Master/texmf-dist/tex/context/base/core-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-ctx.mkiv
@@ -21,6 +21,8 @@
\def\loadctxpreplist{\ctxlua{commands.loadctxpreplist()}\global\let\loadctxpreplist\relax}
-\appendtoks\loadctxpreplist\to\everystarttext % will become: \prependtoks\loadctxpreplist\to\everyjob
+% \prependtoks\loadctxpreplist\to\everyjob
+
+\appendtoks\loadctxpreplist\to\everystarttext
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-def.mkii b/Master/texmf-dist/tex/context/base/core-def.mkii
index e51cd96d360..840f853a763 100644
--- a/Master/texmf-dist/tex/context/base/core-def.mkii
+++ b/Master/texmf-dist/tex/context/base/core-def.mkii
@@ -74,6 +74,13 @@
% \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
@@ -81,4 +88,18 @@
\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: syntex 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/core-def.mkiv b/Master/texmf-dist/tex/context/base/core-def.mkiv
index 583eb5870d0..59451a9141e 100644
--- a/Master/texmf-dist/tex/context/base/core-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-def.mkiv
@@ -28,7 +28,6 @@
\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 !
@@ -36,14 +35,10 @@
\appendtoks \settopskip \to \everyjob
\appendtoks \preloadlanguages \to \everyjob
\appendtoks \preloadspecials \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 \MPLIBregister \to \everyjob
+%appendtoks \MPLIBregister \to \everyjob
\appendtoks \xmlinitialize \to \everyjob
-\appendtoks \settrue\trackfilenames \to \everyjob
\appendtoks \newbackgroundfalse \to \everyjob % global
\appendtoks \initializepagecounters \to \everyjob
\appendtoks \directsetup{*runtime:options} \to \everyjob % we could erase them afterwards % order can change
@@ -52,15 +47,17 @@
%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 \registerfileinfo[end]\jobfilename \to \everybye
-\appendtoks \MPLIBallocate{1000} \to \everydump
+%appendtoks \MPLIBallocate{1000} \to \everydump
\prependtoks \resetallattributes \to \everybeforeoutput
\appendtoks \the\everybackendshipout \to \everyshipout
\prependtoks \the\everylastbackendshipout \to \everylastshipout
+\prependtoks \lefttoright \to \everybeforeoutput
+
% temporary here:
\ifdefined\in \let\normalmathin \in \unexpanded\def\in {\mathortext\normalmathin \dospecialin } \else \let\in \dospecialin \fi
@@ -69,4 +66,29 @@
\ifdefined\from \let\normalmathfrom \from \unexpanded\def\from {\mathortext\normalmathfrom \dospecialfrom } \else \let\from \dospecialfrom \fi
\ifdefined\over \let\normalmathover \over \unexpanded\def\over {\mathortext\normalmathover \dospecialabout} \else \let\over \dospecialabout \fi
+\unexpanded\def\arg{\mathortext\normalmatharg\normaltextarg}
+
+% brrr
+
+\appendtoks
+ \synchronizegloballinespecs
+ \synchronizelocallinespecs
+\to \everysetupbodyfont
+
+\appendtoks
+ \synchronizelocallinespecs
+\to \everyswitchtobodyfont
+
+\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
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-env.mkiv b/Master/texmf-dist/tex/context/base/core-env.mkiv
index c979872687c..d927ff3ad50 100644
--- a/Master/texmf-dist/tex/context/base/core-env.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-env.mkiv
@@ -108,11 +108,11 @@
% simple ones
-\def\doifmodeelse{\unprotect\dodoifmodeelse}
-\def\doifmode {\unprotect\dodoifmode}
-\def\doifnotmode {\unprotect\dodoifnotmode}
-\def\startmode {\unprotect\dostartmode}
-\def\startnotmode{\unprotect\dostartnotmode}
+\unexpanded\def\doifmodeelse{\unprotect\dodoifmodeelse}
+\unexpanded\def\doifmode {\unprotect\dodoifmode}
+\unexpanded\def\doifnotmode {\unprotect\dodoifnotmode}
+\unexpanded\def\startmode {\unprotect\dostartmode}
+\unexpanded\def\startnotmode{\unprotect\dostartnotmode}
\def\dodoifmodeelse
{\docheckformode\firstoftwoarguments\secondoftwoarguments}
@@ -123,23 +123,23 @@
\def\dodoifnotmode
{\docheckformode\gobbleoneargument\firstofoneargument}
-\long\def\dostartmode[#1]%
+\long\unexpanded\def\dostartmode[#1]%
{\docheckformode\donothing\dostopmode{#1}}
\long\def\dostartnotmode[#1]%
{\docheckformode\dostopnotmode\donothing{#1}}
-\let\stopmode \donothing
-\let\stopnotmode\donothing
+\unexpanded\def\stopmode {} % no relax
+\unexpanded\def\stopnotmode{} % no relax
\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}
+\unexpanded\def\doifallmodeselse{\unprotect\dodoifallmodeselse}
+\unexpanded\def\doifallmodes {\unprotect\dodoifallmodes}
+\unexpanded\def\doifnotallmodes {\unprotect\dodoifnotallmodes}
+\unexpanded\def\startallmodes {\unprotect\dostartallmodes}
+\unexpanded\def\startnotallmodes{\unprotect\dostartnotallmodes}
\def\dodoifallmodeselse
{\docheckforallmodes\firstoftwoarguments\secondoftwoarguments}
@@ -156,27 +156,31 @@
\long\def\dostartnotallmodes[#1]%
{\docheckforallmodes\dostopnotallmodes\donothing{#1}}
-\let\stopallmodes \donothing
-\let\stopnotallmodes\donothing
+\unexpanded\def\stopallmodes {} % no relax
+\unexpanded\def\stopnotallmodes{} % no relax
\long\def\dostopallmodes #1\stopallmodes {}
\long\def\dostopnotallmodes#1\stopnotallmodes{}
+%D Lets now set a mode:
+
+\enablemode[mkiv] \setsystemmode{mkiv}
+
%D Setups:
-\let\startsetups\relax % to please dep checker
-\let\stopsetups \relax % to please dep checker
+\unexpanded\def\startsetups{} % to please dep checker
+\unexpanded\def\stopsetups {} % 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}}}
+ {\noexpand\dostartsetupsA\@EA\noexpand\csname\e!stop\v!setups\endcsname}
+ {\noexpand\dostartsetupsB\@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 [..]
+\unexpanded\def\setups{\doifnextbgroupelse\dosetupsA\dosetupsB} % {..} or [..]
+\unexpanded\def\setup {\doifnextbgroupelse\dosetups \dosetupsC} % {..} or [..]
\def\dosetupsA #1{\processcommacommand[#1]\dosetups} % {..}
\def\dosetupsB[#1]{\processcommacommand[#1]\dosetups} % [..]
@@ -193,8 +197,20 @@
\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}
+% the next one is meant for \c!setups situations, hence the check for
+% a shortcut
+
+\def\doprocesslocalsetups#1%
+ {\edef\tobeprocessedsetups{#1}%
+ \ifx\tobeprocessedsetups\empty\else
+ \dodoprocesslocalsetups
+ \fi}
+
+\def\dodoprocesslocalsetups
+ {\@EA\processcommalist\@EA[\tobeprocessedsetups]\dosetups}
+
+\edef\setupwithargument#1% saves a few expansions
+ {\noexpand\csname\??su:\noexpand\ifcsname\??su:#1\endcsname#1\noexpand\else\letterpercent\noexpand\fi\endcsname}
\let\directsetup\dosetups
@@ -203,27 +219,27 @@
\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
+\unexpanded\def\startsetups {\xxstartsetups\plusone \stopsetups } \let\stopsetups \relax
+\unexpanded\def\startlocalsetups{\xxstartsetups\plusone \stoplocalsetups} \let\stoplocalsetups\relax
+\unexpanded\def\startrawsetups {\xxstartsetups\zerocount\stoprawsetups } \let\stoprawsetups \relax
+\unexpanded\def\startxmlsetups {\xxstartsetups\plustwo \stopxmlsetups } \let\stopxmlsetups \relax
\def\xxstartsetups#1#2%
- {\begingroup\let\setupseolmode#1\doifnextoptionalelse{\startsetupsA#2}{\startsetupsB#2}}
+ {\begingroup\let\setupseolmode#1\doifnextoptionalelse{\dostartsetupsA#2}{\dostartsetupsB#2}}
-\def\startsetupsA#1% [ ] delimited
+\def\dostartsetupsA#1% [ ] delimited
{\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\or\catcode`\^^M\@@ignore\catcode`\|\@@other\fi
\dotripleempty\dostartsetups[#1]}
-\def\startsetupsB#1#2 % space delimited
+\def\dostartsetupsB#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\dostartsetupsC[#1][#2][#3]{\dodostartsetups#1{#2}{#3}} % [..] [..]
+\def\dostartsetupsD[#1][#2][#3]{\dodostartsetups#1\empty{#2}} % [..]
\def\dostartsetups
- {\ifthirdargument\@EA\startsetupsC\else\@EA\startsetupsD\fi}
+ {\ifthirdargument\@EA\dostartsetupsC\else\@EA\dostartsetupsD\fi}
\long\def\dodostartsetups#1#2#3%
{\long\def\dododostartsetups##1#1%
@@ -243,90 +259,6 @@
\dodoglobal\letbeundefined{\??su:#1}%
\fi}
-%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
-
-\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} % we need to deactivate in math
- \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 \macros
%D {setvariables,getvariable,getvariabledefault}
%D
@@ -426,7 +358,7 @@
\def\getvariabledefault#1#2% #3% can be command, so no ifcsname here
{\executeifdefined{\??vars:#1:#2}}% {#3}
-% \def\setupenv{\dodoubleargument\rawgetparameters[\??en]}
+% \unexpanded\def\setupenv{\dodoubleargument\rawgetparameters[\??en]}
%
% \def\doifenvelse#1{\doifdefinedelse{\??en#1}} % speed up
% \def\doifenv #1{\doifdefined {\??en#1}} % speed up
@@ -446,7 +378,7 @@
\def\s!environment{environment}
-\def\setupenv {\dotripleargument\dosetvariables[\getrawparameters][\s!environment]}
+\unexpanded\def\setupenv {\dotripleargument\dosetvariables[\getrawparameters][\s!environment]}
\def\doifenvelse{\doifelsevariable \s!environment}
\def\doifenv {\doifvariable \s!environment}
\def\doifnotenv {\doifnotvariable \s!environment}
diff --git a/Master/texmf-dist/tex/context/base/core-fil.mkiv b/Master/texmf-dist/tex/context/base/core-fil.mkiv
index 14154fca43d..daef176d2b0 100644
--- a/Master/texmf-dist/tex/context/base/core-fil.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-fil.mkiv
@@ -43,7 +43,7 @@
% will be redone in mkiv
-\def\definefilesynonym
+\unexpanded\def\definefilesynonym
{\dodoubleempty\dodefinefilesynonym}
\def\dodefinefilesynonym[#1][#2]%
@@ -55,7 +55,7 @@
%D \macros
%D {definefilefallback}
-\def\definefilefallback
+\unexpanded\def\definefilefallback
{\dodoubleargument\dodefinefilefallback}
\def\dodefinefilefallback[#1][#2]%
@@ -114,44 +114,8 @@
%D their dedicated manuals. We use \type {\next} so that we
%D can \type {\end} in modules.
-\newconditional\moduleisloaded
-
-\def\dododousemodules#1#2% no \unprotect/\protect when loading,
- {\relax % since we need to use ? ! unprotected
- \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}
+ {\ctxlua{support.usemodules("#1","#2","\truefilename{#2}")}}
\def\usemodules
{\dotripleempty\dousemodules}
@@ -182,7 +146,7 @@
\let\currentmoduleparameters\empty
\let\currentmodule \s!unknown
-\def\startmodule
+\unexpanded\def\startmodule
{\doifnextoptionalelse\dostartmodule\nostartmodule}
\def\nostartmodule #1 %
@@ -193,11 +157,11 @@
\pushmacro\currentmoduleparameters
\def\currentmodule{#1}}
-\def\stopmodule
+\unexpanded\def\stopmodule
{\popmacro\currentmoduleparameters
\popmacro\currentmodule}
-\def\setupmodule
+\unexpanded\def\setupmodule
{\dodoubleempty\dosetupmodule}
\def\dosetupmodule[#1][#2]%
@@ -214,6 +178,9 @@
\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty}
\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty}
+\def\useluamodule [#1]{\ctxlua{dofile(resolvers.findctxfile("#1"))}}
+\def\luaenvironment #1 {\ctxlua{dofile(resolvers.findctxfile("#1"))}}
+
% \usemodule[newmml]
% \usemodule[newmml][a=b]
% \usemodule[x][newmml]
@@ -235,7 +202,7 @@
\let\stopmoduletestsection\donothing
-\def\startmoduletestsection
+\unexpanded\def\startmoduletestsection
{\bgroup
\setupmodule % we need to make sure that the vars are set
\doifelse{\currentmoduleparameter\v!test}\v!yes
@@ -306,7 +273,7 @@
\def\documentresources{\@@erurl}
-\def\setupexternalresources
+\unexpanded\def\setupexternalresources
{\dodoubleargument\getparameters[\??er]}
\setupexternalresources
diff --git a/Master/texmf-dist/tex/context/base/core-fnt.mkiv b/Master/texmf-dist/tex/context/base/core-fnt.mkiv
index e6573985835..a7c84a5a093 100644
--- a/Master/texmf-dist/tex/context/base/core-fnt.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-fnt.mkiv
@@ -123,8 +123,7 @@
\def\textskip
{\scratchdimen\stretchedspaceamount
\hskip\stretchedspacefactor\scratchdimen}%
- \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA
- \textskip\@EA{\textstring}%
+ \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA\textskip\@EA{\textstring}%
\fi
\egroup}
@@ -152,173 +151,6 @@
\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=\underbarlevel\dimexpr\@@onbottomoffset\relax
- \ifdone \else
- \advance\dimen0 -\strutht
- \fi
- \dimen2\dimexpr\dimen0+\@@onrulethickness\relax
- \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\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=\dimexpr\dimen0+\@@onrulethickness\relax
- \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
@@ -436,7 +268,7 @@
% to do: more fine tuning
-\def\setupinitial
+\unexpanded\def\setupinitial
{\dodoubleempty\getparameters[\??dc]}
\definefontsynonym[Initial][Regular] % prefered initial identifier
@@ -452,19 +284,10 @@
\def\AutoDroppedCapsCommand{\NiceDroppedCaps\@@dccommand\@@dcfont\@@dcdistance\@@dcn}%
-\def\placeinitial
+\unexpanded\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/core-grd.mkiv b/Master/texmf-dist/tex/context/base/core-grd.mkiv
deleted file mode 100644
index d6cc93735cb..00000000000
--- a/Master/texmf-dist/tex/context/base/core-grd.mkiv
+++ /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 / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / 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]
-
-\let\thetopbaselinecorrection \!!zeropoint
-\let\thebotbaselinecorrection \!!zeropoint
-\let\thenegtopbaselinecorrection\!!zeropoint
-\let\thenegbotbaselinecorrection\!!zeropoint
-
-\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
- {\setlayoutcomponentattribute\v!grid\v!test
- \hbox \layoutcomponentboxattribute
- {\infofont
- \global\advance\currentgridsnap\plusone
- \color[grid:three]
- {\vl\presnapskip
- \vl\presnap
- \vl\postsnap
- \ifcase\@@alignsnapbox\relax\vl\ifcase\@@extrasnap00\or\extrasnapsign0\or\extrasnapsign\extrasnapsign\or0\extrasnapsign\fi\fi
- \vl\the\currentgridsnap\vl}}}%
- \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
- {\setlayoutcomponentattribute\v!grid\v!test
- \color[grid:#2]{\ruledhbox \layoutcomponentboxattribute {\fakebox\nextbox}}%
- \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%
- {\startcolor[grid:four]%
- \setlayoutcomponentattribute\v!grid\v!test
- \hbox \layoutcomponentboxattribute{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}%
- \stopcolor}
-
-\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/core-ini.mkiv b/Master/texmf-dist/tex/context/base/core-ini.mkiv
index a01abdd1117..d6a72bb2614 100644
--- a/Master/texmf-dist/tex/context/base/core-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-ini.mkiv
@@ -53,7 +53,7 @@
\appendtoks \removeunwantedspaces \to \everyendofpar
%appendtoks \strut \to \everyendofpar % option ?
\appendtoks \flushsyncresets \to \everyendofpar
-\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf
+%appendtoks \setlastlinewidth \to \everyendofpar % gone, will be done in lua
\appendtoks \endgraf \to \everyendofpar
% Todo: verbatim, xml, tex, move code to here
diff --git a/Master/texmf-dist/tex/context/base/core-job.lua b/Master/texmf-dist/tex/context/base/core-job.lua
index fb4f76de15c..d557818bb35 100644
--- a/Master/texmf-dist/tex/context/base/core-job.lua
+++ b/Master/texmf-dist/tex/context/base/core-job.lua
@@ -1,30 +1,35 @@
if not modules then modules = { } end modules ['core-job'] = {
version = 1.001,
- comment = "companion to core-job.tex",
+ comment = "companion to core-job.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-local texsprint, texprint, format, find, gmatch = tex.sprint, tex.print, string.format, string.find, string.gmatch
-
-local ctxcatcodes = tex.ctxcatcodes
-local texcatcodes = tex.texcatcodes
+local texsprint, texprint, texwrite = tex.sprint, tex.print, tex.write
+local ctxcatcodes, texcatcodes = tex.ctxcatcodes, tex.texcatcodes
+local lower, format, find, gmatch, gsub, match = string.lower, string.format, string.find, string.gmatch, string.gsub, string.match
+local concat = table.concat
-- main code
-function resolvers.findctxfile(name,maxreadlevel)
- local function exists(n)
+resolvers.maxreadlevel = 3
+
+directives.register("resolvers.maxreadlevel", function(v) resolvers.maxreadlevel = tonumber(v) or resolvers.maxreadlevel end)
+
+local function exists(n)
+ if io.exists(n) then
+ return n
+ else
+ n = file.addsuffix(n,'tex')
if io.exists(n) then
return n
- else
- n = file.addsuffix(n,'tex')
- if io.exists(n) then
- return n
- end
end
- return nil
end
+ return nil
+end
+
+function resolvers.findctxfile(name,maxreadlevel)
if file.is_qualified_path(name) then
return name
else
@@ -34,7 +39,7 @@ function resolvers.findctxfile(name,maxreadlevel)
if found then
return found
else
- for i=1,maxreadlevel or 0 do
+ for i=1,maxreadlevel or resolvers.maxreadlevel or 0 do
n = "../" .. n
found = exists(n)
if found then
@@ -46,6 +51,10 @@ function resolvers.findctxfile(name,maxreadlevel)
end
end
+function commands.maxreadlevel()
+ texwrite(resolvers.maxreadlevel)
+end
+
function commands.processfile(name,maxreadlevel)
name = resolvers.findctxfile(name,maxreadlevel)
if name ~= "" then
@@ -63,12 +72,12 @@ end
function commands.usepath(paths,maxreadlevel)
resolvers.register_extra_path(paths)
- texsprint(texcatcodes,table.concat(resolvers.instance.extra_paths or {}, ""))
+ texsprint(texcatcodes,concat(resolvers.instance.extra_paths or {}, ""))
end
function commands.usesubpath(subpaths,maxreadlevel)
resolvers.register_extra_path(nil,subpaths)
- texsprint(texcatcodes,table.concat(resolvers.instance.extra_paths or {}, ""))
+ texsprint(texcatcodes,concat(resolvers.instance.extra_paths or {}, ""))
end
function commands.usezipfile(name,tree)
@@ -89,16 +98,15 @@ end
local function convertexamodes(str)
local x = xml.convert(str)
- for e, d, k in xml.elements(x,"exa:variable") do
- local dk = d[k]
- local label = dk.at and dk.at.label
+ for e in xml.collected(x,"exa:variable") do
+ local label = e.at and e.at.label
if label and label ~= "" then
- local data = xml.content(dk) or ""
- local mode = label:match("^mode:(.+)$")
+ local data = xml.text(e)
+ local mode = match(label,"^mode:(.+)$")
if mode then
texsprint(ctxcatcodes,format("\\enablemode[%s:%s]",mode,data))
end
- texsprint(ctxcatcodes,format("\\setvariable{exa:variables}{%s}{%s}",label,data:gsub("([{}])","\\%1")))
+ texsprint(ctxcatcodes,format("\\setvariable{exa:variables}{%s}{%s}",label,gsub(data,"([{}])","\\%1")))
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/core-job.mkii b/Master/texmf-dist/tex/context/base/core-job.mkii
index a8a753e0db2..5c280c15b14 100644
--- a/Master/texmf-dist/tex/context/base/core-job.mkii
+++ b/Master/texmf-dist/tex/context/base/core-job.mkii
@@ -203,6 +203,11 @@
\expandafter\finalend
\fi}
+\def\forcequitjob#1%
+ {\writestatus\m!systems{forcing quit: #1}%
+ \batchmode
+ \dorecurse\textlevel\stoptext
+ \normalend}
\let\autostoptext\relax
diff --git a/Master/texmf-dist/tex/context/base/core-job.mkiv b/Master/texmf-dist/tex/context/base/core-job.mkiv
index 7231ac383c1..de328c92bca 100644
--- a/Master/texmf-dist/tex/context/base/core-job.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-job.mkiv
@@ -51,9 +51,9 @@
\def\processlocalfile#1#2%
{#1{#2}\donothing{\readfile{#2}\donothing\donothing}}
-\def\processfile #1{\ctxlua{commands.processfile("#1",\number\maxreadlevel)}}
-\def\doifinputfileelse #1{\ctxlua{commands.doifinputfileelse("#1",\number\maxreadlevel)}}
-\def\locatefilepath #1{\edef\locatedfilepath{\ctxlua{commands.locatefilepath("#1",\number\maxreadlevel)}}}
+\def\processfile #1{\ctxlua{commands.processfile("#1")}}
+\def\doifinputfileelse #1{\ctxlua{commands.doifinputfileelse("#1")}}
+\def\locatefilepath #1{\edef\locatedfilepath{\ctxlua{commands.locatefilepath("#1")}}}
\def\usepath [#1]{\edef\allinputpaths{\ctxlua{commands.usepath("#1")}}}
\def\usesubpath [#1]{\edef\allinputpaths{\ctxlua{commands.usesubpath("#1")}}}
\def\usezipfile {\dodoubleempty\dousezipfile}
@@ -114,24 +114,34 @@
{\the\everystarttext
\global\everystarttext\emptytoks}
-\def\starttext
+\unexpanded\def\starttext
{\doateverystarttext
\ifcase\textlevel
- \registerfileinfo[begin]\jobname
+ \registerfileinfo[begin]\jobfilename
\fi
\global\advance\textlevel\plusone}
-\def\stoptext
+\unexpanded\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
+ \flushfinallayoutpage % optional
+ \page % anyway
\the\everystoptext
%\the\everybye %
%\the\everygoodbye % == \end (new)
%\expandafter\normalend %
+\ifcase\textlevel
+ \registerfileinfo[end]\jobfilename
+\fi
\expandafter\finalend
\fi}
+\def\forcequitjob#1%
+ {\writestatus\m!systems{forcing quit: #1}%
+ \batchmode
+ \dorecurse\textlevel{\stoptext}
+ \normalend}
+
\let\autostoptext\relax
\def\autostarttext
@@ -181,7 +191,7 @@
\def\environment #1 % at outermost level only (load only once)
{\pushmacro\startenvironment
\pushmacro\stopenvironment
- \def\startenvironment ##1 {}%
+ \unexpanded\def\startenvironment ##1 {}%
\let\stopenvironment\relax
\startreadingfile
\doexecutefileonce{#1}
@@ -232,24 +242,24 @@
\expandafter\endinput
\fi}
-\def\startproject #1 %
+\unexpanded\def\startproject #1 %
{\donextlevel\v!project\currentproject
\donotexecutefile\doexecutefileonce
\doexecutefileonce\doexecutefile#1\\}
-\def\startproduct #1 %
+\unexpanded\def\startproduct #1 %
{\doateverystarttext
\donextlevel\v!product\currentproduct
\doexecutefileonce\doexecutefileonce
\donotexecutefile\doexecutefile#1\\}
-\def\startcomponent #1 %
+\unexpanded\def\startcomponent #1 %
{\doateverystarttext
\donextlevel\v!component\currentcomponent
\doexecutefileonce\doexecutefileonce
\donotexecutefile\doexecutefile#1\\}
-\def\startenvironment #1 %
+\unexpanded\def\startenvironment #1 %
{\donextlevel\v!environment\currentenvironment
\donotexecutefile\doexecutefileonce
\donotexecutefile\donotexecutefile#1\\}
@@ -259,10 +269,10 @@
% 2: \startmode[*product] product \stopmode \endgraf
% \stopproject
-\def\stopproject {\doprevlevel}
-\def\stopproduct {\doprevlevel}
-\def\stopcomponent {\doprevlevel}
-\def\stopenvironment{\doprevlevel}
+\unexpanded\def\stopproject {\doprevlevel}
+\unexpanded\def\stopproduct {\doprevlevel}
+\unexpanded\def\stopcomponent {\doprevlevel}
+\unexpanded\def\stopenvironment{\doprevlevel}
% more or less replaced by modes
@@ -295,21 +305,5 @@
% \appendtoks \flushnotes \to \everydisplay
% \appendtoks \adjustsidefloatdisplaylines \to \everydisplay
-
-\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}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-mis.mkiv b/Master/texmf-dist/tex/context/base/core-mis.mkiv
index 65cf273c620..e2bd28bd511 100644
--- a/Master/texmf-dist/tex/context/base/core-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-mis.mkiv
@@ -169,7 +169,7 @@
\noindent\hbox{\box0\hskip-\wd2\box2}%
\dostopitems}
-\def\setupitems
+\unexpanded\def\setupitems
{\dosingleargument\dosetupitems}
\def\complexitems[#1]%
@@ -217,10 +217,10 @@
#2]%
\setvalue{\e!place#1}{\doplacement[\??pl#1]}}
-\def\defineplacement
+\unexpanded\def\defineplacement
{\dodoubleempty\dodefineplacement}
-\def\setupplacement
+\unexpanded\def\setupplacement
{\dodoubleempty\dosetupplacement}
\def\dosetupplacement[#1]%
@@ -334,7 +334,7 @@
\c!color=\paragraphparameter\c!color]}%
\setupparagraphs[\currentparagraph][1][\c!distance=\zeropoint]}
-\def\defineparagraphs
+\unexpanded\def\defineparagraphs
{\dodoubleargument\dodefineparagraphs}
\def\dosetupparagraphs[#1][#2][#3]%
@@ -352,7 +352,7 @@
\getparameters[\??al][#1]%
\fi}
-\def\setupparagraphs
+\unexpanded\def\setupparagraphs
{\dotripleempty\dosetupparagraphs}
\setupparagraphs
@@ -502,7 +502,7 @@
\c!before=\@@tabefore,
\c!after=\@@taafter]}
-\def\setuptab
+\unexpanded\def\setuptab
{\dosingleargument\dosetuptab}
\setuptab
@@ -618,12 +618,12 @@
%
% obsolete:
-\def\setuphyphenmark
+\unexpanded\def\setuphyphenmark
{\dodoubleargument\getparameters[\??kp]}
-\def\setuphyphenmark[#1]% sign=normal|wide
+\unexpanded\def\setuphyphenmark[#1]% sign=normal|wide
{\dodoubleargument\getparameters[\??kp][#1]%
- \doifinsetelse\@@kpsign {\v!normal}
+ \doifelse\@@kpsign {\v!normal}% was inset?
{\let\textmodehyphen\normalhyphen \let\textmodehyphendiscretionary\normalhyphendiscretionary}
{\let\textmodehyphen\composedhyphen\let\textmodehyphendiscretionary\composedhyphendiscretionary}}
@@ -642,14 +642,14 @@
\def\normalhyphendiscretionary
{\discretionary
- {\hbox{\directsymbol\empty\c!lefthyphen}}
{\hbox{\directsymbol\empty\c!righthyphen}}
+ {\hbox{\directsymbol\empty\c!lefthyphen}}
{\hbox{\directsymbol\empty\c!hyphen}}}
\def\composedhyphendiscretionary
{\discretionary
- {\hbox{\directsymbol\empty\c!leftcompoundhyphen}}
{\hbox{\directsymbol\empty\c!rightcompoundhyphen}}
+ {\hbox{\directsymbol\empty\c!leftcompoundhyphen}}
{\hbox{\directsymbol\empty\c!compoundhyphen}}}
\let\textmodehyphen \composedhyphen
@@ -739,8 +739,8 @@
%D \typebuffer
%D \getbuffer
-\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing}
-\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence}
+\unexpanded\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing}
+\unexpanded\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence}
%D \defineXMLenvironment [subsentence]
%D {|<|}
@@ -819,7 +819,7 @@
\def\doinitializetextlevel#1%
{\ifcsname\??ci:#1:\c!level\endcsname
- \newcount\csname\??ci:#1:\c!level\endcsname\zerocount
+ \csname\??ci:#1:\c!level\endcsname\zerocount
\else
\expandafter\newcount\csname\??ci:#1:\c!level\endcsname
\fi}
@@ -829,7 +829,7 @@
{\executeifdefined{\??ci\currentdelimitedtext#1}%
{\executeifdefined{\??ci#1}\empty}}}
-\def\definedelimitedtext
+\unexpanded\def\definedelimitedtext
{\dodoubleempty\dodefinedelimitedtext}
\def\dodefinedelimitedtext[#1][#2]%
@@ -859,11 +859,11 @@
\c!leftmargin,\c!rightmargin,\c!indentnext,
\c!before,\c!after,\c!left,\c!right]}}%
\doifsomething{#1}
- {\unexpanded\setvalue{#1}{\delimitedtext[#1]}%
+ {\setuvalue{#1}{\delimitedtext[#1]}%
\setvalue{\e!start#1}{\startdelimitedtext[#1]}%
\setvalue{\e!stop #1}{\stopdelimitedtext}}}
-\def\setupdelimitedtext
+\unexpanded\def\setupdelimitedtext
{\dotripleargument\dosetupdelimitedtext}
\def\dosetupdelimitedtext[#1][#2][#3]% #2 = optional level
@@ -882,7 +882,7 @@
\let\dohandlerepeatdelimitedtext\relax
-\def\startdelimitedtext[#1]%
+\unexpanded\def\startdelimitedtext[#1]%
{\bgroup
\pushdelimitedtext{#1}%
\doifelse{\delimitedtextparameter\c!method}\s!font
@@ -895,6 +895,39 @@
\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\dostartdelimitedtextpar[#1]%
{\let\dostopdelimitedtext\dostopdelimitedtextpar
\doifsomething{\delimitedtextparameter\c!spacebefore}
@@ -912,6 +945,9 @@
{\startnarrower[#1]\let\dodostopdelimitedtextpar\stopnarrower}%
% so far
% \dochecknextindentation{\??ci\currentdelimitedtext}% AM: not here
+ \pushmacro\checkindentation
+ \doifsomething{\delimitedtextparameter\c!indenting} % WS
+ {\setupindenting[\delimitedtextparameter\c!indenting]}%
\dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty
\leftdelimitedtextmark
\ignorespaces}
@@ -921,6 +957,7 @@
\removelastskip
\rightdelimitedtextmark
\dostopattributes
+ \popmacro\checkindentation
\dodostopdelimitedtextpar
\delimitedtextparameter\c!after
\doifsomething{\delimitedtextparameter\c!spaceafter}
@@ -939,7 +976,7 @@
\dohandlerightdelimitedtext\c!right
\dostopattributes}
-\def\stopdelimitedtext
+\unexpanded\def\stopdelimitedtext
{\dostopdelimitedtext
\popdelimitedtext
\egroup}
@@ -963,8 +1000,8 @@
% shortcuts
-\def\startdelimited{\startdelimitedtext}
-\def\stopdelimited {\stopdelimitedtext} % no let, dynamically assigned
+\unexpanded\def\startdelimited{\startdelimitedtext}
+\unexpanded\def\stopdelimited {\stopdelimitedtext} % no let, dynamically assigned
\def\delimited {\delimitedtext}
\def\leftdelimitedtextmark
@@ -1160,8 +1197,8 @@
% [\c!indentnext=\v!no,
% \c!spacebefore=\v!nowhite]
-\def\setupquotation{\setupdelimitedtext[\v!quotation]}
-\def\setupquote {\setupdelimitedtext[\v!quote]}
+\unexpanded\def\setupquotation{\setupdelimitedtext[\v!quotation]}
+\unexpanded\def\setupquote {\setupdelimitedtext[\v!quote]}
% seldom used, move from kernel to run time module
@@ -1320,7 +1357,7 @@
%
% \definesystemvariable{ri}
%
-% \def\setuprows
+% \unexpanded\def\setuprows
% {\dodoubleargument\getparameters[\??ri]}
%
% \definecomplexorsimpleempty\startrows
@@ -1343,7 +1380,7 @@
% \bgroup
% \row}
%
-% \def\stoprows
+% \unexpanded\def\stoprows
% {\do@@ribottom
% \egroup
% \egroup}
@@ -1556,7 +1593,7 @@
\newbox\firstpairedbox
\newbox\secondpairedbox
-\def\definepairedbox
+\unexpanded\def\definepairedbox
{\dodoubleempty\dodefinepairedbox}
\def\dodefinepairedbox[#1][#2]%
@@ -1580,13 +1617,13 @@
\setvalue{\e!setup#1\e!endsetup}{\setuppairedbox[#1]}%
\setvalue{\e!place#1}{\placepairedbox[#1]}}
-\def\setuppairedbox
+\unexpanded\def\setuppairedbox
{\dodoubleempty\dosetuppairedbox}
\def\dosetuppairedbox[#1]%
{\getparameters[\??ld#1]}
-\def\placepairedbox
+\unexpanded\def\placepairedbox
{\bgroup\dodoubleempty\doplacepairedbox}
\def\doplacepairedbox[#1][#2]% watch the hsize/vsize tricks
@@ -1736,10 +1773,12 @@
% todo: \startcombination \startcomb \stopcomb ...
+% needs to be mkiv'd
+
\newcount\horcombination % counter
\newcount\totcombination
-\def\definecombination
+\unexpanded\def\definecombination
{\dodoubleempty\dodefinecombination}
\def\dodefinecombination[#1][#2]%
@@ -1751,7 +1790,7 @@
\getparameters
[\??co#1][#2]}
-\def\setupcombinations
+\unexpanded\def\setupcombinations
{\dodoubleempty\dosetupcombinations}
\def\dosetupcombinations[#1][#2]%
@@ -1764,7 +1803,7 @@
\def\combinationparameter#1%
{\csname\??co\currentcombination#1\endcsname}%
-\def\startcombination
+\unexpanded\def\startcombination
{\bgroup % so we can grab a group
\dodoubleempty\dostartcombination}
@@ -1882,20 +1921,20 @@
% formally ok:
%
-% \def\stopcombination
+% \unexpanded\def\stopcombination
% {\egroup
% \egroup}
%
% more robust:
%
-% \def\stopcombination
+% \unexpanded\def\stopcombination
% {{}{}{}{}{}{}{}{}% catches (at most 4) missing entries
% \egroup
% \egroup}
%
% even better:
-\def\stopcombination
+\unexpanded\def\stopcombination
{{\scratchtoks{{}{}{}}\dorecurse\totcombination{\appendtoks{}{}{}{}\to\scratchtoks}\expandafter}\the\scratchtoks
\egroup
\egroup}
@@ -1966,7 +2005,7 @@
%D
%D \typebuffer \getbuffer
-\def\startfloatcombination
+\unexpanded\def\startfloatcombination
{\dodoubleempty\dostartfloatcombination}
\def\dostartfloatcombination[#1][#2]%
@@ -1974,7 +2013,7 @@
%\insidecolumnstrue % trick, forces no centering, todo: proper switch/feature
\chardef\postcenterfloatmethod\zerocount
\forcelocalfloats
- \def\stopfloatcombination
+ \unexpanded\def\stopfloatcombination
{\scratchtoks\emptytoks
\dorecurse\noflocalfloats
{\appendetoks{\noexpand\getlocalfloat{\recurselevel}}{}\to\scratchtoks}%
@@ -1982,7 +2021,7 @@
\resetlocalfloats
\egroup}}
-\def\placerelativetoeachother#1#2%
+\unexpanded\def\placerelativetoeachother#1#2%
{\bgroup
\dowithnextbox
{\bgroup
@@ -1995,8 +2034,8 @@
\hbox}
\hbox}
-\def\placeontopofeachother{\placerelativetoeachother\halign\hss}
-\def\placesidebyside {\placerelativetoeachother\valign\vss}
+\unexpanded\def\placeontopofeachother{\placerelativetoeachother\halign\hss}
+\unexpanded\def\placesidebyside {\placerelativetoeachother\valign\vss}
%D A couple of examples, demonstrating how the depth is
%D taken care of:
@@ -2217,7 +2256,7 @@
\presetlocalframed[\??ro]
-\def\setuprotate
+\unexpanded\def\setuprotate
{\dodoubleargument\getparameters[\??ro]}
\setuprotate
@@ -2255,7 +2294,7 @@
\def\??fr{@@fr}
-\def\setuphorizontaldivision
+\unexpanded\def\setuphorizontaldivision
{\dodoubleargument\getparameters[\??fr]}
\def\horizontaldivision
diff --git a/Master/texmf-dist/tex/context/base/core-spa.lua b/Master/texmf-dist/tex/context/base/core-spa.lua
deleted file mode 100644
index ab08755cc66..00000000000
--- a/Master/texmf-dist/tex/context/base/core-spa.lua
+++ /dev/null
@@ -1,720 +0,0 @@
-if not modules then modules = { } end modules ['core-spa'] = {
- version = 1.001,
- comment = "companion to core-spa.tex",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- this code dates from the beginning and is kind of experimental; it
--- will be optimized and improved soon
-
-local next, type = next, type
-local format, gmatch, concat = string.format, string.gmatch, table.concat
-local texsprint, texlists = tex.sprint, tex.lists
-
-local ctxcatcodes = tex.ctxcatcodes
-
--- vertical space handler
-
-local trace_vbox_vspacing = false trackers.register("nodes.vbox_vspacing", function(v) trace_vbox_vspacing = v end)
-local trace_page_vspacing = false trackers.register("nodes.page_vspacing", function(v) trace_page_vspacing = v end)
-local trace_collect_vspacing = false trackers.register("nodes.collect_vspacing", function(v) trace_collect_vspacing = v end)
-local trace_vspacing = false trackers.register("nodes.vspacing", function(v) trace_vspacing = v end)
-
-local skip_category = attributes.private('skip-category')
-local skip_penalty = attributes.private('skip-penalty')
-local skip_order = attributes.private('skip-order')
-local snap_category = attributes.private('snap-category')
-local display_math = attributes.private('display-math')
-
-local has_attribute = node.has_attribute
-local unset_attribute = node.unset_attribute
-local set_attribute = node.set_attribute
-local find_node_tail = node.tail
-local free_node = node.free
-local copy_node = node.copy
-local traverse_nodes = node.traverse
-local insert_node_before = node.insert_before
-local insert_node_after = node.insert_after
-local remove_node = nodes.remove
-local make_penalty_node = nodes.penalty
-local count_nodes = nodes.count
-local node_ids_to_string = nodes.ids_to_string
-local hpack_node = node.hpack
-
-local glyph = node.id("glyph")
-local penalty = node.id("penalty")
-local kern = node.id("kern")
-local glue = node.id('glue')
-local hlist = node.id('hlist')
-local vlist = node.id('vlist')
-local adjust = node.id('adjust')
-
-vspacing = vspacing or { }
-
-vspacing.categories = {
- [0] = 'discard',
- [1] = 'largest',
- [2] = 'force' ,
- [3] = 'penalty',
- [4] = 'add' ,
- [5] = 'disable',
- [6] = 'nowhite',
- [7] = 'goback',
-}
-
-local categories = vspacing.categories
-
-function vspacing.tocategories(str)
- local t = { }
- for s in gmatch(str,"[^, ]") do
- local n = tonumber(s)
- if n then
- t[categories[n]] = true
- else
- t[b] = true
- end
- end
- return t
-end
-
-function vspacing.tocategory(str)
- if type(str) == "string" then
- return set.tonumber(vspacing.tocategories(str))
- else
- return set.tonumber({ [categories[str]] = true })
- end
-end
-
-vspacing.data = vspacing.data or { }
-vspacing.data.map = vspacing.data.map or { }
-vspacing.data.skip = vspacing.data.skip or { }
-
-storage.register("vspacing/data/map", vspacing.data.map, "vspacing.data.map")
-storage.register("vspacing/data/skip", vspacing.data.skip, "vspacing.data.skip")
-
-do -- todo: interface.variables
-
- local function logger(c,s)
- logs.report("vspacing",s)
- texsprint(c,s)
- end
-
- vspacing.fixed = false
-
- local map = vspacing.data.map
- local skip = vspacing.data.skip
-
- local multiplier = lpeg.C(lpeg.S("+-")^0 * lpeg.R("09")^1) * lpeg.P("*")
- local category = lpeg.P(":") * lpeg.C(lpeg.P(1)^1)
- local keyword = lpeg.C((1-category)^1)
- local splitter = (multiplier + lpeg.Cc(1)) * keyword * (category + lpeg.Cc(false))
-
- local function analyse(str,oldcategory,texsprint)
- for s in gmatch(str,"([^ ,]+)") do
- local amount, keyword, detail = splitter:match(s)
- if keyword then
- local mk = map[keyword]
- if mk then
- category = analyse(mk,category,texsprint)
- elseif keyword == "fixed" then
- texsprint(ctxcatcodes,"\\fixedblankskip")
- elseif keyword == "flexible" then
- texsprint(ctxcatcodes,"\\flexibleblankskip")
- elseif keyword == "category" then
- local category = tonumber(detail)
- if category then
- texsprint(ctxcatcodes,format("\\setblankcategory{%s}",category))
- if category ~= oldcategory then
- texsprint(ctxcatcodes,"\\flushblankhandling")
- oldcategory = category
- end
- end
- elseif keyword == "order" and detail then
- local order = tonumber(detail)
- if order then
- texsprint(ctxcatcodes,format("\\setblankorder{%s}",order))
- end
- elseif keyword == "penalty" and detail then
- local penalty = tonumber(detail)
- if penalty then
- texsprint(ctxcatcodes,format("\\setblankpenalty{%s}",penalty))
- texsprint(ctxcatcodes,"\\flushblankhandling")
- end
- else
- amount = tonumber(amount) or 1
- local sk = skip[keyword]
- if sk then
- texsprint(ctxcatcodes,format("\\addblankskip{%s}{%s}{%s}",amount,sk[1],sk[2] or sk[1]))
- else -- no check
- texsprint(ctxcatcodes,format("\\addblankskip{%s}{%s}{%s}",amount,keyword,keyword))
- end
- end
- else
- logs.report("vspacing","unknown directive: %s",s)
- end
- end
- return category
- end
-
- function vspacing.analyse(str)
- local texsprint = (trace_vspacing and logger) or texsprint
- texsprint(ctxcatcodes,"\\startblankhandling")
- analyse(str,1,texsprint)
- texsprint(ctxcatcodes,"\\stopblankhandling")
- end
-
- --
-
- function vspacing.setmap(from,to)
- map[from] = to
- end
-
- function vspacing.setskip(key,value,grid)
- if value ~= "" then
- if grid == "" then grid = value end
- skip[key] = { value, grid }
- end
- end
-
-end
-
--- implementation
-
-nodes.snapvalues = { }
-
-function nodes.setsnapvalue(n,ht,dp)
- nodes.snapvalues[n] = { ht, dp, ht+dp }
-end
-
-local trace_list, tracing_info, before, after = { }, false, "", ""
-
-local function glue_to_string(glue)
- local spec = glue.spec
- if spec then
- local t = { }
- t[#t+1] = aux.strip_zeros(number.topoints(spec.width))
- if spec.stretch_order and spec.stretch_order ~= 0 then
- t[#t+1] = format("plus -%sfi%s",spec.stretch/65536,string.rep("l",math.abs(spec.stretch_order)-1))
- elseif spec.stretch and spec.stretch ~= 0 then
- t[#t+1] = format("plus %s",aux.strip_zeros(number.topoints(spec.stretch)))
- end
- if spec.shrink_order and spec.shrink_order ~= 0 then
- t[#t+1] = format("minus -%sfi%s",spec.shrink/65536,string.rep("l",math.abs(spec.shrink_order)-1))
- elseif spec.shrink and spec.shrink ~= 0 then
- t[#t+1] = format("minus %s",aux.strip_zeros(number.topoints(spec.shrink)))
- end
- return concat(t," ")
- else
- return "[0pt]"
- end
-end
-
-local function nodes_to_string(head)
- local current, t = head, { }
- while current do
- local id = current.id
- local ty = node.type(id)
- if id == penalty then
- t[#t+1] = format("%s:%s",ty,current.penalty)
- elseif id == glue then
- if current.spec then
- t[#t+1] = format("%s:%s",ty,aux.strip_zeros(number.topoints(current.spec.width)))
- else
- t[#t+1] = format("%s:[0pt]",ty)
- end
- elseif id == kern then
- t[#t+1] = format("%s:%s",ty,aux.strip_zeros(number.topoints(current.kern)))
- else
- t[#t+1] = ty
- end
- current = current.next
- end
- return concat(t," + ")
-end
-
-local function reset_tracing(head)
- trace_list, tracing_info, before, after = { }, false, nodes_to_string(head), ""
-end
-
-local function trace_skip(str,sc,so,sp,data)
- trace_list[#trace_list+1] = { "skip", format("%s | %s | category %s | order %s | penalty %s", str, glue_to_string(data), sc or "-", so or "-", sp or "-") }
- tracing_info = true
-end
-
-local function trace_natural(str,data)
- trace_list[#trace_list+1] = { "skip", format("%s | %s", str, glue_to_string(data)) }
- tracing_info = true
-end
-
-local function trace_info(message, where, what)
- trace_list[#trace_list+1] = { "info", format("%s: %s/%s",message,where,what) }
-end
-
-local function trace_node(what)
- local nt = node.type(what.id)
- local tl = trace_list[#trace_list]
- if tl[1] == "node" then
- trace_list[#trace_list] = { "node", tl[2] .. " + " .. nt }
- else
- trace_list[#trace_list+1] = { "node", nt }
- end
-end
-
-local function trace_done(str,data)
- if data.id == penalty then
- trace_list[#trace_list+1] = { "penalty", format("%s | %s", str, data.penalty) }
- else
- trace_list[#trace_list+1] = { "glue", format("%s | %s", str, glue_to_string(data)) }
- end
- tracing_info = true
-end
-
-local function show_tracing(head)
- if tracing_info then
- after = nodes_to_string(head)
- for i=1,#trace_list do
- local tag, text = unpack(trace_list[i])
- if tag == "info" then
- logs.report("collapse",text)
- else
- logs.report("collapse"," %s: %s",tag,text)
- end
- end
- logs.report("collapse","before: %s",before)
- logs.report("collapse","after : %s",after)
- end
-end
-
--- alignment box begin_of_par vmode_par hmode_par insert penalty before_display after_display
-
-local user_skip = 0
-local line_skip = 1
-local baseline_skip = 2
-local par_skip = 3
-local above_display_skip = 4
-local below_display_skip = 5
-local above_display_short_skip = 6
-local below_display_short_skip = 7
-local left_skip_code = 8
-local right_skip_code = 9
-local top_skip_code = 10
-local split_top_skip_code = 11
-local tab_skip_code = 12
-local space_skip_code = 13
-local xspace_skip_code = 14
-local par_fill_skip_code = 15
-local thin_mu_skip_code = 16
-local med_mu_skip_code = 17
-local thick_mu_skip_code = 18
-
-local skips = {
- [ 0] = "user_skip",
- [ 1] = "line_skip",
- [ 2] = "baseline_skip",
- [ 3] = "par_skip",
- [ 4] = "above_display_skip",
- [ 5] = "below_display_skip",
- [ 6] = "above_display_short_skip",
- [ 7] = "below_display_short_skip",
- [ 8] = "left_skip_code",
- [ 9] = "right_skip_code",
- [10] = "top_skip_code",
- [11] = "split_top_skip_code",
- [12] = "tab_skip_code",
- [13] = "space_skip_code",
- [14] = "xspace_skip_code",
- [15] = "par_fill_skip_code",
- [16] = "thin_mu_skip_code",
- [17] = "med_mu_skip_code",
- [18] = "thick_mu_skip_code",
-}
-
-local free_glue_node = free_node
-local free_glue_spec = free_node
-local discard, largest, force, penalty, add, disable, nowhite, goback = 0, 1, 2, 3, 4, 5, 6, 7
-
-local function collapser(head,where,what,trace) -- maybe also pass tail
- if trace then
- reset_tracing(head)
- trace_info("start analyzing",where,what)
- end
- local current = head
- local glue_order, glue_data = 0, nil
- local penalty_order, penalty_data, natural_penalty = 0, nil, nil
- local parskip, ignore_parskip, ignore_following, ignore_whitespace = nil, false, false, false
- while current do
- local id = current.id
- if id == glue and current.subtype == 0 then -- todo, other subtypes, like math
- local sc = has_attribute(current,skip_category) -- has no default, no unset (yet)
- local so = has_attribute(current,skip_order ) or 1 -- has 1 default, no unset (yet)
- local sp = has_attribute(current,skip_penalty ) -- has no degault, no unset (yet)
- if not sc then
- if glue_data then
- if trace then trace_done("flush",glue_data) end
- head, current = nodes.before(head,current,glue_data)
- if trace then trace_natural("natural",current) end
- else
- -- not look back across head
- local previous = current.prev
- if previous and previous.id == glue and previous.subtype == 0 then
- local ps = previous.spec
- if ps then
- local cs = current.spec
- if cs and ps.stretch_order == 0 and ps.shrink_order == 0 and cs.stretch_order == 0 and cs.shrink_order == 0 then
- local pw, pp, pm = ps.width, ps.stretch, ps.shrink
- local cw, cp, cm = cs.width, cs.stretch, cs.shrink
- ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm
- if trace then trace_natural("removed",current) end
- head, current = remove_node(head, current, true)
- current = previous
- if trace then trace_natural("collapsed",current) end
- else
- if trace then trace_natural("filler",current) end
- end
- else
- if trace then trace_natural("natural (no prev spec)",current) end
- end
- else
- if trace then trace_natural("natural (no prev)",current) end
- end
- end
- glue_order, glue_data = 0, nil
- if current then
- current = current.next
- end
- else
- if sc == disable then
- ignore_following = true
- if trace then trace_skip("disable",sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- elseif sc == nowhite then
- ignore_whitespace = true
- head, current = remove_node(head, current, true)
- elseif sc == discard then
- if trace then trace_skip("discard",sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- else
- if sp then
- if not penalty_data then
- penalty_data = sp
- elseif penalty_order < so then
- penalty_order, penalty_data = so, sp
- elseif penalty_order == so and sp > penalty_data then
- penalty_data = sp
- end
- end
- if ignore_following then
- if trace then trace_skip("disabled",sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- elseif not glue_data then
- if trace then trace_skip("assign",sc,so,sp,current) end
- glue_order = so
- head, current, glue_data = remove_node(head, current)
- elseif glue_order < so then
- if trace then trace_skip("force",sc,so,sp,current) end
- glue_order = so
- free_glue_node(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
- if sc == largest then
- local cs, gs = current.spec, glue_data.spec
- local cw = (cs and cs.width) or 0
- local gw = (gs and gs.width) or 0
- if cw > gw then
- if trace then trace_skip('largest',sc,so,sp,current) end
- free_glue_node(glue_data) -- also free spec
- head, current, glue_data = remove_node(head, current)
- else
- if trace then trace_skip('remove smallest',sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- end
- elseif sc == goback then
- if trace then trace_skip('goback',sc,so,sp,current) end
- free_glue_node(glue_data) -- also free spec
- head, current, glue_data = remove_node(head, current)
- elseif sc == force then
- -- todo: inject kern
- if trace then trace_skip('force',sc,so,sp,current) end
- free_glue_node(glue_data) -- also free spec
- head, current, glue_data = remove_node(head, current)
- elseif sc == penalty then
- if trace then trace_skip('penalty',sc,so,sp,current) end
- free_glue_node(glue_data) -- also free spec
- glue_data = nil
- head, current = remove_node(head, current, true)
- elseif sc == add then
- if trace then trace_skip('add',sc,so,sp,current) end
- local old, new = glue_data.spec, current.spec
- old.width = old.width + new.width
- old.stretch = old.stretch + new.stretch
- old.shrink = old.shrink + new.shrink
- -- toto: order
- head, current = remove_node(head, current, true)
- else
- if trace then trace_skip("unknown",sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- end
- else
- if trace then trace_skip("unknown",sc,so,sp,current) end
- head, current = remove_node(head, current, true)
- end
- end
- end
- elseif id == penalty then
- --~ natural_penalty = current.penalty
- --~ if trace then trace_done("removed penalty",current) end
- --~ head, current = remove_node(head, current, true)
- current = current.next
- elseif id == glue and current.subtype == 2 then
- local sn = has_attribute(current,snap_category)
- if sn then
- -- local sv = nodes.snapvalues[sn]
- -- if sv then
- if trace then trace_natural("removed baselineskip",current) end
- head, current = remove_node(head, current, true)
- -- else
- -- current = current.next
- -- end
- else
- if trace then trace_natural("keep baselineskip",current) end
- current = current.next
- end
- elseif id == glue and current.subtype == 3 then
- -- parskip always comes later
- if ignore_whitespace then
- if trace then trace_natural("ignored parskip",current) end
- head, current = remove_node(head,current,true)
- elseif glue_data then
- local ps, gs = current.spec, glue_data.spec
- if ps and gs and ps.width > gs.width then
- -- free_glue_spec(glue_data.spec) -- result in double free
- glue_data.spec = copy_node(ps)
- if trace then trace_natural("taking parskip",current) end
- else
- if trace then trace_natural("removed parskip",current) end
- end
- head, current = remove_node(head, current,true)
- else
- if trace then trace_natural("honored parskip",current) end
- head, current, glue_data = remove_node(head, current)
- end
- --~ if trace then trace_natural("removed parskip",current) end
- --~ current.spec = nil
- --~ current = current.next
- else
--- reversed
- if penalty_data then
- local p = make_penalty_node(penalty_data)
- if trace then trace_done("flushed",p) end
- head, current = insert_node_before(head,current,p)
- penalty_data = nil
- end
- if glue_data then
- if trace then trace_done("flushed",glue_data) end
- head, current = insert_node_before(head,current,glue_data)
- glue_order, glue_data = 0, nil
- end
- if trace then trace_node(current) end
- if id == hlist and where == 'hmode_par' then
- local list = current.list
- if list then
- local sn = has_attribute(list,snap_category)
- if sn then
- local sv = nodes.snapvalues[sn]
- if sv then
- local height, depth, lineheight = sv[1], sv[2], sv[3]
- -- is math.ceil really needed?
- current.height = math.ceil((current.height-height)/lineheight)*lineheight + height
- current.depth = math.ceil((current.depth -depth )/lineheight)*lineheight + depth
- end
- end
- end
- end
- current = current.next
- end
- end
- if trace then trace_info("stop analyzing",where,what) end
- --~ if natural_penalty and (not penalty_data or natural_penalty > penalty_data) then
- --~ penalty_data = natural_penalty
- --~ end
- if trace and (glue_data or penalty_data) then
- trace_info("start flushing",where,what)
- end
- local tail
- if penalty_data then
- tail = find_node_tail(head)
- local p = make_penalty_node(penalty_data)
- if trace then trace_done("result",p) end
- head, tail = insert_node_after(head,tail,p)
- end
- if glue_data then
- if not tail then tail = find_node_tail(head) end
- if trace then trace_done("result",glue_data) end
- head, tail = insert_node_after(head,tail,glue_data)
- end
- if trace then
- if glue_data or penalty_data then
- trace_info("stop flushing",where,what)
- end
- show_tracing(head)
- end
- return head, true
-end
-
--- alignment after_output end box new_graf vmode_par hmode_par insert penalty before_display after_display
--- \par -> vmode_par
---
--- status.best_page_break
--- tex.lists.best_page_break
--- tex.lists.best_size (natural size to best_page_break)
--- tex.lists.least_page_cost (badness of best_page_break)
--- tex.lists.page_head
--- tex.lists.contrib_head
-
-local stackhead, stacktail, stackhack = nil, nil, false
-
-local function report(message,lst)
- logs.report("vspacing",message,count_nodes(lst,true),node_ids_to_string(lst))
-end
-
-function nodes.handle_page_spacing(where)
- local newhead = texlists.contrib_head
- if newhead then
- statistics.starttiming(vspacing)
- local newtail = find_node_tail(newhead)
- local flush = false
- for n in traverse_nodes(newhead) do -- we could just look for glue nodes
- local id = n.id
- if id == glue then
- if n.subtype == 0 then
- if has_attribute(n,skip_category) then
- stackhack = true
- else
- flush = true
- end
- else
- -- tricky
- end
- else
- flush = true
- end
- end
- if flush then
- if stackhead then
- if trace_collect_vspacing then report("appending %s nodes to stack (final): %s",newhead) end
- stacktail.next = newhead
- newhead.prev = stacktail
- newhead = stackhead
- stackhead, stacktail = nil, nil
- end
- if stackhack then
- stackhack = false
- if trace_collect_vspacing then report("processing %s nodes: %s",newhead) end
- texlists.contrib_head = collapser(newhead,"page",where,trace_page_vspacing)
- else
- if trace_collect_vspacing then report("flushing %s nodes: %s",newhead) end
- texlists.contrib_head = newhead
- end
- else
- if stackhead then
- if trace_collect_vspacing then report("appending %s nodes to stack (intermediate): %s",newhead) end
- stacktail.next = newhead
- newhead.prev = stacktail
- else
- if trace_collect_vspacing then report("storing %s nodes in stack (initial): %s",newhead) end
- stackhead = newhead
- end
- stacktail = newtail
- texlists.contrib_head = nil
- end
- statistics.stoptiming(vspacing)
- end
-end
-
-local ignore = table.tohash {
- "split_keep",
- "split_off",
- -- "vbox",
-}
-
-function nodes.handle_vbox_spacing(head,where)
- if head and not ignore[where] and head.next then
- statistics.starttiming(vspacing)
- head = collapser(head,"vbox",where,trace_vbox_vspacing)
- statistics.stoptiming(vspacing)
- end
- return head
-end
-
-statistics.register("v-node processing time", function()
- if statistics.elapsedindeed(vspacing) then
- return format("%s seconds", statistics.elapsedtime(vspacing))
- end
-end)
-
--- these are experimental callback definitions that definitely will
--- be moved elsewhere as part of a chain of vnode handling
-
-function vspacing.enable()
---~ callback.register('vpack_filter', nodes.handle_vbox_spacing)
- callback.register('buildpage_filter', nodes.handle_page_spacing)
-end
-
-function vspacing.disable()
- callback.register('vpack_filter', nil)
- callback.register('buildpage_filter', nil)
-end
-
--- we will split this module hence the locals
-
-local attribute = attributes.private('graphicvadjust')
-
-local hlist = node.id('hlist')
-local vlist = node.id('vlist')
-
-local remove_node = nodes.remove
-local hpack_node = node.hpack
-local has_attribute = node.has_attribute
-
-function nodes.repackage_graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only
- if groupcode == "" then -- mvl only
- local h, p, done = head, nil, false
- while h do
- local id = h.id
- if id == hlist or id == vlist then
- local a = has_attribute(h,attribute)
- if a then
- if p then
- local n
- head, h, n = remove_node(head,h)
- local pl = p.list
- if n.width ~= 0 then
- n = hpack_node(n,0,'exactly')
- end
- if pl then
- pl.prev = n
- n.next = pl
- end
- p.list = n
- done = true
- else
- -- can't happen
- end
- else
- p = h
- h = h.next
- end
- else
- h = h.next
- end
- end
- return head, done
- else
- return head, false
- end
-end
-
---~ tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust")
diff --git a/Master/texmf-dist/tex/context/base/core-spa.mkiv b/Master/texmf-dist/tex/context/base/core-spa.mkiv
deleted file mode 100644
index 5d7836f5b04..00000000000
--- a/Master/texmf-dist/tex/context/base/core-spa.mkiv
+++ /dev/null
@@ -1,4277 +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 / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Spacing}
-
-% to be sorted out: dependencies, order of initialization / also some dutch code here
-% more documentation in the mkii file
-
-\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\plusone \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 \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%
- {\normalexpanded % \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
- \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
-
-% 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
- \rawprocesscommacommand[#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
- \normalexpanded{\noexpand\processallactionsinset[#1]}
- [ \v!flexible=>\blankflexibletrue,
- \v!fixed=>\blankflexiblefalse]%
- \fi
- \normalexpanded{\noexpand\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]% why #1 commalist?
- {\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}}
-
-\def\savecurrentblank {\edef\savedcurrentblank{\currentblank}}
-\def\restorecurrentblank{\edef\currentblank{\savedcurrentblank}}
-
-\def\savedcurrentblank{\currentblank}
-
-%D Now.
-
-\defineblank [\s!default] [\v!white]
-\defineblank [\v!height] [\strutheight]
-\defineblank [\v!depth] [\strutdepth]
-
-\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
-
-\indentfirstparagraphtrue
-\parindent\ctxparindent
-\chardef\indentingtoggle\zerocount
-
-% 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}% can this be doen differently now?
- \ifcsname\??in:\!!stringa\endcsname \else
- \edef\currentindentation{#1}%
- \let\normalindentation\currentindentation
- \simplesetupindenting
- \fi}
-
-\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[\csname#1\c!indentnext\endcsname]}
-
-\setvalue{\??in->\s!empty}{}
-\setvalue{\??in->\v!yes }{\doindentation}
-\setvalue{\??in->\v!no }{\noindentation}
-\setvalue{\??in->\v!auto }{\autoindentation}
-
-\def\checknextindentation[#1]%
- {\csname\??in->\ifcsname\??in->#1\endcsname#1\else\s!empty\fi\endcsname}
-
-%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
-
-% \dorecurse{100}{\recurselevel\spacefactor 800 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor 800 \normalspaceprimitive} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \normalspaceprimitive} \par
-
-% When we don't add the % here, we effectively get \<endlinechar> and
-% since we have by default \def\^^M{\ } we get into a loop.
-
-\let\normalspaceprimitive=\ % space-comment is really needed
-
-% hm ...
-
-\unexpanded\def\ {\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
-
-% Because I strip spaces at the end of lines (in the editor) we need a bit of
-% a trick to define slash+newline, so \<space> and \<newline> are the same
-
-\ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\unexpanded\string\\def\string\\\string\n{\string\\ }")}
-
-\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\mathortext\ \space} % no space in math
-
-\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace % overloaded later
-
-\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}
-
-\appendtoks\let~\space\to\simplifiedcommands
-
-% \def\removeunwantedspaces
-% {\ifhmode % we also need to unskip 0pt skips
-% \unskip\unskip\unskip\unskip\unskip
-% \unskip\unskip\unskip\unskip\unskip
-% \fi}
-
-\unexpanded\def\removeunwantedspaces
- {\ifhmode
- \expandafter \doremoveunwantedspace
- \fi}
-
-\def\doremoveunwantedspace
- {\ifnum\lastnodetype=\@@gluenode
- \unskip \expandafter\doremoveunwantedspace
- \fi}
-
-% \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
-
-\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]%
- {\edef\nextcurrentwhitespace{#1}%
- \ifx\nextcurrentwhitespace\empty
- \simplesetupwhitespace
- \else
- \let\currentwhitespace\nextcurrentwhitespace
- \dosetupwhitespace
- \fi}
-
-\def\dosetupwhitespace % quick test for no list
- {\ifcsname\??ws\??ws\currentwhitespace\endcsname
- \csname\??ws\??ws\currentwhitespace\endcsname
- \else
- \expandafter\processcommalist\expandafter[\currentwhitespace]\dowhitespacemethod % can be raw
- \fi\relax
- \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%
- {\ifcsname\??ws\??ws#1\endcsname\csname\??ws\??ws#1\endcsname\else\ctxparskip#1\fi\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}}
-
-\def\savecurrentwhitespace {\edef\savedcurrentwhitespace{\currentwhitespace}}
-\def\restorecurrentwhitespace{\edef\currentwhitespace{\savedcurrentwhitespace}}
-
-\def\savedcurrentwhitespace{\currentwhitespace}
-
-% 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}
-
-% I'm not sure if the restore is still needed. Anyway, when we do
-% restore, we get a parskip someplace in the output that will push
-% the content off page (\vbox to pageheight{skip smashed-box}) so
-% we have now disabled this hack. If it is introduced again it needs
-% to be more controlled. Test case:
-%
-% \setupwhitespace[big]
-% \starttext
-% \startcolumns[n=2]\dorecurse{200}{test\crlf}\stopcolumns
-% \stoptext
-%
-% \def\saveouterspacing
-% {\savecurrentblank
-% \savecurrentwhitespace
-% \def\restoreouterspacing
-% {\restorecurrentblank
-% \restorecurrentwhitespace}}
-%
-% \let\restoreouterspacing\relax
-% \let\saveouterspacing \relax % mult-ini: i will look into it when needed
-%
-% let's test this (restore before we restore the global bodyfont):
-
-\def\saveouterspacing
- {\savecurrentblank
- \savecurrentwhitespace}
-
-\def\restoreouterspacing
- {\restorecurrentblank
- \restorecurrentwhitespace}
-
-% 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}
-
-\let\spacingfactor \plusone
-
-\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
- {\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\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 \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
- \dosetupgridsnapping}
-
-\def\spacing#1%
- {\ifgridsnapping
- %\ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{\withoutpt\the\dimexpr#1\points\relax}\fi
- \let\spacingfactor\plusone
- \else
- \edef\spacingfactor{#1}%
- \fi
- \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\else\unhcopy\fi\strutbox}
-
-\fi
-
-\let\normalstrut\strut
-
-% The double \hbox construction enables us to \backtrack
-% boxes.
-
-\let\strutht\undefined \newdimen\strutht
-\let\strutdp\undefined \newdimen\strutdp
-
-\unexpanded\def\setstrut
- {\ifgridsnapping
- \setstrutgridyes
- \else
- \setstrutgridnop
- \fi}
-
-\unexpanded\def\setstrutgridyes
- {\strutht\spacingfactor\dimexpr
- \ifdim\minimumstrutheight>\zeropoint
- \minimumstrutheight
- \else
- \strutheightfactor\dimexpr\normallineheight
- \fi
- \strutdp\dimexpr
- \ifdim\minimumstrutdepth>\zeropoint
- \minimumstrutdepth
- \else
- \normallineheight-\strutht
- \fi
- \dosetstrut}
-
-\unexpanded\def\setstrutgridnop
- {\strutht\spacingfactor\dimexpr
- \ifdim\minimumstrutheight>\zeropoint
- \minimumstrutheight
- \else
- \strutheightfactor\dimexpr\normallineheight
- \fi
- \strutdp\spacingfactor\dimexpr
- \ifdim\minimumstrutdepth>\zeropoint
- \minimumstrutdepth
- \else
- \strutdepthfactor\dimexpr\normallineheight
- \fi
- \dosetstrut}
-
-\unexpanded\def\setcharstrut#1%
- {\setbox\strutbox\normalhbox{#1}%
- \strutht\ht\strutbox
- \strutdp\dp\strutbox
- \dosetstrut}
-
-\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}
-
-% 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
- \edef\strutheight{\the\strutht}%
- \edef\strutdepth {\the\strutdp}%
- \ifdim\strutwidth=\zeropoint
- \dosetstruthide
- \else
- \dosetstrutvide
- \fi
- \struttotal\dimexpr\strutht+\strutdp\relax}
-
-\def\dosetstruthide
- {\setbox\strutbox\normalhbox
- {\vrule
- \!!width \zeropoint
- \!!height\strutht
- \!!depth \strutdp}}
-
-\def\dosetstrutvide
- {\setbox\strutbox\normalhbox
- {\normalhbox to \zeropoint
- {% \hss % new, will be option
- \vrule
- \!!width \strutwidth
- \!!height\strutht
- \!!depth \strutdp
- \hss}}}
-
-%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.
-
-% experiment
-
-\newbox\emptystrutbox \setbox\emptystrutbox\hbox{}
-
-\def\dosetstruthide
- {\setbox\strutbox\copy\emptystrutbox
- \ht\strutbox\strutht
- \dp\strutbox\strutdp}
-
-\def\strut{\relax\dontleavehmode\copy\strutbox} % still callbacks for \hbox{\strut}
-
-
-\let\normalstrut\strut
-
-%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\strutht>\autostrutfactor\ht\scratchbox
- \endgroup \setstrut
- \else\ifdim\strutdp>\autostrutfactor\dp\scratchbox
- \endgroup \setstrut
- \else
- \endgroup
- \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\dopushinterlineskip
- {\edef\oninterlineskip
- {\baselineskip\the\baselineskip
- \lineskip\the\lineskip
- \lineskiplimit\the\lineskiplimit
- \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}}
-
-\def\nopushinterlineskip
- {\let\oninterlineskip\setnormalbaselines}
-
-\def\offinterlineskip
- {\ifdim\baselineskip>\zeropoint
- \dopushinterlineskip
- \else
- \nopushinterlineskip
- \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.
-
-% just before margintexts ... will eventually be done differently in mkiv using
-% attributes
-
-\newcount\nofkeeplinestogether
-\let\restoreinterlinepenalty\relax
-
-\def\dorestoreinterlinepenalty
- {\global\let\restoreinterlinepenalty\relax
- \global\resetpenalties\interlinepenalties
- \global\nofkeeplinestogether\zerocount}
-
-\def\keeplinestogether#1%
- {\ifnum#1>\nofkeeplinestogether
- \global\nofkeeplinestogether#1%
- \global\setpenalties\interlinepenalties\nofkeeplinestogether\plustenthousand
- \global\let\restoreinterlinepenalty\dorestoreinterlinepenalty
- \fi}
-
-\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}
-
-\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!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
- {\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}
-
-% We will not use bodydir and pagedir so we disable them. That way we get
-% normal hyperlink support.
-
-\let\@@bodydir\normalbodydir
-\let\@@pagedir\normalpagedir
-
-\unexpanded\def\bodydir{\afterassignment\do@@bodydir\@@bodydir} \let\normalbodydir\bodydir
-\unexpanded\def\pagedir{\afterassignment\do@@pagedir\@@pagedir} \let\normalpagedir\pagedir
-
-\def\do@@bodydir{\@@bodydir TLT\relax}
-\def\do@@pagedir{\@@pagedir TLT\relax}
-
-% This will become a more advanced layout controller soon:
-
-\unexpanded\def\lefttoright{\textdir TLT\pardir TLT\relax}
-\unexpanded\def\righttoleft{\textdir TRT\pardir TRT\relax}
-
-\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%
- {\normalexpanded{\noexpand\dodosetraggedcommand{#1}}}
-
-\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}
-
-\setvalue{\@@ragged@@command\v!lefttoright}{\appendtoks\lefttoright\to\everyraggedcommand}
-\setvalue{\@@ragged@@command\v!righttoleft}{\appendtoks\righttoleft\to\everyraggedcommand}
-\setvalue{\@@ragged@@command l2r}{\appendtoks\lefttoright\to\everyraggedcommand}
-\setvalue{\@@ragged@@command r2l}{\appendtoks\righttoleft\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}
-
-% 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}
-
-\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
- \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=}
-
-\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
-
-\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}
-
-\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
-
-% new code, not in use yet
-
-% for future chinese typo-module:
-%
-% % \let\raggedleft\veryraggedleft
-% % \let\raggedleft\veryraggedright
-%
-% \startbuffer
-% 中中中中中中中中中中中中中中中中中中中中中中中中中%
-% 中中中中中中中中中中中中中中中中中中中中中中中中中%
-% 中中中中中中中中中中中中中中中中中中中中中中中中中%
-% 中中中中中中中中中中中中中中中中中中中中中中中中中%
-% \stopbuffer
-%
-% \framedtext
-% [align={broad,flushright},width=90mm]
-% {\getbuffer}
-%
-% \framedtext
-% [align={broad,flushleft},width=90mm]
-% {\getbuffer}
-%
-% \framedtext
-% [align=middle,width=90mm]
-% {\getbuffer}
-%
-% using just flushleft is not okay here due to the fact that
-% leftskip has less stretch than the inter character spacing
-
-\registerctxluafile{core-spa}{1.001}
-
-\definesystemattribute[kern-chars]
-\definesystemattribute[skip-category] \chardef\skipcategoryattribute \dogetattributeid{skip-category}
-\definesystemattribute[skip-penalty] \chardef\skippenaltyattribute \dogetattributeid{skip-penalty}
-\definesystemattribute[skip-order] \chardef\skiporderattribute \dogetattributeid{skip-order}
-\definesystemattribute[snap-category]
-\definesystemattribute[display-math]
-
-% \start \dosetstretch{.25em} \setuptolerance[tolerant,stretch] \input tufte \endgraf \stop
-% \start \dosetstretch{.5em} effe flink doorfietsen \stop
-
-\def\dosetupgridsnapping % calls too often, only needed in gridsnapping
- {\ctxlua{nodes.setsnapvalue(1,\number\openstrutheight,\number\openstrutdepth)}}
-
-\def\doenablegridsnapping
- {\dosetattribute{snap-category}{1}%
- \topskip\strutht
- \offinterlineskip}
-
-\def\dodisablegridsnapping
- {\doresetattribute{snap-category}%
- % reset topskip
- \oninterlineskip}
-
-% experimental code, not yet interfaced:
-
-% category:
-% 0 == discard discard
-% 1 == only if larger largest
-% 2 == force even if smaller force
-% 3 == only take penalty component penalty
-% 4 == add to existing skip add
-% 5 == disable (ignore following) disable
-% 6 == kill whitespace nowhite
-% 7 == discard previous back
-%
-% penalty: larger wins
-% order: larger wins
-% category:2,order:5,penalty:10000,skip:value|kw
-%
-% always -- obsolete
-% none -- obsolete
-% outer -- obsolete
-% reset -- obsolete
-% \defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi}
-
-% todo, in grid mode: vspacing.fixed = false
-
-\newtoks\everybeforeblankhandling
-\newtoks\everyafterblankhandling
-
-\appendtoks
- \blankskip\zeropoint
- \attribute\skipcategoryattribute\plusone
- \attribute\skippenaltyattribute \attributeunsetvalue
- \attribute\skiporderattribute \attributeunsetvalue
- \ifblankflexible
- \setfalse\blankisfixed
- \else
- \settrue\blankisfixed
- \fi
-\to \everybeforeblankhandling
-
-\appendtoks
- \ifconditional\blankisfixed
- \blankskip1\blankskip
- \else
- \blankskip1\blankskip\!!plus\skipgluefactor\blankskip\!!minus\skipgluefactor\blankskip
- \fi
-\to \everyafterblankhandling
-
-\def\setblankcategory#1{\attribute\skipcategoryattribute#1\relax}
-\def\setblankorder #1{\attribute\skiporderattribute #1\relax}
-\def\setblankpenalty #1{\attribute\skippenaltyattribute #1\relax}
-\def\addblankskip#1#2#3{\advance\blankskip#1\dimexpr\ifgridsnapping#3\else#2\fi\relax\relax}
-\def\fixedblankskip {\settrue \blankisfixed} % \blankskip1\blankskip}
-\def\flexibleblankskip {\setfalse\blankisfixed} % \blankskip1\blankskip\!!plus\skipgluefactor\blankskip\!!minus\skipgluefactor\blankskip}
-
-\def\startblankhandling
- {\begingroup
- \the\everybeforeblankhandling}
-
-\def\stopblankhandling
- {\the\everyafterblankhandling
- \vskip\blankskip
- \endgroup}
-
-\def\flushblankhandling
- {\the\everyafterblankhandling
- \vskip\blankskip
- \the\everybeforeblankhandling}
-
-% % % %
-
-\def\definevspacingamount
- {\dotripleempty\dodefinevspacingamount}
-
-\def\dodefinevspacingamount[#1][#2][#3]%
- {\ctxlua{vspacing.setskip("#1",\!!bs\detokenize{#2}\!!es,\!!bs\detokenize{#3}\!!es)}}
-
-\def\definevspacing
- {\dodoubleempty\dodefinevspacing}
-
-\def\dodefinevspacing[#1][#2]%
- {\ctxlua{vspacing.setmap("#1","#2")}}
-
-\unexpanded\def\vspacing
- {\dosingleempty\dovspacing}
-
-\def\dovspacing[#1]%
- {\ctxlua{vspacing.analyse("\iffirstargument#1\else default\fi")}}
-
-% category:4 is default
-
-\definevspacingamount[\v!big] [\bigskipamount] [\openlineheight]
-\definevspacingamount[\v!medium] [\medskipamount] [0.50\openlineheight]
-\definevspacingamount[\v!small] [\smallskipamount] [0.25\openlineheight]
-\definevspacingamount[\v!line] [\openlineheight] [\openlineheight]
-\definevspacingamount[\v!halfline][0.50\openlineheight][0.50\openlineheight]
-\definevspacingamount[\v!formula] [\medskipamount] [0.50\openlineheight]
-\definevspacingamount[\v!white] [\parskip] [\openlineheight]
-
-\definevspacing[\s!default] [\v!big]
-\definevspacing[\v!samepage][penalty:10000]
-\definevspacing[\v!max] [category:1]
-\definevspacing[\v!force] [category:2]
-\definevspacing[\v!disable] [category:5]
-\definevspacing[\v!nowhite] [category:6]
-\definevspacing[\v!back] [category:7]
-\definevspacing[\v!always] [category:0]
-\definevspacing[\v!weak] [order:0]
-\definevspacing[\v!strong] [order:100]
-
-\defineblankmethod[\v!samepage]{\writestatus\m!systems{ignoring blank method '\v!samepage'}}
-\defineblankmethod[\v!max] {\writestatus\m!systems{ignoring blank method '\v!max'}}
-\defineblankmethod[\v!weak] {\writestatus\m!systems{ignoring blank method '\v!weak'}}
-\defineblankmethod[\v!strong] {\writestatus\m!systems{ignoring blank method '\v!strong'}}
-
-% \definevspacing[whatever][4*big]
-% \vspacing[2*big,-medium,-3*small,whatever,halfline,order:10,category:4,strong,samepage]
-% \vspacing[2*big,category:disable]
-% \vspacing[2*big,disable]
-% \vspacing[2*big,back]
-
-% some temporary hacks
-
-\setfalse\vspacingenabled
-
-% ! ! ! ! ! later, now each newline does a \par and call to the callback
-
-\newtoks\everyenablevspacing
-\newtoks\everydisablevspacing
-
-\def\enablevspacing {\the\everyenablevspacing}
-\def\disablevspacing{\the\everydisablevspacing}
-
-\appendtoks
- \writestatus\m!systems{! ! enabling vspacing ! !}%
- \settrue\vspacingenabled
- \ctxlua{vspacing.enable()}%
-\to \everyenablevspacing
-
-\appendtoks
- \writestatus\m!systems{! ! disabling vspacing ! !}%
- \setfalse\vspacingenabled
- \ctxlua{vspacing.disable()}%
-\to \everydisablevspacing
-
-\let\originalblank \blank % we use \original for non-primitives
-\let\originalvspacing\vspacing
-
-\let\setupvspacing\setupblank % for the moment
-
-% 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:
-
-\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}
-
-\installalign \v!grid {\doenablegridsnapping } % only mkiv
-\installalign \v!nogrid {\dodisablegridsnapping} % only mkiv
-
-\installalign \v!righttoleft {\lefttoright}
-\installalign \v!lefttoright {\righttoleft}
-\installalign {l2r} {\lefttoright}
-\installalign {r2l} {\righttoleft}
-
-\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
- {\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:
-
-\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\ifcsname\s!do\v!line#1\endcsname#1\else#2\fi\endcsname}
-
-%D ...
-
-\def\dosetuptolerance[#1]%
- {\doifinsetelse\v!vertical{#1}%
- {\normalexpanded{\noexpand\processallactionsinset[#1]}
- [ \v!verystrict=>\def\bottomtolerance{},
- \v!strict=>\def\bottomtolerance{.050},
- \v!tolerant=>\def\bottomtolerance{.075},
- \v!verytolerant=>\def\bottomtolerance{.100}]}%
- {\normalexpanded{\noexpand\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\justonespace
- {\removelastspace\space} % \removeunwantedspaces\space
-
-\def\ignorecrlf
- {\let\crlf\justonespace\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]%
- {\ifsecondargument
- \dodohspace[#1][#2]%
- \else\iffirstargument
- \hspace[][#1]%
- \else
- \hspace[][\s!default]%
- \fi\fi}
-
-\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}
-\unexpanded\def\breakabletextormathspace#1#2#3{\ifmmode\mskip#1#2\else\hskip#1\hspaceamount\empty{#3}\fi\relax}
-
-\newmuskip\hairmuskip \hairmuskip=.15mu
-
-\unexpanded\def\hairspace {\textormathspace+\hairmuskip{.5}}
-\unexpanded\def\thinspace {\textormathspace+\thinmuskip 1}
-\unexpanded\def\medspace {\textormathspace+\medmuskip 2}
-\unexpanded\def\thickspace {\textormathspace+\thickmuskip3}
-\unexpanded\def\neghairspace {\textormathspace-\thinmuskip{.5}}
-\unexpanded\def\negthinspace {\textormathspace-\thinmuskip 1}
-\unexpanded\def\negmedspace {\textormathspace-\medmuskip 2}
-\unexpanded\def\negthickspace{\textormathspace-\thickmuskip3}
-
-% needed for unicode:
-
-\unexpanded\def\breakablethinspace {\breakabletextormathspace+\thinmuskip 1}
-
-\unexpanded\def\twoperemspace {\hskip\dimexpr\emwidth/2\relax} % == \enspace
-\unexpanded\def\threeperemspace {\hskip\dimexpr\emwidth/3\relax}
-\unexpanded\def\fourperemspace {\hskip\dimexpr\emwidth/4\relax}
-\unexpanded\def\fiveperemspace {\hskip\dimexpr\emwidth/5\relax} % goodie
-\unexpanded\def\sixperemspace {\hskip\dimexpr\emwidth/6\relax}
-\unexpanded\def\figurespace {\begingroup\setbox\scratchbox\hbox{0}\hskip\wd\scratchbox\endgroup} % there is a command for this
-\unexpanded\def\punctuationspace {\begingroup\setbox\scratchbox\hbox{.}\hskip\wd\scratchbox\endgroup}
-\unexpanded\def\ideographicspace {\hskip\dimexpr\emwidth/1\relax}
-\unexpanded\def\ideographichalffillspace{\hskip\dimexpr\emwidth/2\relax}
-%unexpanded\def\nobreakspace {\penalty\plustenthousand\space}
-\unexpanded\def\nobreakspace {\penalty\plustenthousand\kern\interwordspace}
-\unexpanded\def\narrownobreakspace {\penalty\plustenthousand\thinspace}
-%unexpanded\def\zerowidthnobreakspace {\penalty\plustenthousand\hskip\zeropoint}
-\unexpanded\def\zerowidthnobreakspace {\penalty\plustenthousand\kern\zeropoint}
-\unexpanded\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
-
-\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
- \global\let\insertparagraphintro\doinsertparagraphintro}
-
-\def\doinsertparagraphintro % can be merged with the next
- {\ifcase\everyparagraphintro\else\@EA\dodoinsertparagraphintro\fi}
-
-\def\dodoinsertparagraphintro
- {\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
- \global\let\insertparagraphintro\relax
- \endgroup}
-
-\let\insertparagraphintro\relax
-
-%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
-\let\flushpostponednodedata\relax
-
-\def\flushatnextpar
- {\bgroup
- \global\let\flushpostponednodedata\doflushpostponednodedata
- \dowithnextbox{\global\setbox\postponednodedata\hbox{\box\postponednodedata\box\nextbox}\egroup}\hbox}
-
-\def\doflushpostponednodedata
- {\ifvoid\postponednodedata\else
- \hbox{\smashedbox\postponednodedata}%
- \fi
- \global\let\flushpostponednodedata\relax}
-
-% Very nasty but needed for margin stuff inside colored
-% paragraphs.
-
-\let\normalvadjust\vadjust
-
-% \def\graphicvadjust % bad, those low level color calls here
-% {\dowithnextboxcontent
-% {\forgetall}
-% {\normalvadjust
-% {\unvbox\nextbox
-% % corrects for one line paragraphs
-% \nointerlineskip
-% \kern-\struttotal
-% \nointerlineskip
-% \verticalstrut}}%
-% \vbox}
-
-\def\graphicvadjust % nasty bidi handling
- {\dowithnextboxcontent
- {\forgetall}
- {\vadjust{\vbox attr \graphicvadjustattribute \plusone
- {\unvbox\nextbox
- % corrects for one line paragraphs
- \nointerlineskip
- \kern-\struttotal
- \nointerlineskip
- \verticalstrut}}}%
- \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
- {\normalspaces
- \let\obeyedspace\normalspace
- \let\ =\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
-
-\dorecurse{2}{
- $2^{2^{2^{2}}}$ $2_{2_{2_{2}}}^{2^{2^{2^{2^{2^{2^{2^{2^{2}}}}}}}}}$
- \input tufte \inframed {tufte}
- \par
-}
-
-\dorecurse{100} {
-
- \kern \recurselevel pt
-
- \vbox {
- \endgraf \strut first \endgraf
- {\dosetattribute{skip-category}{1}\vskip10pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip20pt}
- {\dosetattribute{skip-category}{2}\vskip10pt}
- \endgraf \strut second \endgraf
- }
-
- \endgraf \strut first \endgraf
- {\dosetattribute{skip-category}{1}\vskip10pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip20pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- \endgraf \strut second \endgraf
-
- {\dosetattribute{skip-category}{0}\vskip10pt} % remove
- {\dosetattribute{skip-category}{1}\vskip10pt} % take largest
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\vskip40pt}
- {\dosetattribute{skip-category}{1}\dosetattribute{skip-order}{10}\vskip20pt}
- {\dosetattribute{skip-category}{4}\dosetattribute{skip-order}{10}\vskip20pt}
- {\dosetattribute{skip-category}{1}\vskip60pt}
- {\dosetattribute{skip-category}{1}\vskip20pt}
- {\dosetattribute{skip-category}{0}\vskip10pt}
-
- third (no break after this)
-
- {\dosetattribute{skip-category}{1}\dosetattribute{skip-penalty}{100000}\vskip10pt}
- {\dosetattribute{skip-category}{1}\dosetattribute{skip-penalty}{100000}\vskip20pt}
- {\dosetattribute{skip-category}{1}\vskip10pt}
- {\dosetattribute{skip-category}{1}\vskip20pt}
-
- fourth
- \vskip10pt
- fifth
-}
diff --git a/Master/texmf-dist/tex/context/base/core-sys.lua b/Master/texmf-dist/tex/context/base/core-sys.lua
new file mode 100644
index 00000000000..c5aa89d98e5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-sys.lua
@@ -0,0 +1,22 @@
+if not modules then modules = { } end modules ['core-sys'] = {
+ version = 1.001,
+ comment = "companion to core-sys.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local lower, extname, basename, removesuffix = string.lower, file.extname, file.basename, file.removesuffix
+
+function commands.updatefilenames(inputfilename,outputfilename)
+ environment.inputfilename = inputfilename or ""
+ environment.outputfilename = outputfilename or ""
+ environment.jobfilename = inputfilename or tex.jobname or ""
+ environment.jobfilesuffix = lower(extname(environment.jobfilename))
+ environment.inputfilebarename = removesuffix(basename(inputfilename))
+ environment.inputfilesuffix = lower(extname(inputfilename))
+end
+
+statistics.register("result saved in file", function()
+ return string.format( "%s.%s", environment.outputfilename, (tex.pdfoutput>0 and "pdf") or "dvi")
+end)
diff --git a/Master/texmf-dist/tex/context/base/core-sys.mkiv b/Master/texmf-dist/tex/context/base/core-sys.mkiv
index f30c8a958cb..649e5e65c9b 100644
--- a/Master/texmf-dist/tex/context/base/core-sys.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-sys.mkiv
@@ -15,6 +15,8 @@
\writestatus{loading}{ConTeXt Core Macros / System}
+\registerctxluafile{core-sys}{1.001}
+
\unprotect
%D Version checking:
@@ -36,29 +38,61 @@
%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}}
\newlinechar=10 \edef\outputnewlinechar{^^J}
-% in case formats are shared:
+\edef\operatingsystem {\ctxlua{tex.write(os.platform)}}
+
+\def\jobfilename {\ctxlua{tex.sprint(tex.texcatcodes,environment.jobfilename or "")}}
+\def\jobfilesuffix {\ctxlua{tex.sprint(tex.texcatcodes,environment.jobfilesuffix or "")}}
+\def\inputfilebarename{\ctxlua{tex.sprint(tex.texcatcodes,environment.inputfilebarename or "")}}
+\def\inputfilesuffix {\ctxlua{tex.sprint(tex.texcatcodes,environment.inputfilesuffix or "")}}
+\def\inputfilename {\ctxlua{tex.sprint(tex.texcatcodes,environment.inputfilename or "")}}
+\def\outputfilename {\ctxlua{tex.sprint(tex.texcatcodes,environment.outputfilename or "")}}
\def\initializenewlinechar
{\bgroup\newlinechar=10\xdef\outputnewlinechar{^^J}\egroup}
-%D Job names.
-
-\def\outputfilename {\@@svfile}
-\def\inputfilename {\@@svinputfile}
-\def\operatingsystem{\@@svtype}
+\newtoks \everysetupsystem
-\let\jobfilename \jobname
-\let\jobfilesuffix\c!tex
+\unexpanded\def\setupsystem
+ {\dosingleargument\dosetupsystem}
-\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}}
+\def\dosetupsystem[#1]%
+ {\getparameters[\??sv][#1]%
+ \the\everysetupsystem}
+
+\appendtoks
+ \edef\outputresolution{\@@svresolution}%
+\to \everysetupsystem
+
+\appendtoks
+ \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
+\to \everysetupsystem
+
+\appendtoks
+ \edef\outputfilename{\@@svfile}%
+ \edef\inputfilename {\@@svinputfile}%
+\to \everysetupsystem
+
+\let\@@jobsuffix\s!unknown
+
+\appendtoks
+ \resetsystemmode{suffix-\@@jobsuffix}%
+ \edef\@@jobsuffix{\jobsuffix}%
+ \setsystemmode{suffix-\@@jobsuffix}%
+\to \everysetupsystem
+
+\appendtoks
+ \ctxlua {commands.updatefilenames("\inputfilename","\outputfilename")}%
+\to \everysetupsystem
% Some mechanisms (see x-res-01) use either \jobfilename or
% \jobfilename.somesuffix, in which case we need to use the
@@ -72,41 +106,23 @@
{\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 There are a couple of system states avaiable:
+%D
+%D \starttabulate [|T|T|]
+%D \NC \type{\jobname} \NC \jobname \NC \NR
+%D \NC \type{\jobfilename} \NC \jobfilename \NC \NR
+%D \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC \NR
+%D \NC \type{\inputfilename} \NC \inputfilename \NC \NR
+%D \NC \type{\inputfilebarename} \NC \inputfilebarename \NC \NR
+%D \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC \NR
+%D \NC \type{\outputfilename} \NC \outputfilename \NC \NR
+%D \NC \type{\operatingsystem} \NC \operatingsystem \NC \NR
+%D \stoptabulate
+
%D The system modes set by the setup command can be used in
%D situations like:
%D
@@ -120,7 +136,7 @@
%D \stoptext
%D \stoptyping
-\def\setuprandomize[#1]%
+\unexpanded\def\setuprandomize[#1]%
{\doifsomething{#1}
{\bgroup
% tex's time is in minutes
@@ -134,14 +150,14 @@
\s!default=>\getnewrandomseed\scratchcounter,
\s!unknown=>\scratchcounter#1]%
\expanded{\setrandomseed{\the\scratchcounter}}%
-% \writestatus\m!systems{randomseed: \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!resolution=600,% in dpi, no unit in mkiv
+ %c!random=, % obsolete here
\c!file=\jobname,
\c!inputfile=\outputfilename,
\c!type=unix, % windows is normally less sensitive to handle
@@ -164,10 +180,10 @@
{\globaldefs\getvalue{@gd@\the\globaldefs}\relax}
{\globaldefs\zerocount}}
-\def\startlocal {\dostartglobaldefs>-}
-\def\stoplocal {\dostopglobaldefs}
-\def\startglobal {\dostartglobaldefs<+}
-\def\stopglobal {\dostopglobaldefs}
+\unexpanded\def\startlocal {\dostartglobaldefs>-}
+\unexpanded\def\stoplocal {\dostopglobaldefs}
+\unexpanded\def\startglobal {\dostartglobaldefs<+}
+\unexpanded\def\stopglobal {\dostopglobaldefs}
\def\complexstart[#1]{\bgroup\getvalue{\e!start#1}}
\def\complexstop [#1]{\getvalue{\e!stop #1}\egroup}
@@ -187,7 +203,7 @@
\c!commands=,
\c!style=,
#2]%
- \unexpanded\setvalue{#1}%
+ \setuvalue{#1}%
{\groupedcommand
{\getvalue{\??be#1\c!commands}%
\dostartattributes{\??be#1}\c!style\c!color}
@@ -207,14 +223,14 @@
{\def\docommand##1{\dododefinestartstop[##1][#2]}%
\processcommalist[#1]\docommand}
-\def\definestartstop
+\unexpanded\def\definestartstop
{\dodoubleargument\dodefinestartstop}
\def\dosetupstartstop[#1][#2]%
{\def\docommand##1{\getparameters[\??be##1][#2]}%
\processcommalist[#1]\docommand}
-\def\setupstartstop
+\unexpanded\def\setupstartstop
{\dodoubleargument\dosetupstartstop}
% \docommand kan niet worden gebruikt omdat deze macro
@@ -227,10 +243,10 @@
% \def\executeprotected#1%
% {\csname\??pc\string#1\endcsname}
%
-% \def\defineprotected#1#2%
+% \unexpanded\def\defineprotected#1#2%
% {\expandafter\def\csname\??pc\string#2\endcsname}
%
-% \def\defineunprotected#1%
+% \unexpanded\def\defineunprotected#1%
% {\def#1}
%
% \def\doprotected%
@@ -334,7 +350,7 @@
% end
% \stopluacode
%
-% \def\define#1#{\ctxlua{commands.define([[\detokenize{#1}]])}}
+% \unexpanded\def\define#1#{\ctxlua{commands.define([[\detokenize{#1}]])}}
%
% \starttext
% \define[2]\whatevera{#1+#2}
@@ -413,13 +429,4 @@
\def\defreducedargument {\dodefreducedargument\edef}
\def\gdefreducedargument{\dodefreducedargument\xdef}
-\startruntimeluacode
- \ctxlua {
- environment.inputfilename = "\inputfilename"
- environment.outputfilename = "\outputfilename"
- environment.jobfilename = "\jobfilename"
- environment.jobfilesuffix = "\jobfilesuffix"
- }
-\stopruntimeluacode
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-two.lua b/Master/texmf-dist/tex/context/base/core-two.lua
index 50c356f7be6..24a3191a775 100644
--- a/Master/texmf-dist/tex/context/base/core-two.lua
+++ b/Master/texmf-dist/tex/context/base/core-two.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['core-two'] = {
version = 1.001,
- comment = "companion to core-two.tex",
+ comment = "companion to core-two.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -124,12 +124,14 @@ end
function jobpasses.getdata(id,index,default)
local jti = collected[id]
- texprint((jit and jti[index]) or default)
+ local value = jit and jti[index]
+ texprint((value ~= "" and value) or default or "")
end
function jobpasses.getfield(id,index,tag,default)
local jti = collected[id]
jti = jti and jti[index]
- texprint((jti and jti[tag]) or default)
+ local value = jti and jti[tag]
+ texprint((value ~= "" and value) or default or "")
end
diff --git a/Master/texmf-dist/tex/context/base/core-two.mkiv b/Master/texmf-dist/tex/context/base/core-two.mkiv
index 98d396d080a..2cc9412afba 100644
--- a/Master/texmf-dist/tex/context/base/core-two.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-two.mkiv
@@ -91,7 +91,7 @@
% todo: move the edef to lua
-\def\definetwopasslist #1{\ctxlua{jobpasses.define('#1')}}
+\unexpanded\def\definetwopasslist #1{\ctxlua{jobpasses.define('#1')}}
\def\gettwopassdata #1{\edef\twopassdata{\ctxlua{jobpasses.get("#1")}}\testtwopassdata}
\def\checktwopassdata #1{\edef\twopassdata{\ctxlua{jobpasses.check("#1")}}\testtwopassdata}
\def\findtwopassdata #1#2{\edef\twopassdata{\ctxlua{jobpasses.find("#1","#2")}}\testtwopassdata}
diff --git a/Master/texmf-dist/tex/context/base/core-uti.lua b/Master/texmf-dist/tex/context/base/core-uti.lua
index 98e60be2e66..01fd8522b10 100644
--- a/Master/texmf-dist/tex/context/base/core-uti.lua
+++ b/Master/texmf-dist/tex/context/base/core-uti.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['core-uti'] = {
version = 1.001,
- comment = "companion to core-uti.tex",
+ comment = "companion to core-uti.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -17,8 +17,9 @@ utility file under different setups, we now load a table once. This
saves much runtime but at the cost of more memory usage.</p>
--ldx]]--
-local sort, concat, format = table.sort, table.concat, string.format
+local sort, concat, format, match = table.sort, table.concat, string.format, string.match
local next, type, tostring = next, type, tostring
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
if not jobs then jobs = { } end
if not job then jobs['main'] = { } end job = jobs['main']
@@ -39,8 +40,6 @@ end
job.comment(format("version: %1.2f",jobs.version))
-job._save_, job._load_ = { }, { }
-
function job.initialize(loadname,savename)
job.load(loadname)
main.register_stop_actions(function()
@@ -59,11 +58,10 @@ end
jobvariables = jobvariables or { }
jobvariables.collected = jobvariables.collected or { }
jobvariables.tobesaved = jobvariables.tobesaved or { }
-
jobvariables.checksums = jobvariables.checksums or { }
-if not jobvariables.checksums.old then jobvariables.checksums.old = md5.HEX("old") end
-if not jobvariables.checksums.new then jobvariables.checksums.new = md5.HEX("new") end
+if not jobvariables.checksums.old then jobvariables.checksums.old = md5.HEX("old") end -- used in experiment
+if not jobvariables.checksums.new then jobvariables.checksums.new = md5.HEX("new") end -- used in experiment
job.register('jobvariables.checksums', jobvariables.checksums)
@@ -71,11 +69,13 @@ local function initializer()
local r = jobvariables.collected.randomseed
if not r then
r = math.random()
+ math.setrandomseedi(r,"initialize")
+ else
+ math.setrandomseedi(r,"previous run")
end
- math.randomseed(r)
jobvariables.tobesaved.randomseed = r
for cs, value in next, jobvariables.collected do
- tex.sprint(format("\\xdef\\%s{%s}",cs,value))
+ texsprint(ctxcatcodes,format("\\xdef\\%s{%s}",cs,value))
end
end
@@ -185,7 +185,6 @@ function packer.strip(p)
p.hash = nil
end
-
local packlist = {
"numbers",
"metadata",
@@ -195,13 +194,16 @@ local packlist = {
"pagedata",
"directives",
"specification",
---~ "references",
+ "processors", -- might become key under directives or metadata
+-- "references", -- we need to rename of them as only one packs (not structure.lists.references)
}
local jobpacker = packer.new(packlist,1.01)
job.pack = true
+job._save_, job._load_ = { }, { } -- registers timing
+
function job.save(filename)
statistics.starttiming(job._save_)
local f = io.open(filename,'w')
@@ -235,7 +237,7 @@ function job.load(filename)
statistics.starttiming(job._load_)
local data = io.loaddata(filename)
if data and data ~= "" then
- local version = tonumber(data:match("^-- version: ([%d%.]+)"))
+ local version = tonumber(match(data,"^-- version: ([%d%.]+)"))
if version ~= jobs.version then
logs.report("job","version mismatch with jobfile: %s <> %s", version or "?", jobs.version)
else
@@ -246,7 +248,7 @@ function job.load(filename)
for l=1,#savelist do
local list = savelist[l]
local target, initializer = list[1], list[3]
- packer.unpack(aux.accesstable(target),job.packer,true)
+ packer.unpack(aux.accesstable(target),job.packer,true)
if type(initializer) == "function" then
initializer(aux.accesstable(target))
end
@@ -260,9 +262,7 @@ end
-- eventually this will end up in strc-ini
statistics.register("startup time", function()
- if statistics.elapsedindeed(ctx) then
- return format("%s seconds (including runtime option file processing)", statistics.elapsedtime(ctx))
- end
+ return statistics.elapsedseconds(ctx,"including runtime option file processing")
end)
statistics.register("jobdata time",function()
@@ -286,6 +286,7 @@ function statistics.formatruntime(runtime)
local pages = tex.count['realpageno'] - 1
if shipped > 0 or pages > 0 then
local persecond = shipped / runtime
+ if pages == 0 then pages = shipped end
return format("%s seconds, %i processed pages, %i shipped pages, %.3f pages/second",runtime,pages,shipped,persecond)
else
return format("%s seconds",runtime)
diff --git a/Master/texmf-dist/tex/context/base/core-uti.mkiv b/Master/texmf-dist/tex/context/base/core-uti.mkiv
index 29e6342be60..6b2dae2c9c9 100644
--- a/Master/texmf-dist/tex/context/base/core-uti.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-uti.mkiv
@@ -42,6 +42,8 @@
}%
\to \everystarttext
+\def\notuccompression{\ctxlua{job.pack=false}}
+
% cleaner, for the moment
% \appendtoks
diff --git a/Master/texmf-dist/tex/context/base/core-var.mkiv b/Master/texmf-dist/tex/context/base/core-var.mkiv
index d6e02e392ff..62cc9fc5003 100644
--- a/Master/texmf-dist/tex/context/base/core-var.mkiv
+++ b/Master/texmf-dist/tex/context/base/core-var.mkiv
@@ -107,6 +107,9 @@
\newevery \everybodyfont \EveryBodyFont
\newevery \everyfontswitch \EveryFontSwitch
+\newtoks \everysetupbodyfont
+\newtoks \everyswitchtobodyfont
+
%D Math:
\newtoks \everybeforedisplayformula
@@ -132,8 +135,8 @@
\newtoks\everystarttextproperties
\newtoks\everystoptextproperties
-\def\starttextproperties{\the\everystarttextproperties}
-\def\stoptextproperties {\the\everystoptextproperties}
+\unexpanded\def\starttextproperties{\the\everystarttextproperties}
+\unexpanded\def\stoptextproperties {\the\everystoptextproperties}
%D \macros
%D {defineinputmode,setinputmode}
@@ -142,7 +145,7 @@
% not in mkiv
-\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname}
+\unexpanded\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname}
\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks}
\defineinputmode [TEX]
@@ -198,7 +201,7 @@
\appendtoks \boxedcontenttrue \to \everyboxedcontent
-\def\startboxedcontent{\bgroup\the\everyboxedcontent}
+\unexpanded\def\startboxedcontent{\bgroup\the\everyboxedcontent}
\let\stopboxedcontent \egroup
%D \macros
@@ -227,8 +230,8 @@
%D \stoptext
%D \stoptyping
-\def\defineselector{\dodoubleargument\dodefineselector}
-\def\setupselector {\dodoubleargument\dosetupselector}
+\unexpanded\def\defineselector{\dodoubleargument\dodefineselector}
+\unexpanded\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]}
diff --git a/Master/texmf-dist/tex/context/base/data-aux.lua b/Master/texmf-dist/tex/context/base/data-aux.lua
index 492cce6fdd2..26e1f551cb0 100644
--- a/Master/texmf-dist/tex/context/base/data-aux.lua
+++ b/Master/texmf-dist/tex/context/base/data-aux.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-aux'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -8,47 +8,47 @@ if not modules then modules = { } end modules ['data-aux'] = {
local find = string.find
-local trace_verbose = false trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
function resolvers.update_script(oldname,newname) -- oldname -> own.name, not per se a suffix
local scriptpath = "scripts/context/lua"
newname = file.addsuffix(newname,"lua")
local oldscript = resolvers.clean_path(oldname)
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","to be replaced old script %s", oldscript)
end
local newscripts = resolvers.find_files(newname) or { }
if #newscripts == 0 then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","unable to locate new script")
end
else
for i=1,#newscripts do
local newscript = resolvers.clean_path(newscripts[i])
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","checking new script %s", newscript)
end
if oldscript == newscript then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","old and new script are the same")
end
elseif not find(newscript,scriptpath) then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","new script should come from %s",scriptpath)
end
elseif not (find(oldscript,file.removesuffix(newname).."$") or find(oldscript,newname.."$")) then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","invalid new script name")
end
else
local newdata = io.loaddata(newscript)
if newdata then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","old script content replaced by new content")
end
io.savedata(oldscript,newdata)
break
- elseif trace_verbose then
+ elseif trace_locating then
logs.report("fileio","unable to load new script")
end
end
diff --git a/Master/texmf-dist/tex/context/base/data-bin.lua b/Master/texmf-dist/tex/context/base/data-bin.lua
index 5f342c33981..5e4397a549f 100644
--- a/Master/texmf-dist/tex/context/base/data-bin.lua
+++ b/Master/texmf-dist/tex/context/base/data-bin.lua
@@ -1,23 +1,24 @@
if not modules then modules = { } end modules ['data-bin'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 finders, openers, loaders = resolvers.finders, resolvers.openers, resolvers.loaders
+local unpack = unpack or table.unpack
function resolvers.findbinfile(filename, filetype)
- return resolvers.methodhandler('finders',file.collapse_path(filename), filetype)
+ return resolvers.methodhandler('finders',filename, filetype)
end
function resolvers.openbinfile(filename)
- return resolvers.methodhandler('loaders',file.collapse_path(filename))
+ return resolvers.methodhandler('loaders',filename)
end
function resolvers.loadbinfile(filename, filetype)
- local fname = resolvers.findbinfile(file.collapse_path(filename), filetype)
+ local fname = resolvers.methodhandler('finders',filename, filetype)
if fname and fname ~= "" then
return resolvers.openbinfile(fname)
else
diff --git a/Master/texmf-dist/tex/context/base/data-con.lua b/Master/texmf-dist/tex/context/base/data-con.lua
index 02ee9eeddd9..fabe0baa1b7 100644
--- a/Master/texmf-dist/tex/context/base/data-con.lua
+++ b/Master/texmf-dist/tex/context/base/data-con.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-con'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -11,8 +11,6 @@ local format, lower, gsub = string.format, string.lower, string.gsub
local trace_cache = false trackers.register("resolvers.cache", function(v) trace_cache = v end)
local trace_containers = false trackers.register("resolvers.containers", function(v) trace_containers = v end)
local trace_storage = false trackers.register("resolvers.storage", function(v) trace_storage = v end)
-local trace_verbose = false trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
-local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v trackers.enable("resolvers.verbose") end)
--[[ldx--
<p>Once we found ourselves defining similar cache constructs
@@ -76,7 +74,7 @@ end
function containers.is_valid(container, name)
if name and name ~= "" then
local storage = container.storage[name]
- return storage and not table.is_empty(storage) and storage.cache_version == container.version
+ return storage and storage.cache_version == container.version
else
return false
end
diff --git a/Master/texmf-dist/tex/context/base/data-crl.lua b/Master/texmf-dist/tex/context/base/data-crl.lua
index 5cad241a689..55b1a8fad9d 100644
--- a/Master/texmf-dist/tex/context/base/data-crl.lua
+++ b/Master/texmf-dist/tex/context/base/data-crl.lua
@@ -1,11 +1,13 @@
if not modules then modules = { } end modules ['data-crl'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 gsub = string.gsub
+
curl = curl or { }
curl.cached = { }
@@ -14,9 +16,9 @@ curl.cachepath = caches.definepath("curl")
local finders, openers, loaders = resolvers.finders, resolvers.openers, resolvers.loaders
function curl.fetch(protocol, name)
- local cachename = curl.cachepath() .. "/" .. name:gsub("[^%a%d%.]+","-")
--- cachename = cachename:gsub("[\\/]", io.fileseparator)
- cachename = cachename:gsub("[\\]", "/") -- cleanup
+ local cachename = curl.cachepath() .. "/" .. gsub(name,"[^%a%d%.]+","-")
+-- cachename = gsub(cachename,"[\\/]", io.fileseparator)
+ cachename = gsub(cachename,"[\\]", "/") -- cleanup
if not curl.cached[name] then
if not io.exists(cachename) then
curl.cached[name] = cachename
diff --git a/Master/texmf-dist/tex/context/base/data-ctx.lua b/Master/texmf-dist/tex/context/base/data-ctx.lua
index 00d307b6d8b..89eb2742d68 100644
--- a/Master/texmf-dist/tex/context/base/data-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/data-ctx.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-ctx'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -19,7 +19,9 @@ function resolvers.save_used_files_in_trees(filename,jobname)
f:write(format("\t<rl:name>%s</rl:name>\n",jobname))
end
f:write("\t<rl:files>\n")
- for _,v in ipairs(table.sortedkeys(found)) do
+ local sorted = table.sortedkeys(found)
+ for k=1,#sorted do
+ local v = sorted[k]
f:write(format("\t\t<rl:file n='%s'>%s</rl:file>\n",found[v],v))
end
f:write("\t</rl:files>\n")
diff --git a/Master/texmf-dist/tex/context/base/data-gen.lua b/Master/texmf-dist/tex/context/base/data-gen.lua
index 8537b052602..5a07558315b 100644
--- a/Master/texmf-dist/tex/context/base/data-gen.lua
+++ b/Master/texmf-dist/tex/context/base/data-gen.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-gen'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/data-inp.lua b/Master/texmf-dist/tex/context/base/data-inp.lua
index 700e982c2d9..b7354e1aef3 100644
--- a/Master/texmf-dist/tex/context/base/data-inp.lua
+++ b/Master/texmf-dist/tex/context/base/data-inp.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-inp'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/data-lst.lua b/Master/texmf-dist/tex/context/base/data-lst.lua
index 10d3ea479a8..82f6754867f 100644
--- a/Master/texmf-dist/tex/context/base/data-lst.lua
+++ b/Master/texmf-dist/tex/context/base/data-lst.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-lst'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -24,7 +24,9 @@ local function list(list,report)
local instance = resolvers.instance
local pat = upper(pattern or "","")
local report = report or texio.write_nl
- for _,key in pairs(table.sortedkeys(list)) do
+ local sorted = table.sortedkeys(list)
+ for i=1,#sorted do
+ local key = sorted[i]
if instance.pattern == "" or find(upper(key),pat) then
if instance.kpseonly then
if instance.kpsevars[key] then
@@ -43,11 +45,14 @@ function resolvers.listers.expansions() list(resolvers.instance.expansions) end
function resolvers.listers.configurations(report)
local report = report or texio.write_nl
local instance = resolvers.instance
- for _,key in ipairs(table.sortedkeys(instance.kpsevars)) do
+ local sorted = table.sortedkeys(instance.kpsevars)
+ for i=1,#sorted do
+ local key = sorted[i]
if not instance.pattern or (instance.pattern=="") or find(key,instance.pattern) then
report(format("%s\n",key))
- for i,c in ipairs(instance.order) do
- local str = c[key]
+ local order = instance.order
+ for i=1,#order do
+ local str = order[i][key]
if str then
report(format("\t%s\t%s",i,str))
end
diff --git a/Master/texmf-dist/tex/context/base/data-lua.lua b/Master/texmf-dist/tex/context/base/data-lua.lua
index 86231b3a3a9..988133fbecf 100644
--- a/Master/texmf-dist/tex/context/base/data-lua.lua
+++ b/Master/texmf-dist/tex/context/base/data-lua.lua
@@ -1,55 +1,152 @@
if not modules then modules = { } end modules ['data-lua'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
}
--- some loading stuff ... we might move this one to slot 1 depending
+-- some loading stuff ... we might move this one to slot 2 depending
-- on the developments (the loaders must not trigger kpse); we could
-- of course use a more extensive lib path spec
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
-local gsub = string.gsub
+local gsub, insert = string.gsub, table.insert
+local unpack = unpack or table.unpack
-local libformats = { 'luatexlibs', 'tex', 'texmfscripts', 'othertextfiles' }
-local libpaths = file.split_path(package.path)
+local libformats = { 'luatexlibs', 'tex', 'texmfscripts', 'othertextfiles' } -- 'luainputs'
+local clibformats = { 'lib' }
-package.loaders[#package.loaders+1] = function(name)
+local _path_, libpaths, _cpath_, clibpaths
+
+function package.libpaths()
+ if not _path_ or package.path ~= _path_ then
+ _path_ = package.path
+ libpaths = file.split_path(_path_,";")
+ end
+ return libpaths
+end
+
+function package.clibpaths()
+ if not _cpath_ or package.cpath ~= _cpath_ then
+ _cpath_ = package.cpath
+ clibpaths = file.split_path(_cpath_,";")
+ end
+ return clibpaths
+end
+
+local function thepath(...)
+ local t = { ... } t[#t+1] = "?.lua"
+ local path = file.join(unpack(t))
+ if trace_locating then
+ logs.report("fileio","! appending '%s' to 'package.path'",path)
+ end
+ return path
+end
+
+local p_libpaths, a_libpaths = { }, { }
+
+function package.append_libpath(...)
+ insert(a_libpath,thepath(...))
+end
+
+function package.prepend_libpath(...)
+ insert(p_libpaths,1,thepath(...))
+end
+
+-- beware, we need to return a loadfile result !
+
+local function loaded(libpaths,name,simple)
+ for i=1,#libpaths do -- package.path, might become option
+ local libpath = libpaths[i]
+ local resolved = gsub(libpath,"%?",simple)
+ if trace_locating then -- more detail
+ logs.report("fileio","! checking for '%s' on 'package.path': '%s' => '%s'",simple,libpath,resolved)
+ end
+ if resolvers.isreadable.file(resolved) then
+ if trace_locating then
+ logs.report("fileio","! lib '%s' located via 'package.path': '%s'",name,resolved)
+ end
+ return loadfile(resolved)
+ end
+ end
+end
+
+
+package.loaders[2] = function(name) -- was [#package.loaders+1]
+ if trace_locating then -- mode detail
+ logs.report("fileio","! locating '%s'",name)
+ end
for i=1,#libformats do
local format = libformats[i]
local resolved = resolvers.find_file(name,format) or ""
+ if trace_locating then -- mode detail
+ logs.report("fileio","! checking for '%s' using 'libformat path': '%s'",name,format)
+ end
if resolved ~= "" then
if trace_locating then
logs.report("fileio","! lib '%s' located via environment: '%s'",name,resolved)
end
- return function() return dofile(resolved) end
+ return loadfile(resolved)
end
end
- local simple = file.removesuffix(name)
- for i=1,#libpaths do
- local resolved = gsub(libpaths[i],"?",simple)
+ -- libpaths
+ local libpaths, clibpaths = package.libpaths(), package.clibpaths()
+ local simple = gsub(name,"%.lua$","")
+ local simple = gsub(simple,"%.","/")
+ local resolved = loaded(p_libpaths,name,simple) or loaded(libpaths,name,simple) or loaded(a_libpaths,name,simple)
+ if resolved then
+ return resolved
+ end
+ --
+ local libname = file.addsuffix(simple,os.libsuffix)
+ for i=1,#clibformats do
+ -- better have a dedicated loop
+ local format = clibformats[i]
+ local paths = resolvers.expanded_path_list_from_var(format)
+ for p=1,#paths do
+ local path = paths[p]
+ local resolved = file.join(path,libname)
+ if trace_locating then -- mode detail
+ logs.report("fileio","! checking for '%s' using 'clibformat path': '%s'",libname,path)
+ end
+ if resolvers.isreadable.file(resolved) then
+ if trace_locating then
+ logs.report("fileio","! lib '%s' located via 'clibformat': '%s'",libname,resolved)
+ end
+ return package.loadlib(resolved,name)
+ end
+ end
+ end
+ for i=1,#clibpaths do -- package.path, might become option
+ local libpath = clibpaths[i]
+ local resolved = gsub(libpath,"?",simple)
+ if trace_locating then -- more detail
+ logs.report("fileio","! checking for '%s' on 'package.cpath': '%s'",simple,libpath)
+ end
if resolvers.isreadable.file(resolved) then
if trace_locating then
- logs.report("fileio","! lib '%s' located via 'package.path': '%s'",name,resolved)
+ logs.report("fileio","! lib '%s' located via 'package.cpath': '%s'",name,resolved)
end
- return function() return dofile(resolved) end
+ return package.loadlib(resolved,name)
end
end
-- just in case the distribution is messed up
+ if trace_loading then -- more detail
+ logs.report("fileio","! checking for '%s' using 'luatexlibs': '%s'",name)
+ end
local resolved = resolvers.find_file(file.basename(name),'luatexlibs') or ""
if resolved ~= "" then
if trace_locating then
logs.report("fileio","! lib '%s' located by basename via environment: '%s'",name,resolved)
end
- return function() return dofile(resolved) end
+ return loadfile(resolved)
end
if trace_locating then
logs.report("fileio",'? unable to locate lib: %s',name)
end
- return "unable to locate " .. name
+-- return "unable to locate " .. name
end
resolvers.loadlualib = require
diff --git a/Master/texmf-dist/tex/context/base/data-out.lua b/Master/texmf-dist/tex/context/base/data-out.lua
index b774e25fcf8..f73ff9bdcf7 100644
--- a/Master/texmf-dist/tex/context/base/data-out.lua
+++ b/Master/texmf-dist/tex/context/base/data-out.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-out'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/data-pre.lua b/Master/texmf-dist/tex/context/base/data-pre.lua
index deee9ebf46f..9348f6cd39c 100644
--- a/Master/texmf-dist/tex/context/base/data-pre.lua
+++ b/Master/texmf-dist/tex/context/base/data-pre.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-res'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -35,6 +35,14 @@ prefixes.relative = function(str,n)
return resolvers.clean_path(str)
end
+prefixes.auto = function(str)
+ local fullname = prefixes.relative(str)
+ if not lfs.isfile(fullname) then
+ fullname = prefixes.locate(str)
+ end
+ return fullname
+end
+
prefixes.locate = function(str)
local fullname = resolvers.find_given_file(str) or ""
return resolvers.clean_path((fullname ~= "" and fullname) or str)
@@ -58,6 +66,16 @@ prefixes.full = prefixes.locate
prefixes.file = prefixes.filename
prefixes.path = prefixes.pathname
+function resolvers.allprefixes(separator)
+ local all = table.sortedkeys(prefixes)
+ if separator then
+ for i=1,#all do
+ all[i] = all[i] .. ":"
+ end
+ end
+ return all
+end
+
local function _resolve_(method,target)
if prefixes[method] then
return prefixes[method](target)
@@ -68,7 +86,8 @@ end
local function resolve(str)
if type(str) == "table" then
- for k, v in pairs(str) do -- ipairs
+ for k=1,#str do
+ local v = str[k]
str[k] = resolve(v) or v
end
elseif str and str ~= "" then
@@ -81,7 +100,7 @@ resolvers.resolve = resolve
if os.uname then
- for k, v in pairs(os.uname()) do
+ for k, v in next, os.uname() do
if not prefixes[k] then
prefixes[k] = function() return v end
end
diff --git a/Master/texmf-dist/tex/context/base/data-res.lua b/Master/texmf-dist/tex/context/base/data-res.lua
index 39e4aa208fc..ecef1418860 100644
--- a/Master/texmf-dist/tex/context/base/data-res.lua
+++ b/Master/texmf-dist/tex/context/base/data-res.lua
@@ -1,9 +1,9 @@
if not modules then modules = { } end modules ['data-inp'] = {
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",
- comment = "companion to luat-lib.tex",
}
-- After a few years using the code the large luat-inp.lua file
@@ -15,7 +15,7 @@ if not modules then modules = { } end modules ['data-inp'] = {
-- * some public auxiliary functions were made private
--
-- TODO: os.getenv -> os.env[]
--- TODO: instances.[hashes,cnffiles,configurations,522] -> ipairs (alles check, sneller)
+-- TODO: instances.[hashes,cnffiles,configurations,522]
-- TODO: check escaping in find etc, too much, too slow
-- This lib is multi-purpose and can be loaded again later on so that
@@ -36,12 +36,13 @@ if not modules then modules = { } end modules ['data-inp'] = {
local format, gsub, find, lower, upper, match, gmatch = string.format, string.gsub, string.find, string.lower, string.upper, string.match, string.gmatch
local concat, insert, sortedkeys = table.concat, table.insert, table.sortedkeys
local next, type = next, type
+local lpegmatch = lpeg.match
-local trace_locating, trace_detail, trace_verbose = false, false, false
+local trace_locating, trace_detail, trace_expansions = false, false, false
-trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
-trackers.register("resolvers.locating", function(v) trace_locating = v trackers.enable("resolvers.verbose") end)
-trackers.register("resolvers.detail", function(v) trace_detail = v trackers.enable("resolvers.verbose,resolvers.detail") end)
+trackers.register("resolvers.locating", function(v) trace_locating = v end)
+trackers.register("resolvers.details", function(v) trace_detail = v end)
+trackers.register("resolvers.expansions", function(v) trace_expansions = v end) -- todo
if not resolvers then
resolvers = {
@@ -65,7 +66,7 @@ resolvers.generators.notfound = { nil }
resolvers.cacheversion = '1.0.1'
resolvers.cnfname = 'texmf.cnf'
resolvers.luaname = 'texmfcnf.lua'
-resolvers.homedir = os.env[os.platform == "windows" and 'USERPROFILE'] or os.env['HOME'] or '~'
+resolvers.homedir = os.env[os.type == "windows" and 'USERPROFILE'] or os.env['HOME'] or '~'
resolvers.cnfdefault = '{$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,.local,}/web2c}'
local dummy_path_expr = "^!*unset/*$"
@@ -107,8 +108,8 @@ suffixes['lua'] = { 'lua', 'luc', 'tma', 'tmc' }
alternatives['map files'] = 'map'
alternatives['enc files'] = 'enc'
-alternatives['cid files'] = 'cid'
-alternatives['fea files'] = 'fea'
+alternatives['cid maps'] = 'cid' -- great, why no cid files
+alternatives['font feature files'] = 'fea' -- and fea files here
alternatives['opentype fonts'] = 'otf'
alternatives['truetype fonts'] = 'ttf'
alternatives['truetype collections'] = 'ttc'
@@ -124,6 +125,11 @@ formats ['sfd'] = 'SFDFONTS'
suffixes ['sfd'] = { 'sfd' }
alternatives['subfont definition files'] = 'sfd'
+-- lib paths
+
+formats ['lib'] = 'CLUAINPUTS' -- new (needs checking)
+suffixes['lib'] = (os.libsuffix and { os.libsuffix }) or { 'dll', 'so' }
+
-- In practice we will work within one tds tree, but i want to keep
-- the option open to build tools that look at multiple trees, which is
-- why we keep the tree specific data in a table. We used to pass the
@@ -246,8 +252,10 @@ local function check_configuration() -- not yet ok, no time for debugging now
-- bad luck
end
fix("LUAINPUTS" , ".;$TEXINPUTS;$TEXMFSCRIPTS") -- no progname, hm
- fix("FONTFEATURES", ".;$TEXMF/fonts/fea//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS")
- fix("FONTCIDMAPS" , ".;$TEXMF/fonts/cid//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS")
+ -- this will go away some day
+ fix("FONTFEATURES", ".;$TEXMF/fonts/{data,fea}//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS")
+ fix("FONTCIDMAPS" , ".;$TEXMF/fonts/{data,cid}//;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS")
+ --
fix("LUATEXLIBS" , ".;$TEXMF/luatex/lua//")
end
@@ -262,7 +270,7 @@ function resolvers.settrace(n) -- no longer number but: 'locating' or 'detail'
end
end
-resolvers.settrace(os.getenv("MTX.resolvers.TRACE") or os.getenv("MTX_INPUT_TRACE"))
+resolvers.settrace(os.getenv("MTX_INPUT_TRACE"))
function resolvers.osenv(key)
local ie = instance.environment
@@ -350,37 +358,43 @@ end
-- work that well; the parsing is ok, but dealing with the resulting
-- table is a pain because we need to work inside-out recursively
+local function do_first(a,b)
+ local t = { }
+ for s in gmatch(b,"[^,]+") do t[#t+1] = a .. s end
+ return "{" .. concat(t,",") .. "}"
+end
+
+local function do_second(a,b)
+ local t = { }
+ for s in gmatch(a,"[^,]+") do t[#t+1] = s .. b end
+ return "{" .. concat(t,",") .. "}"
+end
+
+local function do_both(a,b)
+ local t = { }
+ for sa in gmatch(a,"[^,]+") do
+ for sb in gmatch(b,"[^,]+") do
+ t[#t+1] = sa .. sb
+ end
+ end
+ return "{" .. concat(t,",") .. "}"
+end
+
+local function do_three(a,b,c)
+ return a .. b.. c
+end
+
local function splitpathexpr(str, t, validate)
-- no need for further optimization as it is only called a
- -- few times, we can use lpeg for the sub; we could move
- -- the local functions outside the body
+ -- few times, we can use lpeg for the sub
+ if trace_expansions then
+ logs.report("fileio","expanding variable '%s'",str)
+ end
t = t or { }
str = gsub(str,",}",",@}")
str = gsub(str,"{,","{@,")
-- str = "@" .. str .. "@"
local ok, done
- local function do_first(a,b)
- local t = { }
- for s in gmatch(b,"[^,]+") do t[#t+1] = a .. s end
- return "{" .. concat(t,",") .. "}"
- end
- local function do_second(a,b)
- local t = { }
- for s in gmatch(a,"[^,]+") do t[#t+1] = s .. b end
- return "{" .. concat(t,",") .. "}"
- end
- local function do_both(a,b)
- local t = { }
- for sa in gmatch(a,"[^,]+") do
- for sb in gmatch(b,"[^,]+") do
- t[#t+1] = sa .. sb
- end
- end
- return "{" .. concat(t,",") .. "}"
- end
- local function do_three(a,b,c)
- return a .. b.. c
- end
while true do
done = false
while true do
@@ -411,6 +425,11 @@ local function splitpathexpr(str, t, validate)
t[#t+1] = s
end
end
+ if trace_expansions then
+ for k=1,#t do
+ logs.report("fileio","% 4i: %s",k,t[k])
+ end
+ end
return t
end
@@ -450,18 +469,27 @@ end
-- also we now follow the stupid route: if not set then just assume *one*
-- cnf file under texmf (i.e. distribution)
-resolvers.ownpath = resolvers.ownpath or nil
-resolvers.ownbin = resolvers.ownbin or arg[-2] or arg[-1] or arg[0] or "luatex"
-resolvers.autoselfdir = true -- false may be handy for debugging
+local args = environment and environment.original_arguments or arg -- this needs a cleanup
+
+resolvers.ownbin = resolvers.ownbin or args[-2] or arg[-2] or args[-1] or arg[-1] or arg[0] or "luatex"
+resolvers.ownbin = gsub(resolvers.ownbin,"\\","/")
function resolvers.getownpath()
- if not resolvers.ownpath then
- if resolvers.autoselfdir and os.selfdir then
- resolvers.ownpath = os.selfdir
- else
- local binary = resolvers.ownbin
- if os.platform == "windows" then
- binary = file.replacesuffix(binary,"exe")
+ local ownpath = resolvers.ownpath or os.selfdir
+ if not ownpath or ownpath == "" or ownpath == "unset" then
+ ownpath = args[-1] or arg[-1]
+ ownpath = ownpath and file.dirname(gsub(ownpath,"\\","/"))
+ if not ownpath or ownpath == "" then
+ ownpath = args[-0] or arg[-0]
+ ownpath = ownpath and file.dirname(gsub(ownpath,"\\","/"))
+ end
+ local binary = resolvers.ownbin
+ if not ownpath or ownpath == "" then
+ ownpath = ownpath and file.dirname(binary)
+ end
+ if not ownpath or ownpath == "" then
+ if os.binsuffix ~= "" then
+ binary = file.replacesuffix(binary,os.binsuffix)
end
for p in gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do
local b = file.join(p,binary)
@@ -473,30 +501,39 @@ function resolvers.getownpath()
local olddir = lfs.currentdir()
if lfs.chdir(p) then
local pp = lfs.currentdir()
- if trace_verbose and p ~= pp then
- logs.report("fileio","following symlink %s to %s",p,pp)
+ if trace_locating and p ~= pp then
+ logs.report("fileio","following symlink '%s' to '%s'",p,pp)
end
- resolvers.ownpath = pp
+ ownpath = pp
lfs.chdir(olddir)
else
- if trace_verbose then
- logs.report("fileio","unable to check path %s",p)
+ if trace_locating then
+ logs.report("fileio","unable to check path '%s'",p)
end
- resolvers.ownpath = p
+ ownpath = p
end
break
end
end
end
- if not resolvers.ownpath then resolvers.ownpath = '.' end
+ if not ownpath or ownpath == "" then
+ ownpath = "."
+ logs.report("fileio","forcing fallback ownpath .")
+ elseif trace_locating then
+ logs.report("fileio","using ownpath '%s'",ownpath)
+ end
end
- return resolvers.ownpath
+ resolvers.ownpath = ownpath
+ function resolvers.getownpath()
+ return resolvers.ownpath
+ end
+ return ownpath
end
local own_places = { "SELFAUTOLOC", "SELFAUTODIR", "SELFAUTOPARENT", "TEXMFCNF" }
local function identify_own()
- local ownpath = resolvers.getownpath() or lfs.currentdir()
+ local ownpath = resolvers.getownpath() or dir.current()
local ie = instance.environment
if ownpath then
if resolvers.env('SELFAUTOLOC') == "" then os.env['SELFAUTOLOC'] = file.collapse_path(ownpath) end
@@ -509,10 +546,10 @@ local function identify_own()
if resolvers.env('TEXMFCNF') == "" then os.env['TEXMFCNF'] = resolvers.cnfdefault end
if resolvers.env('TEXOS') == "" then os.env['TEXOS'] = resolvers.env('SELFAUTODIR') end
if resolvers.env('TEXROOT') == "" then os.env['TEXROOT'] = resolvers.env('SELFAUTOPARENT') end
- if trace_verbose then
+ if trace_locating then
for i=1,#own_places do
local v = own_places[i]
- logs.report("fileio","variable %s set to %s",v,resolvers.env(v) or "unknown")
+ logs.report("fileio","variable '%s' set to '%s'",v,resolvers.env(v) or "unknown")
end
end
identify_own = function() end
@@ -544,10 +581,8 @@ end
local function load_cnf_file(fname)
fname = resolvers.clean_path(fname)
local lname = file.replacesuffix(fname,'lua')
- local f = io.open(lname)
- if f then -- this will go
- f:close()
- local dname = file.dirname(fname)
+ if lfs.isfile(lname) then
+ local dname = file.dirname(fname) -- fname ?
if not instance.configuration[dname] then
resolvers.load_data(dname,'configuration',lname and file.basename(lname))
instance.order[#instance.order+1] = instance.configuration[dname]
@@ -555,8 +590,8 @@ local function load_cnf_file(fname)
else
f = io.open(fname)
if f then
- if trace_verbose then
- logs.report("fileio","loading %s", fname)
+ if trace_locating then
+ logs.report("fileio","loading configuration file %s", fname)
end
local line, data, n, k, v
local dname = file.dirname(fname)
@@ -590,14 +625,16 @@ local function load_cnf_file(fname)
end
end
f:close()
- elseif trace_verbose then
- logs.report("fileio","skipping %s", fname)
+ elseif trace_locating then
+ logs.report("fileio","skipping configuration file '%s'", fname)
end
end
end
local function collapse_cnf_data() -- potential optimization: pass start index (setup and configuration are shared)
- for _,c in ipairs(instance.order) do
+ local order = instance.order
+ for i=1,#order do
+ local c = order[i]
for k,v in next, c do
if not instance.variables[k] then
if instance.environment[k] then
@@ -613,19 +650,24 @@ end
function resolvers.load_cnf()
local function loadoldconfigdata()
- for _, fname in ipairs(instance.cnffiles) do
- load_cnf_file(fname)
+ local cnffiles = instance.cnffiles
+ for i=1,#cnffiles do
+ load_cnf_file(cnffiles[i])
end
end
-- instance.cnffiles contain complete names now !
+ -- we still use a funny mix of cnf and new but soon
+ -- we will switch to lua exclusively as we only use
+ -- the file to collect the tree roots
if #instance.cnffiles == 0 then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","no cnf files found (TEXMFCNF may not be set/known)")
end
else
- instance.rootpath = instance.cnffiles[1]
- for k,fname in ipairs(instance.cnffiles) do
- instance.cnffiles[k] = file.collapse_path(gsub(fname,"\\",'/'))
+ local cnffiles = instance.cnffiles
+ instance.rootpath = cnffiles[1]
+ for k=1,#cnffiles do
+ instance.cnffiles[k] = file.collapse_path(cnffiles[k])
end
for i=1,3 do
instance.rootpath = file.dirname(instance.rootpath)
@@ -653,8 +695,9 @@ function resolvers.load_lua()
-- yet harmless
else
instance.rootpath = instance.luafiles[1]
- for k,fname in ipairs(instance.luafiles) do
- instance.luafiles[k] = file.collapse_path(gsub(fname,"\\",'/'))
+ local luafiles = instance.luafiles
+ for k=1,#luafiles do
+ instance.luafiles[k] = file.collapse_path(luafiles[k])
end
for i=1,3 do
instance.rootpath = file.dirname(instance.rootpath)
@@ -686,14 +729,14 @@ end
function resolvers.append_hash(type,tag,name)
if trace_locating then
- logs.report("fileio","= hash append: %s",tag)
+ logs.report("fileio","hash '%s' appended",tag)
end
insert(instance.hashes, { ['type']=type, ['tag']=tag, ['name']=name } )
end
function resolvers.prepend_hash(type,tag,name)
if trace_locating then
- logs.report("fileio","= hash prepend: %s",tag)
+ logs.report("fileio","hash '%s' prepended",tag)
end
insert(instance.hashes, 1, { ['type']=type, ['tag']=tag, ['name']=name } )
end
@@ -717,9 +760,11 @@ end
-- locators
function resolvers.locatelists()
- for _, path in ipairs(resolvers.clean_path_list('TEXMF')) do
- if trace_verbose then
- logs.report("fileio","locating list of %s",path)
+ local texmfpaths = resolvers.clean_path_list('TEXMF')
+ for i=1,#texmfpaths do
+ local path = texmfpaths[i]
+ if trace_locating then
+ logs.report("fileio","locating list of '%s'",path)
end
resolvers.locatedatabase(file.collapse_path(path))
end
@@ -732,11 +777,11 @@ end
function resolvers.locators.tex(specification)
if specification and specification ~= '' and lfs.isdir(specification) then
if trace_locating then
- logs.report("fileio",'! tex locator found: %s',specification)
+ logs.report("fileio","tex locator '%s' found",specification)
end
resolvers.append_hash('file',specification,filename)
elseif trace_locating then
- logs.report("fileio",'? tex locator not found: %s',specification)
+ logs.report("fileio","tex locator '%s' not found",specification)
end
end
@@ -750,7 +795,9 @@ function resolvers.loadfiles()
instance.loaderror = false
instance.files = { }
if not instance.renewcache then
- for _, hash in ipairs(instance.hashes) do
+ local hashes = instance.hashes
+ for k=1,#hashes do
+ local hash = hashes[k]
resolvers.hashdatabase(hash.tag,hash.name)
if instance.loaderror then break end
end
@@ -764,8 +811,9 @@ end
-- generators:
function resolvers.loadlists()
- for _, hash in ipairs(instance.hashes) do
- resolvers.generatedatabase(hash.tag)
+ local hashes = instance.hashes
+ for i=1,#hashes do
+ resolvers.generatedatabase(hashes[i].tag)
end
end
@@ -777,10 +825,27 @@ end
local weird = lpeg.P(".")^1 + lpeg.anywhere(lpeg.S("~`!#$%^&*()={}[]:;\"\'||<>,?\n\r\t"))
+--~ local l_forbidden = lpeg.S("~`!#$%^&*()={}[]:;\"\'||\\/<>,?\n\r\t")
+--~ local l_confusing = lpeg.P(" ")
+--~ local l_character = lpeg.patterns.utf8
+--~ local l_dangerous = lpeg.P(".")
+
+--~ local l_normal = (l_character - l_forbidden - l_confusing - l_dangerous) * (l_character - l_forbidden - l_confusing^2)^0 * lpeg.P(-1)
+--~ ----- l_normal = l_normal * lpeg.Cc(true) + lpeg.Cc(false)
+
+--~ local function test(str)
+--~ print(str,lpeg.match(l_normal,str))
+--~ end
+--~ test("ヒラギノ明朝 Pro W3")
+--~ test("..ヒラギノ明朝 Pro W3")
+--~ test(":ヒラギノ明朝 Pro W3;")
+--~ test("ヒラギノ明朝 /Pro W3;")
+--~ test("ヒラギノ明朝 Pro W3")
+
function resolvers.generators.tex(specification)
local tag = specification
- if trace_verbose then
- logs.report("fileio","scanning path %s",specification)
+ if trace_locating then
+ logs.report("fileio","scanning path '%s'",specification)
end
instance.files[tag] = { }
local files = instance.files[tag]
@@ -796,7 +861,8 @@ function resolvers.generators.tex(specification)
full = spec
end
for name in directory(full) do
- if not weird:match(name) then
+ if not lpegmatch(weird,name) then
+ -- if lpegmatch(l_normal,name) then
local mode = attributes(full..name,'mode')
if mode == 'file' then
if path then
@@ -829,7 +895,7 @@ function resolvers.generators.tex(specification)
end
end
action()
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","%s files found on %s directories with %s uppercase remappings",n,m,r)
end
end
@@ -844,11 +910,48 @@ end
-- we join them and split them after the expansion has taken place. This
-- is more convenient.
+--~ local checkedsplit = string.checkedsplit
+
+local cache = { }
+
+local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;")))
+
+local function split_kpse_path(str) -- beware, this can be either a path or a {specification}
+ local found = cache[str]
+ if not found then
+ if str == "" then
+ found = { }
+ else
+ str = gsub(str,"\\","/")
+--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator)
+local split = lpegmatch(splitter,str)
+ found = { }
+ for i=1,#split do
+ local s = split[i]
+ if not find(s,"^{*unset}*") then
+ found[#found+1] = s
+ end
+ end
+ if trace_expansions then
+ logs.report("fileio","splitting path specification '%s'",str)
+ for k=1,#found do
+ logs.report("fileio","% 4i: %s",k,found[k])
+ end
+ end
+ cache[str] = found
+ end
+ end
+ return found
+end
+
+resolvers.split_kpse_path = split_kpse_path
+
function resolvers.splitconfig()
- for i,c in ipairs(instance) do
- for k,v in pairs(c) do
+ for i=1,#instance do
+ local c = instance[i]
+ for k,v in next, c do
if type(v) == 'string' then
- local t = file.split_path(v)
+ local t = split_kpse_path(v)
if #t > 1 then
c[k] = t
end
@@ -858,21 +961,25 @@ function resolvers.splitconfig()
end
function resolvers.joinconfig()
- for i,c in ipairs(instance.order) do
- for k,v in pairs(c) do -- ipairs?
+ local order = instance.order
+ for i=1,#order do
+ local c = order[i]
+ for k,v in next, c do -- indexed?
if type(v) == 'table' then
c[k] = file.join_path(v)
end
end
end
end
+
function resolvers.split_path(str)
if type(str) == 'table' then
return str
else
- return file.split_path(str)
+ return split_kpse_path(str)
end
end
+
function resolvers.join_path(str)
if type(str) == 'table' then
return file.join_path(str)
@@ -884,8 +991,9 @@ end
function resolvers.splitexpansions()
local ie = instance.expansions
for k,v in next, ie do
- local t, h = { }, { }
- for _,vv in ipairs(file.split_path(v)) do
+ local t, h, p = { }, { }, split_kpse_path(v)
+ for kk=1,#p do
+ local vv = p[kk]
if vv ~= "" and not h[vv] then
t[#t+1] = vv
h[vv] = true
@@ -932,11 +1040,15 @@ function resolvers.serialize(files)
end
t[#t+1] = "return {"
if instance.sortdata then
- for _, k in pairs(sortedkeys(files)) do -- ipairs
+ local sortedfiles = sortedkeys(files)
+ for i=1,#sortedfiles do
+ local k = sortedfiles[i]
local fk = files[k]
if type(fk) == 'table' then
t[#t+1] = "\t['" .. k .. "']={"
- for _, kk in pairs(sortedkeys(fk)) do -- ipairs
+ local sortedfk = sortedkeys(fk)
+ for j=1,#sortedfk do
+ local kk = sortedfk[j]
t[#t+1] = dump(kk,fk[kk],"\t\t")
end
t[#t+1] = "\t},"
@@ -961,12 +1073,18 @@ function resolvers.serialize(files)
return concat(t,"\n")
end
+local data_state = { }
+
+function resolvers.data_state()
+ return data_state or { }
+end
+
function resolvers.save_data(dataname, makename) -- untested without cache overload
for cachename, files in next, instance[dataname] do
local name = (makename or file.join)(cachename,dataname)
local luaname, lucname = name .. ".lua", name .. ".luc"
- if trace_verbose then
- logs.report("fileio","preparing %s for %s",dataname,cachename)
+ if trace_locating then
+ logs.report("fileio","preparing '%s' for '%s'",dataname,cachename)
end
for k, v in next, files do
if type(v) == "table" and #v == 1 then
@@ -980,24 +1098,25 @@ function resolvers.save_data(dataname, makename) -- untested without cache overl
date = os.date("%Y-%m-%d"),
time = os.date("%H:%M:%S"),
content = files,
+ uuid = os.uuid(),
}
local ok = io.savedata(luaname,resolvers.serialize(data))
if ok then
- if trace_verbose then
- logs.report("fileio","%s saved in %s",dataname,luaname)
+ if trace_locating then
+ logs.report("fileio","'%s' saved in '%s'",dataname,luaname)
end
if utils.lua.compile(luaname,lucname,false,true) then -- no cleanup but strip
- if trace_verbose then
- logs.report("fileio","%s compiled to %s",dataname,lucname)
+ if trace_locating then
+ logs.report("fileio","'%s' compiled to '%s'",dataname,lucname)
end
else
- if trace_verbose then
- logs.report("fileio","compiling failed for %s, deleting file %s",dataname,lucname)
+ if trace_locating then
+ logs.report("fileio","compiling failed for '%s', deleting file '%s'",dataname,lucname)
end
os.remove(lucname)
end
- elseif trace_verbose then
- logs.report("fileio","unable to save %s in %s (access error)",dataname,luaname)
+ elseif trace_locating then
+ logs.report("fileio","unable to save '%s' in '%s' (access error)",dataname,luaname)
end
end
end
@@ -1009,19 +1128,20 @@ function resolvers.load_data(pathname,dataname,filename,makename) -- untested wi
if blob then
local data = blob()
if data and data.content and data.type == dataname and data.version == resolvers.cacheversion then
- if trace_verbose then
- logs.report("fileio","loading %s for %s from %s",dataname,pathname,filename)
+ data_state[#data_state+1] = data.uuid
+ if trace_locating then
+ logs.report("fileio","loading '%s' for '%s' from '%s'",dataname,pathname,filename)
end
instance[dataname][pathname] = data.content
else
- if trace_verbose then
- logs.report("fileio","skipping %s for %s from %s",dataname,pathname,filename)
+ if trace_locating then
+ logs.report("fileio","skipping '%s' for '%s' from '%s'",dataname,pathname,filename)
end
instance[dataname][pathname] = { }
instance.loaderror = true
end
- elseif trace_verbose then
- logs.report("fileio","skipping %s for %s from %s",dataname,pathname,filename)
+ elseif trace_locating then
+ logs.report("fileio","skipping '%s' for '%s' from '%s'",dataname,pathname,filename)
end
end
@@ -1040,15 +1160,17 @@ function resolvers.resetconfig()
end
function resolvers.loadnewconfig()
- for _, cnf in ipairs(instance.luafiles) do
+ local luafiles = instance.luafiles
+ for i=1,#luafiles do
+ local cnf = luafiles[i]
local pathname = file.dirname(cnf)
local filename = file.join(pathname,resolvers.luaname)
local blob = loadfile(filename)
if blob then
local data = blob()
if data then
- if trace_verbose then
- logs.report("fileio","loading configuration file %s",filename)
+ if trace_locating then
+ logs.report("fileio","loading configuration file '%s'",filename)
end
if true then
-- flatten to variable.progname
@@ -1069,14 +1191,14 @@ function resolvers.loadnewconfig()
instance['setup'][pathname] = data
end
else
- if trace_verbose then
- logs.report("fileio","skipping configuration file %s",filename)
+ if trace_locating then
+ logs.report("fileio","skipping configuration file '%s'",filename)
end
instance['setup'][pathname] = { }
instance.loaderror = true
end
- elseif trace_verbose then
- logs.report("fileio","skipping configuration file %s",filename)
+ elseif trace_locating then
+ logs.report("fileio","skipping configuration file '%s'",filename)
end
instance.order[#instance.order+1] = instance.setup[pathname]
if instance.loaderror then break end
@@ -1085,7 +1207,9 @@ end
function resolvers.loadoldconfig()
if not instance.renewcache then
- for _, cnf in ipairs(instance.cnffiles) do
+ local cnffiles = instance.cnffiles
+ for i=1,#cnffiles do
+ local cnf = cnffiles[i]
local dname = file.dirname(cnf)
resolvers.load_data(dname,'configuration')
instance.order[#instance.order+1] = instance.configuration[dname]
@@ -1275,7 +1399,7 @@ end
function resolvers.expanded_path_list(str)
if not str then
- return ep or { }
+ return ep or { } -- ep ?
elseif instance.savelists then
-- engine+progname hash
str = gsub(str,"%$","")
@@ -1293,9 +1417,9 @@ end
function resolvers.expanded_path_list_from_var(str) -- brrr
local tmp = resolvers.var_of_format_or_suffix(gsub(str,"%$",""))
if tmp ~= "" then
- return resolvers.expanded_path_list(str)
- else
return resolvers.expanded_path_list(tmp)
+ else
+ return resolvers.expanded_path_list(str)
end
end
@@ -1342,9 +1466,9 @@ function resolvers.isreadable.file(name)
local readable = lfs.isfile(name) -- brrr
if trace_detail then
if readable then
- logs.report("fileio","+ readable: %s",name)
+ logs.report("fileio","file '%s' is readable",name)
else
- logs.report("fileio","- readable: %s", name)
+ logs.report("fileio","file '%s' is not readable", name)
end
end
return readable
@@ -1360,7 +1484,7 @@ local function collect_files(names)
for k=1,#names do
local fname = names[k]
if trace_detail then
- logs.report("fileio","? blobpath asked: %s",fname)
+ logs.report("fileio","checking name '%s'",fname)
end
local bname = file.basename(fname)
local dname = file.dirname(fname)
@@ -1376,7 +1500,7 @@ local function collect_files(names)
local files = blobpath and instance.files[blobpath]
if files then
if trace_detail then
- logs.report("fileio",'? blobpath do: %s (%s)',blobpath,bname)
+ logs.report("fileio","deep checking '%s' (%s)",blobpath,bname)
end
local blobfile = files[bname]
if not blobfile then
@@ -1410,7 +1534,7 @@ local function collect_files(names)
end
end
elseif trace_locating then
- logs.report("fileio",'! blobpath no: %s (%s)',blobpath,bname)
+ logs.report("fileio","no match in '%s' (%s)",blobpath,bname)
end
end
end
@@ -1460,14 +1584,13 @@ end
local function collect_instance_files(filename,collected) -- todo : plugin (scanners, checkers etc)
local result = collected or { }
local stamp = nil
- filename = file.collapse_path(filename) -- elsewhere
- filename = file.collapse_path(gsub(filename,"\\","/")) -- elsewhere
+ filename = file.collapse_path(filename)
-- speed up / beware: format problem
if instance.remember then
stamp = filename .. "--" .. instance.engine .. "--" .. instance.progname .. "--" .. instance.format
if instance.found[stamp] then
if trace_locating then
- logs.report("fileio",'! remembered: %s',filename)
+ logs.report("fileio","remembering file '%s'",filename)
end
return instance.found[stamp]
end
@@ -1475,7 +1598,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
if not dangerous[instance.format or "?"] then
if resolvers.isreadable.file(filename) then
if trace_detail then
- logs.report("fileio",'= found directly: %s',filename)
+ logs.report("fileio","file '%s' found directly",filename)
end
instance.found[stamp] = { filename }
return { filename }
@@ -1483,13 +1606,13 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
end
if find(filename,'%*') then
if trace_locating then
- logs.report("fileio",'! wildcard: %s', filename)
+ logs.report("fileio","checking wildcard '%s'", filename)
end
result = resolvers.find_wildcard_files(filename)
elseif file.is_qualified_path(filename) then
if resolvers.isreadable.file(filename) then
if trace_locating then
- logs.report("fileio",'! qualified: %s', filename)
+ logs.report("fileio","qualified name '%s'", filename)
end
result = { filename }
else
@@ -1499,7 +1622,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
forcedname = filename .. ".tex"
if resolvers.isreadable.file(forcedname) then
if trace_locating then
- logs.report("fileio",'! no suffix, forcing standard filetype: tex')
+ logs.report("fileio","no suffix, forcing standard filetype 'tex'")
end
result, ok = { forcedname }, true
end
@@ -1509,7 +1632,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
forcedname = filename .. "." .. s
if resolvers.isreadable.file(forcedname) then
if trace_locating then
- logs.report("fileio",'! no suffix, forcing format filetype: %s', s)
+ logs.report("fileio","no suffix, forcing format filetype '%s'", s)
end
result, ok = { forcedname }, true
break
@@ -1521,7 +1644,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
-- try to find in tree (no suffix manipulation), here we search for the
-- matching last part of the name
local basename = file.basename(filename)
- local pattern = (filename .. "$"):gsub("([%.%-])","%%%1")
+ local pattern = gsub(filename .. "$","([%.%-])","%%%1")
local savedformat = instance.format
local format = savedformat or ""
if format == "" then
@@ -1531,19 +1654,21 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
instance.format = "othertextfiles" -- kind of everything, maybe texinput is better
end
--
- local resolved = collect_instance_files(basename)
- if #result == 0 then
- local lowered = lower(basename)
- if filename ~= lowered then
- resolved = collect_instance_files(lowered)
+ if basename ~= filename then
+ local resolved = collect_instance_files(basename)
+ if #result == 0 then
+ local lowered = lower(basename)
+ if filename ~= lowered then
+ resolved = collect_instance_files(lowered)
+ end
end
- end
- resolvers.format = savedformat
- --
- for r=1,#resolved do
- local rr = resolved[r]
- if rr:find(pattern) then
- result[#result+1], ok = rr, true
+ resolvers.format = savedformat
+ --
+ for r=1,#resolved do
+ local rr = resolved[r]
+ if find(rr,pattern) then
+ result[#result+1], ok = rr, true
+ end
end
end
-- a real wildcard:
@@ -1552,14 +1677,14 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
-- local filelist = collect_files({basename})
-- for f=1,#filelist do
-- local ff = filelist[f][3] or ""
- -- if ff:find(pattern) then
+ -- if find(ff,pattern) then
-- result[#result+1], ok = ff, true
-- end
-- end
-- end
end
if not ok and trace_locating then
- logs.report("fileio",'? qualified: %s', filename)
+ logs.report("fileio","qualified name '%s'", filename)
end
end
else
@@ -1578,12 +1703,12 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
wantedfiles[#wantedfiles+1] = forcedname
filetype = resolvers.format_of_suffix(forcedname)
if trace_locating then
- logs.report("fileio",'! forcing filetype: %s',filetype)
+ logs.report("fileio","forcing filetype '%s'",filetype)
end
else
filetype = resolvers.format_of_suffix(filename)
if trace_locating then
- logs.report("fileio",'! using suffix based filetype: %s',filetype)
+ logs.report("fileio","using suffix based filetype '%s'",filetype)
end
end
else
@@ -1595,7 +1720,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
end
filetype = instance.format
if trace_locating then
- logs.report("fileio",'! using given filetype: %s',filetype)
+ logs.report("fileio","using given filetype '%s'",filetype)
end
end
local typespec = resolvers.variable_of_format(filetype)
@@ -1603,9 +1728,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
if not pathlist or #pathlist == 0 then
-- no pathlist, access check only / todo == wildcard
if trace_detail then
- logs.report("fileio",'? filename: %s',filename)
- logs.report("fileio",'? filetype: %s',filetype or '?')
- logs.report("fileio",'? wanted files: %s',concat(wantedfiles," | "))
+ logs.report("fileio","checking filename '%s', filetype '%s', wanted files '%s'",filename, filetype or '?',concat(wantedfiles," | "))
end
for k=1,#wantedfiles do
local fname = wantedfiles[k]
@@ -1626,36 +1749,59 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
else
-- list search
local filelist = collect_files(wantedfiles)
- local doscan, recurse
+ local dirlist = { }
+ if filelist then
+ for i=1,#filelist do
+ dirlist[i] = file.dirname(filelist[i][2]) .. "/"
+ end
+ end
if trace_detail then
- logs.report("fileio",'? filename: %s',filename)
+ logs.report("fileio","checking filename '%s'",filename)
end
-- a bit messy ... esp the doscan setting here
+ local doscan
for k=1,#pathlist do
local path = pathlist[k]
if find(path,"^!!") then doscan = false else doscan = true end
- if find(path,"//$") then recurse = true else recurse = false end
local pathname = gsub(path,"^!+", '')
done = false
-- using file list
- if filelist and not (done and not instance.allresults) and recurse then
- -- compare list entries with permitted pattern
- pathname = gsub(pathname,"([%-%.])","%%%1") -- this also influences
- pathname = gsub(pathname,"/+$", '/.*') -- later usage of pathname
- pathname = gsub(pathname,"//", '/.-/') -- not ok for /// but harmless
- local expr = "^" .. pathname
+ if filelist then
+ local expression
+ -- compare list entries with permitted pattern -- /xx /xx//
+ if not find(pathname,"/$") then
+ expression = pathname .. "/"
+ else
+ expression = pathname
+ end
+ expression = gsub(expression,"([%-%.])","%%%1") -- this also influences
+ expression = gsub(expression,"//+$", '/.*') -- later usage of pathname
+ expression = gsub(expression,"//", '/.-/') -- not ok for /// but harmless
+ expression = "^" .. expression .. "$"
+ if trace_detail then
+ logs.report("fileio","using pattern '%s' for path '%s'",expression,pathname)
+ end
for k=1,#filelist do
local fl = filelist[k]
local f = fl[2]
- if find(f,expr) then
- if trace_detail then
- logs.report("fileio",'= found in hash: %s',f)
- end
+ local d = dirlist[k]
+ if find(d,expression) then
--- todo, test for readable
result[#result+1] = fl[3]
resolvers.register_in_trees(f) -- for tracing used files
done = true
- if not instance.allresults then break end
+ if instance.allresults then
+ if trace_detail then
+ logs.report("fileio","match in hash for file '%s' on path '%s', continue scanning",f,d)
+ end
+ else
+ if trace_detail then
+ logs.report("fileio","match in hash for file '%s' on path '%s', quit scanning",f,d)
+ end
+ break
+ end
+ elseif trace_detail then
+ logs.report("fileio","no match in hash for file '%s' on path '%s'",f,d)
end
end
end
@@ -1671,7 +1817,7 @@ local function collect_instance_files(filename,collected) -- todo : plugin (scan
local fname = file.join(ppname,w)
if resolvers.isreadable.file(fname) then
if trace_detail then
- logs.report("fileio",'= found by scanning: %s',fname)
+ logs.report("fileio","found '%s' by scanning",fname)
end
result[#result+1] = fname
done = true
@@ -1734,7 +1880,7 @@ function resolvers.find_given_files(filename)
local hashes = instance.hashes
for k=1,#hashes do
local hash = hashes[k]
- local files = instance.files[hash.tag]
+ local files = instance.files[hash.tag] or { }
local blist = files[bname]
if not blist then
local rname = "remap:"..bname
@@ -1844,9 +1990,9 @@ function resolvers.load(option)
statistics.starttiming(instance)
resolvers.resetconfig()
resolvers.identify_cnf()
- resolvers.load_lua()
+ resolvers.load_lua() -- will become the new method
resolvers.expand_variables()
- resolvers.load_cnf()
+ resolvers.load_cnf() -- will be skipped when we have a lua file
resolvers.expand_variables()
if option ~= "nofiles" then
resolvers.load_hash()
@@ -1858,22 +2004,23 @@ end
function resolvers.for_files(command, files, filetype, mustexist)
if files and #files > 0 then
local function report(str)
- if trace_verbose then
+ if trace_locating then
logs.report("fileio",str) -- has already verbose
else
print(str)
end
end
- if trace_verbose then
- report('')
+ if trace_locating then
+ report('') -- ?
end
- for _, file in ipairs(files) do
+ for f=1,#files do
+ local file = files[f]
local result = command(file,filetype,mustexist)
if type(result) == 'string' then
report(result)
else
- for _,v in ipairs(result) do
- report(v)
+ for i=1,#result do
+ report(result[i]) -- could be unpack
end
end
end
@@ -1920,18 +2067,19 @@ end
function table.sequenced(t,sep) -- temp here
local s = { }
- for k, v in pairs(t) do -- pairs?
- s[#s+1] = k .. "=" .. v
+ for k, v in next, t do -- indexed?
+ s[#s+1] = k .. "=" .. tostring(v)
end
return concat(s, sep or " | ")
end
function resolvers.methodhandler(what, filename, filetype) -- ...
+ filename = file.collapse_path(filename)
local specification = (type(filename) == "string" and resolvers.splitmethod(filename)) or filename -- no or { }, let it bomb
local scheme = specification.scheme
if resolvers[what][scheme] then
if trace_locating then
- logs.report("fileio",'= handler: %s -> %s -> %s',specification.original,what,table.sequenced(specification))
+ logs.report("fileio","handler '%s' -> '%s' -> '%s'",specification.original,what,table.sequenced(specification))
end
return resolvers[what][scheme](filename,filetype) -- todo: specification
else
@@ -1951,8 +2099,9 @@ function resolvers.clean_path(str)
end
function resolvers.do_with_path(name,func)
- for _, v in pairs(resolvers.expanded_path_list(name)) do -- pairs?
- func("^"..resolvers.clean_path(v))
+ local pathlist = resolvers.expanded_path_list(name)
+ for i=1,#pathlist do
+ func("^"..resolvers.clean_path(pathlist[i]))
end
end
@@ -1961,7 +2110,9 @@ function resolvers.do_with_var(name,func)
end
function resolvers.with_files(pattern,handle)
- for _, hash in ipairs(instance.hashes) do
+ local hashes = instance.hashes
+ for i=1,#hashes do
+ local hash = hashes[i]
local blobpath = hash.tag
local blobtype = hash.type
if blobpath then
@@ -1976,7 +2127,7 @@ function resolvers.with_files(pattern,handle)
if type(v) == "string" then
handle(blobtype,blobpath,v,k)
else
- for _,vv in pairs(v) do -- ipairs?
+ for _,vv in next, v do -- indexed
handle(blobtype,blobpath,vv,k)
end
end
@@ -1988,7 +2139,7 @@ function resolvers.with_files(pattern,handle)
end
function resolvers.locate_format(name)
- local barename, fmtname = name:gsub("%.%a+$",""), ""
+ local barename, fmtname = gsub(name,"%.%a+$",""), ""
if resolvers.usecache then
local path = file.join(caches.setpath("formats")) -- maybe platform
fmtname = file.join(path,barename..".fmt") or ""
diff --git a/Master/texmf-dist/tex/context/base/data-sch.lua b/Master/texmf-dist/tex/context/base/data-sch.lua
new file mode 100644
index 00000000000..e68b6cd01b9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/data-sch.lua
@@ -0,0 +1,142 @@
+if not modules then modules = { } end modules ['data-sch'] = {
+ 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 http = require("socket.http")
+local ltn12 = require("ltn12")
+
+local gsub, concat, format = string.gsub, table.concat, string.format
+
+local trace_schemes = false trackers.register("resolvers.schemes",function(v) trace_schemes = v end)
+
+schemes = schemes or { }
+
+schemes.cached = { }
+schemes.cachepath = caches.definepath("schemes")
+schemes.threshold = 24 * 60 * 60
+
+directives.register("schemes.threshold", function(v) schemes.threshold = tonumber(v) or schemes.threshold end)
+
+local cached, loaded, reused = schemes.cached, { }, { }
+
+local finders, openers, loaders = resolvers.finders, resolvers.openers, resolvers.loaders
+
+function schemes.curl(name,cachename)
+ local command = "curl --silent --create-dirs --output " .. cachename .. " " .. name -- no protocol .. "://"
+ os.spawn(command)
+end
+
+function schemes.fetch(protocol,name,handler)
+ local cachename = schemes.cachepath() .. "/" .. gsub(name,"[^%a%d%.]+","-")
+ cachename = gsub(cachename,"[\\]", "/") -- cleanup
+ if not cached[name] then
+ statistics.starttiming(schemes)
+ if not io.exists(cachename) or (os.difftime(os.time(),lfs.attributes(cachename).modification) > schemes.threshold) then
+ cached[name] = cachename
+ if handler then
+ if trace_schemes then
+ logs.report("schemes","fetching '%s', protocol '%s', method 'built-in'",name,protocol)
+ end
+ io.flush()
+ handler(protocol,name,cachename)
+ else
+ if trace_schemes then
+ logs.report("schemes","fetching '%s', protocol '%s', method 'curl'",name,protocol)
+ end
+ io.flush()
+ schemes.curl(name,cachename)
+ end
+ end
+ if io.exists(cachename) then
+ cached[name] = cachename
+ if trace_schemes then
+ logs.report("schemes","using cached '%s', protocol '%s', cachename '%s'",name,protocol,cachename)
+ end
+ else
+ cached[name] = ""
+ if trace_schemes then
+ logs.report("schemes","using missing '%s', protocol '%s'",name,protocol)
+ end
+ end
+ loaded[protocol] = loaded[protocol] + 1
+ statistics.stoptiming(schemes)
+ else
+ if trace_schemes then
+ logs.report("schemes","reusing '%s', protocol '%s'",name,protocol)
+ end
+ reused[protocol] = reused[protocol] + 1
+ end
+ return cached[name]
+end
+
+function finders.schemes(protocol,filename,handler)
+ local foundname = schemes.fetch(protocol,filename,handler)
+ return finders.generic(protocol,foundname,filetype)
+end
+
+function openers.schemes(protocol,filename)
+ return openers.generic(protocol,filename)
+end
+
+function loaders.schemes(protocol,filename)
+ return loaders.generic(protocol,filename)
+end
+
+-- could be metatable
+
+function schemes.install(protocol,handler)
+ loaded [protocol] = 0
+ reused [protocol] = 0
+ finders[protocol] = function (filename,filetype) return finders.schemes(protocol,filename,handler) end
+ openers[protocol] = function (filename) return openers.schemes(protocol,filename) end
+ loaders[protocol] = function (filename) return loaders.schemes(protocol,filename) end
+end
+
+local function http_handler(protocol,name,cachename)
+ local tempname = cachename .. ".tmp"
+ local f = io.open(tempname,"wb")
+ local status, message = http.request {
+ url = name,
+ sink = ltn12.sink.file(f)
+ }
+ if not status then
+ os.remove(tempname)
+ else
+ os.remove(cachename)
+ os.rename(tempname,cachename)
+ end
+end
+
+schemes.install('http',http_handler)
+schemes.install('https')
+schemes.install('ftp')
+
+statistics.register("scheme handling time", function()
+ local l, r = { }, { }
+ for k, v in table.sortedhash(loaded) do
+ if v > 0 then
+ l[#l+1] = k .. ":" .. v
+ end
+ end
+ for k, v in table.sortedhash(reused) do
+ if v > 0 then
+ r[#r+1] = k .. ":" .. v
+ end
+ end
+ local n = #l + #r
+ if n > 0 then
+ l = (#l > 0 and concat(l)) or "none"
+ r = (#r > 0 and concat(r)) or "none"
+ return format("%s seconds, %s processed, threshold %s seconds, loaded: %s, reused: %s",
+ statistics.elapsedtime(schemes), n, schemes.threshold, l, r)
+ else
+ return nil
+ end
+end)
+
+--~ trace_schemes = true
+--~ print(schemes.fetch("http","http://www.pragma-ade.com/show-man.pdf",http_handler))
diff --git a/Master/texmf-dist/tex/context/base/data-tex.lua b/Master/texmf-dist/tex/context/base/data-tex.lua
index 16b6b125f4a..c9fa3625a66 100644
--- a/Master/texmf-dist/tex/context/base/data-tex.lua
+++ b/Master/texmf-dist/tex/context/base/data-tex.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-tex'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['data-tex'] = {
-- special functions that deal with io
local format, lower = string.format, string.lower
+local unpack = unpack or table.unpack
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
@@ -21,18 +22,19 @@ function finders.generic(tag,filename,filetype)
local foundname = resolvers.find_file(filename,filetype)
if foundname and foundname ~= "" then
if trace_locating then
- logs.report("fileio",'+ finder: %s, file: %s', tag,filename)
+ logs.report("fileio","%s finder: file '%s' found",tag,filename)
end
return foundname
else
if trace_locating then
- logs.report("fileio",'- finder: %s, file: %s', tag,filename)
+ logs.report("fileio","%s finder: unknown file '%s'",tag,filename)
end
return unpack(finders.notfound)
end
end
---~ local getlines = lpeg.Ct(lpeg.linebyline)
+--~ local lpegmatch = lpeg.match
+--~ local getlines = lpeg.Ct(lpeg.patterns.textline)
local input_translator, utf_translator, user_translator = nil, nil, nil
@@ -47,7 +49,7 @@ function openers.text_opener(filename,file_handle,tag)
local t = { }
if u > 0 then
if trace_locating then
- logs.report("fileio",'+ opener: %s (%s), file: %s',tag,unicode.utfname[u],filename)
+ logs.report("fileio","%s opener, file '%s' opened using method '%s'",tag,filename,unicode.utfname[u])
end
local l
if u > 2 then
@@ -64,7 +66,7 @@ function openers.text_opener(filename,file_handle,tag)
noflines = #l,
close = function()
if trace_locating then
- logs.report("fileio",'= closer: %s (%s), file: %s',tag,unicode.utfname[u],filename)
+ logs.report("fileio","%s closer, file '%s' closed",tag,filename)
end
logs.show_close(filename)
t = nil
@@ -99,10 +101,10 @@ function openers.text_opener(filename,file_handle,tag)
}
else
if trace_locating then
- logs.report("fileio",'+ opener: %s, file: %s',tag,filename)
+ logs.report("fileio","%s opener, file '%s' opened",tag,filename)
end
-- todo: file;name -> freeze / eerste regel scannen -> freeze
- --~ local data = getlines:match(file_handle:read("*a"))
+ --~ local data = lpegmatch(getlines,file_handle:read("*a"))
--~ local n = 0
t = {
reader = function() -- self
@@ -129,12 +131,12 @@ function openers.text_opener(filename,file_handle,tag)
end,
close = function()
if trace_locating then
- logs.report("fileio",'= closer: %s, file: %s',tag,filename)
+ logs.report("fileio","%s closer, file '%s' closed",tag,filename)
end
logs.show_close(filename)
file_handle:close()
t = nil
-collectgarbage("step")
+ collectgarbage("step") -- saves some memory
end,
handle = function()
return file_handle
@@ -152,12 +154,15 @@ function openers.generic(tag,filename)
if filename and filename ~= "" then
local f = io.open(filename,"r")
if f then
- logs.show_open(filename)
+ logs.show_open(filename) -- todo
+ if trace_locating then
+ logs.report("fileio","%s opener, file '%s' opened",tag,filename)
+ end
return openers.text_opener(filename,f,tag)
end
end
if trace_locating then
- logs.report("fileio",'- opener: %s, file: %s',tag,filename)
+ logs.report("fileio","%s opener, file '%s' not found",tag,filename)
end
return unpack(openers.notfound)
end
@@ -168,7 +173,7 @@ function loaders.generic(tag,filename)
if f then
logs.show_load(filename)
if trace_locating then
- logs.report("fileio",'+ loader: %s, file: %s',tag,filename)
+ logs.report("fileio","%s loader, file '%s' loaded",tag,filename)
end
local s = f:read("*a")
if garbagecollector and garbagecollector.check then garbagecollector.check(#s) end
@@ -179,7 +184,7 @@ function loaders.generic(tag,filename)
end
end
if trace_locating then
- logs.report("fileio",'- loader: %s, file: %s',tag,filename)
+ logs.report("fileio","%s loader, file '%s' not found",tag,filename)
end
return unpack(loaders.notfound)
end
@@ -197,11 +202,11 @@ function loaders.tex(filename)
end
function resolvers.findtexfile(filename, filetype)
- return resolvers.methodhandler('finders',file.collapse_path(filename), filetype)
+ return resolvers.methodhandler('finders',filename, filetype)
end
function resolvers.opentexfile(filename)
- return resolvers.methodhandler('openers',file.collapse_path(filename))
+ return resolvers.methodhandler('openers',filename)
end
function resolvers.openfile(filename)
diff --git a/Master/texmf-dist/tex/context/base/data-tmf.lua b/Master/texmf-dist/tex/context/base/data-tmf.lua
index 302841a65a6..7421eacfc6e 100644
--- a/Master/texmf-dist/tex/context/base/data-tmf.lua
+++ b/Master/texmf-dist/tex/context/base/data-tmf.lua
@@ -1,24 +1,27 @@
if not modules then modules = { } end modules ['data-tmf'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 find, gsub, match = string.find, string.gsub, string.match
+local getenv, setenv = os.getenv, os.setenv
+
-- loads *.tmf files in minimal tree roots (to be optimized and documented)
function resolvers.check_environment(tree)
logs.simpleline()
- os.setenv('TMP', os.getenv('TMP') or os.getenv('TEMP') or os.getenv('TMPDIR') or os.getenv('HOME'))
- os.setenv('TEXOS', os.getenv('TEXOS') or ("texmf-" .. os.currentplatform()))
- os.setenv('TEXPATH', (tree or "tex"):gsub("\/+$",''))
- os.setenv('TEXMFOS', os.getenv('TEXPATH') .. "/" .. os.getenv('TEXOS'))
+ setenv('TMP', getenv('TMP') or getenv('TEMP') or getenv('TMPDIR') or getenv('HOME'))
+ setenv('TEXOS', getenv('TEXOS') or ("texmf-" .. os.platform))
+ setenv('TEXPATH', gsub(tree or "tex","\/+$",''))
+ setenv('TEXMFOS', getenv('TEXPATH') .. "/" .. getenv('TEXOS'))
logs.simpleline()
- logs.simple("preset : TEXPATH => %s", os.getenv('TEXPATH'))
- logs.simple("preset : TEXOS => %s", os.getenv('TEXOS'))
- logs.simple("preset : TEXMFOS => %s", os.getenv('TEXMFOS'))
- logs.simple("preset : TMP => %s", os.getenv('TMP'))
+ logs.simple("preset : TEXPATH => %s", getenv('TEXPATH'))
+ logs.simple("preset : TEXOS => %s", getenv('TEXOS'))
+ logs.simple("preset : TEXMFOS => %s", getenv('TEXMFOS'))
+ logs.simple("preset : TMP => %s", getenv('TMP'))
logs.simple('')
end
@@ -26,27 +29,27 @@ function resolvers.load_environment(name) -- todo: key=value as well as lua
local f = io.open(name)
if f then
for line in f:lines() do
- if line:find("^[%%%#]") then
+ if find(line,"^[%%%#]") then
-- skip comment
else
- local key, how, value = line:match("^(.-)%s*([<=>%?]+)%s*(.*)%s*$")
+ local key, how, value = match(line,"^(.-)%s*([<=>%?]+)%s*(.*)%s*$")
if how then
- value = value:gsub("%%(.-)%%", function(v) return os.getenv(v) or "" end)
+ value = gsub(value,"%%(.-)%%", function(v) return getenv(v) or "" end)
if how == "=" or how == "<<" then
- os.setenv(key,value)
+ setenv(key,value)
elseif how == "?" or how == "??" then
- os.setenv(key,os.getenv(key) or value)
+ setenv(key,getenv(key) or value)
elseif how == "<" or how == "+=" then
- if os.getenv(key) then
- os.setenv(key,os.getenv(key) .. io.fileseparator .. value)
+ if getenv(key) then
+ setenv(key,getenv(key) .. io.fileseparator .. value)
else
- os.setenv(key,value)
+ setenv(key,value)
end
elseif how == ">" or how == "=+" then
- if os.getenv(key) then
- os.setenv(key,value .. io.pathseparator .. os.getenv(key))
+ if getenv(key) then
+ setenv(key,value .. io.pathseparator .. getenv(key))
else
- os.setenv(key,value)
+ setenv(key,value)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/data-tmp.lua b/Master/texmf-dist/tex/context/base/data-tmp.lua
index 72875dcb714..25f5b975c79 100644
--- a/Master/texmf-dist/tex/context/base/data-tmp.lua
+++ b/Master/texmf-dist/tex/context/base/data-tmp.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-tmp'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -24,7 +24,7 @@ luatools with a recache feature.</p>
local format, lower, gsub = string.format, string.lower, string.gsub
-local trace_cache = false trackers.register("resolvers.cache", function(v) trace_cache = v end)
+local trace_cache = false trackers.register("resolvers.cache", function(v) trace_cache = v end) -- not used yet
caches = caches or { }
@@ -111,7 +111,8 @@ function caches.setpath(...)
caches.path = '.'
end
caches.path = resolvers.clean_path(caches.path)
- if not table.is_empty({...}) then
+ local dirs = { ... }
+ if #dirs > 0 then
local pth = dir.mkdirs(caches.path,...)
return pth
end
@@ -157,6 +158,7 @@ function caches.savedata(filepath,filename,data,raw)
if raw then
reduce, simplify = false, false
end
+ data.cache_uuid = os.uuid()
if caches.direct then
file.savedata(tmaname, table.serialize(data,'return',false,true,false)) -- no hex
else
diff --git a/Master/texmf-dist/tex/context/base/data-tre.lua b/Master/texmf-dist/tex/context/base/data-tre.lua
index 9cac73b8ec7..d5ca258e47b 100644
--- a/Master/texmf-dist/tex/context/base/data-tre.lua
+++ b/Master/texmf-dist/tex/context/base/data-tre.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['data-tre'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -8,6 +8,9 @@ if not modules then modules = { } end modules ['data-tre'] = {
-- \input tree://oeps1/**/oeps.tex
+local find, gsub = string.find, string.gsub
+local unpack = unpack or table.unpack
+
local finders, openers, loaders = resolvers.finders, resolvers.openers, resolvers.loaders
local done, found = { }, { }
@@ -25,9 +28,10 @@ function finders.tree(specification,filetype)
hash = dir.glob(pattern)
done[path] = hash
end
- local pattern = "/" .. name:gsub("([%.%-%+])", "%%%1") .. "$"
- for k, v in pairs(hash) do
- if v:find(pattern) then
+ local pattern = "/" .. gsub(name,"([%.%-%+])", "%%%1") .. "$"
+ for k=1,#hash do
+ local v = hash[k]
+ if find(v,pattern) then
found[specification] = v
return v
end
diff --git a/Master/texmf-dist/tex/context/base/data-use.lua b/Master/texmf-dist/tex/context/base/data-use.lua
index 609ffd88f90..5ecd7805f41 100644
--- a/Master/texmf-dist/tex/context/base/data-use.lua
+++ b/Master/texmf-dist/tex/context/base/data-use.lua
@@ -1,15 +1,14 @@
if not modules then modules = { } end modules ['data-use'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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, lower, gsub = string.format, string.lower, string.gsub
+local format, lower, gsub, find = string.format, string.lower, string.gsub, string.find
-local trace_verbose = false trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
-local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v trackers.enable("resolvers.verbose") end)
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
-- since we want to use the cache instead of the tree, we will now
-- reimplement the saver.
@@ -53,19 +52,20 @@ resolvers.automounted = resolvers.automounted or { }
function resolvers.automount(usecache)
local mountpaths = resolvers.clean_path_list(resolvers.expansion('TEXMFMOUNT'))
- if table.is_empty(mountpaths) and usecache then
+ if (not mountpaths or #mountpaths == 0) and usecache then
mountpaths = { caches.setpath("mount") }
end
- if not table.is_empty(mountpaths) then
+ if mountpaths and #mountpaths > 0 then
statistics.starttiming(resolvers.instance)
- for k, root in pairs(mountpaths) do
+ for k=1,#mountpaths do
+ local root = mountpaths[k]
local f = io.open(root.."/url.tmi")
if f then
for line in f:lines() do
if line then
- if line:find("^[%%#%-]") then -- or %W
+ if find(line,"^[%%#%-]") then -- or %W
-- skip
- elseif line:find("^zip://") then
+ elseif find(line,"^zip://") then
if trace_locating then
logs.report("fileio","mounting %s",line)
end
@@ -110,11 +110,13 @@ function statistics.check_fmt_status(texname)
local luv = dofile(luvname)
if luv and luv.sourcefile then
local sourcehash = md5.hex(io.loaddata(resolvers.find_file(luv.sourcefile)) or "unknown")
- if luv.enginebanner and luv.enginebanner ~= enginebanner then
- return "engine mismatch"
+ local luvbanner = luv.enginebanner or "?"
+ if luvbanner ~= enginebanner then
+ return string.format("engine mismatch (luv:%s <> bin:%s)",luvbanner,enginebanner)
end
- if luv.sourcehash and luv.sourcehash ~= sourcehash then
- return "source mismatch"
+ local luvhash = luv.sourcehash or "?"
+ if luvhash ~= sourcehash then
+ return string.format("source mismatch (luv:%s <> bin:%s)",luvhash,sourcehash)
end
else
return "invalid status file"
diff --git a/Master/texmf-dist/tex/context/base/data-zip.lua b/Master/texmf-dist/tex/context/base/data-zip.lua
index dcb6b170a33..aa3740a83d1 100644
--- a/Master/texmf-dist/tex/context/base/data-zip.lua
+++ b/Master/texmf-dist/tex/context/base/data-zip.lua
@@ -1,17 +1,21 @@
if not modules then modules = { } end modules ['data-zip'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 = string.format, string.find
+local format, find, match = string.format, string.find, string.match
+local unpack = unpack or table.unpack
-local trace_locating, trace_verbose = false, false
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
-trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
-trackers.register("resolvers.locating", function(v) trace_locating = v trace_verbose = v end)
+-- zip:///oeps.zip?name=bla/bla.tex
+-- zip:///oeps.zip?tree=tex/texmf-local
+-- zip:///texmf.zip?tree=/tex/texmf
+-- zip:///texmf.zip?tree=/tex/texmf-local
+-- zip:///texmf-mine.zip?tree=/tex/texmf-projects
zip = zip or { }
zip.archives = zip.archives or { }
@@ -22,9 +26,6 @@ local locators, hashers, concatinators = resolvers.locators, resolvers.hashers,
local archives = zip.archives
--- zip:///oeps.zip?name=bla/bla.tex
--- zip:///oeps.zip?tree=tex/texmf-local
-
local function validzip(str) -- todo: use url splitter
if not find(str,"^zip://") then
return "zip:///" .. str
@@ -54,26 +55,22 @@ function zip.closearchive(name)
end
end
--- zip:///texmf.zip?tree=/tex/texmf
--- zip:///texmf.zip?tree=/tex/texmf-local
--- zip:///texmf-mine.zip?tree=/tex/texmf-projects
-
function locators.zip(specification) -- where is this used? startup zips (untested)
specification = resolvers.splitmethod(specification)
local zipfile = specification.path
local zfile = zip.openarchive(name) -- tricky, could be in to be initialized tree
if trace_locating then
if zfile then
- logs.report("fileio",'! zip locator, found: %s',specification.original)
+ logs.report("fileio","zip locator, archive '%s' found",specification.original)
else
- logs.report("fileio",'? zip locator, not found: %s',specification.original)
+ logs.report("fileio","zip locator, archive '%s' not found",specification.original)
end
end
end
function hashers.zip(tag,name)
- if trace_verbose then
- logs.report("fileio","loading zip file %s as %s",name,tag)
+ if trace_locating then
+ logs.report("fileio","loading zip file '%s' as '%s'",name,tag)
end
resolvers.usezipfile(format("%s?tree=%s",tag,name))
end
@@ -98,23 +95,25 @@ function finders.zip(specification,filetype)
local zfile = zip.openarchive(specification.path)
if zfile then
if trace_locating then
- logs.report("fileio",'! zip finder, path: %s',specification.path)
+ logs.report("fileio","zip finder, archive '%s' found",specification.path)
end
local dfile = zfile:open(q.name)
if dfile then
dfile = zfile:close()
if trace_locating then
- logs.report("fileio",'+ zip finder, name: %s',q.name)
+ logs.report("fileio","zip finder, file '%s' found",q.name)
end
return specification.original
+ elseif trace_locating then
+ logs.report("fileio","zip finder, file '%s' not found",q.name)
end
elseif trace_locating then
- logs.report("fileio",'? zip finder, path %s',specification.path)
+ logs.report("fileio","zip finder, unknown archive '%s'",specification.path)
end
end
end
if trace_locating then
- logs.report("fileio",'- zip finder, name: %s',filename)
+ logs.report("fileio","zip finder, '%s' not found",filename)
end
return unpack(finders.notfound)
end
@@ -127,20 +126,25 @@ function openers.zip(specification)
local zfile = zip.openarchive(zipspecification.path)
if zfile then
if trace_locating then
- logs.report("fileio",'+ zip starter, path: %s',zipspecification.path)
+ logs.report("fileio","zip opener, archive '%s' opened",zipspecification.path)
end
local dfile = zfile:open(q.name)
if dfile then
logs.show_open(specification)
+ if trace_locating then
+ logs.report("fileio","zip opener, file '%s' found",q.name)
+ end
return openers.text_opener(specification,dfile,'zip')
+ elseif trace_locating then
+ logs.report("fileio","zip opener, file '%s' not found",q.name)
end
elseif trace_locating then
- logs.report("fileio",'- zip starter, path %s',zipspecification.path)
+ logs.report("fileio","zip opener, unknown archive '%s'",zipspecification.path)
end
end
end
if trace_locating then
- logs.report("fileio",'- zip opener, name: %s',filename)
+ logs.report("fileio","zip opener, '%s' not found",filename)
end
return unpack(openers.notfound)
end
@@ -153,25 +157,27 @@ function loaders.zip(specification)
local zfile = zip.openarchive(specification.path)
if zfile then
if trace_locating then
- logs.report("fileio",'+ zip starter, path: %s',specification.path)
+ logs.report("fileio","zip loader, archive '%s' opened",specification.path)
end
local dfile = zfile:open(q.name)
if dfile then
logs.show_load(filename)
if trace_locating then
- logs.report("fileio",'+ zip loader, name: %s',filename)
+ logs.report("fileio","zip loader, file '%s' loaded",filename)
end
local s = dfile:read("*all")
dfile:close()
return true, s, #s
+ elseif trace_locating then
+ logs.report("fileio","zip loader, file '%s' not found",q.name)
end
elseif trace_locating then
- logs.report("fileio",'- zip starter, path: %s',specification.path)
+ logs.report("fileio","zip loader, unknown archive '%s'",specification.path)
end
end
end
if trace_locating then
- logs.report("fileio",'- zip loader, name: %s',filename)
+ logs.report("fileio","zip loader, '%s' not found",filename)
end
return unpack(openers.notfound)
end
@@ -181,21 +187,15 @@ end
function resolvers.usezipfile(zipname)
zipname = validzip(zipname)
- if trace_locating then
- logs.report("fileio",'! zip use, file: %s',zipname)
- end
local specification = resolvers.splitmethod(zipname)
local zipfile = specification.path
if zipfile and not zip.registeredfiles[zipname] then
local tree = url.query(specification.query).tree or ""
- if trace_locating then
- logs.report("fileio",'! zip register, file: %s',zipname)
- end
local z = zip.openarchive(zipfile)
if z then
local instance = resolvers.instance
if trace_locating then
- logs.report("fileio","= zipfile, registering: %s",zipname)
+ logs.report("fileio","zip registering, registering archive '%s'",zipname)
end
statistics.starttiming(instance)
resolvers.prepend_hash('zip',zipname,zipfile)
@@ -204,10 +204,10 @@ function resolvers.usezipfile(zipname)
instance.files[zipname] = resolvers.register_zip_file(z,tree or "")
statistics.stoptiming(instance)
elseif trace_locating then
- logs.report("fileio","? zipfile, unknown: %s",zipname)
+ logs.report("fileio","zip registering, unknown archive '%s'",zipname)
end
elseif trace_locating then
- logs.report("fileio",'! zip register, no file: %s',zipname)
+ logs.report("fileio","zip registering, '%s' not found",zipname)
end
end
@@ -219,11 +219,11 @@ function resolvers.register_zip_file(z,tree)
filter = format("^%s/(.+)/(.-)$",tree)
end
if trace_locating then
- logs.report("fileio",'= zip filter: %s',filter)
+ logs.report("fileio","zip registering, using filter '%s'",filter)
end
local register, n = resolvers.register_file, 0
for i in z:files() do
- local path, name = i.filename:match(filter)
+ local path, name = match(i.filename,filter)
if path then
if name and name ~= '' then
register(files, name, path)
@@ -236,6 +236,6 @@ function resolvers.register_zip_file(z,tree)
n = n + 1
end
end
- logs.report("fileio",'= zip entries: %s',n)
+ logs.report("fileio","zip registering, %s files registered",n)
return files
end
diff --git a/Master/texmf-dist/tex/context/base/enco-def.mkii b/Master/texmf-dist/tex/context/base/enco-def.mkii
index b6d66bb6c2c..4d8e280cb70 100644
--- a/Master/texmf-dist/tex/context/base/enco-def.mkii
+++ b/Master/texmf-dist/tex/context/base/enco-def.mkii
@@ -41,6 +41,8 @@
\definecharacter textring 23
\definecharacter texttilde 126
+\definecharacter textat 64 % for mojca
+
\definecharacter textbottomcomma {\hbox{\lower.35ex\hbox{\tx,}}} % for mojca
\definecharacter dotlessi {\char"10 }
diff --git a/Master/texmf-dist/tex/context/base/enco-ffr.mkii b/Master/texmf-dist/tex/context/base/enco-ffr.mkii
index c321153e8f0..093cc6500b8 100644
--- a/Master/texmf-dist/tex/context/base/enco-ffr.mkii
+++ b/Master/texmf-dist/tex/context/base/enco-ffr.mkii
@@ -41,6 +41,10 @@
\defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}}
\stoplanguagespecifics
+\appendtoks % maybe everywhere
+ \chardef\activecharactermode\zerocount
+\to\everyMPgraphic
+
% maybe tricky due to possible name clashes:
%
% \def\ieme {\highordinalstr{e}}
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.mkii b/Master/texmf-dist/tex/context/base/enco-ini.mkii
index 1ac491e62fe..33825f94d43 100644
--- a/Master/texmf-dist/tex/context/base/enco-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/enco-ini.mkii
@@ -1129,7 +1129,7 @@
\ifnum\texengine=\xetexengine
\setupencoding[\s!default=\s!default]
\else
- \useencoding[ans,il2,ec,tbo,pdf,pol,qx,t5,cyr,agr] % pol and il2 will go away, not needed in mkiv, uc removed
+ \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
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.mkiv b/Master/texmf-dist/tex/context/base/enco-ini.mkiv
index 112c5596a8a..da1892faf2a 100644
--- a/Master/texmf-dist/tex/context/base/enco-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/enco-ini.mkiv
@@ -40,9 +40,9 @@
%D around, just in case they are used in styles (and in for instance
%D symb and xtag files).
-\def\startencoding [#1]{} % used in symb
+\unexpanded\def\startencoding [#1]{} % used in symb
\let\stopencoding \relax
-\def\setupencoding [#1]{}
+\unexpanded\def\setupencoding [#1]{}
\def\enablemapping [#1]{}
\def\enableencoding[#1]{}
@@ -61,20 +61,20 @@
%D \macros
%D {defineaccent, definecharacter, definecommand}
-\def\defineaccent#1 #2 #3 %
+\unexpanded\def\defineaccent#1 #2 #3 %
{\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}%
\setvalue{\??ac\string#1\string#2}{#3}}
\def\dohandleaccent#1#2%
- {\csname\??ac\string#1\string#2\endcsname}
+ {\csname\??ac\string#1\string#2\empty\endcsname}
-\def\definecharacter#1 #2 %
+\unexpanded\def\definecharacter#1 #2 %
{\doifnumberelse{\string#2}
{\setevalue{\string#1}{\utfchar{#2}}} % or {\expandafter\chardef\csname#1\endcsname#2\relax}
- {\unexpanded\setvalue {\string#1}{#2}}}
+ {\setuvalue {\string#1}{#2}}}
-\def\definecommand#1 #2 %
- {\unexpanded\setvalue{\string#1}{#2}}
+\unexpanded\def\definecommand#1 #2 %
+ {\setuvalue{\string#1}{#2}}
%D \macros
%D {everyuppercase, EveryUppercase,
@@ -123,11 +123,13 @@
\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}}
-\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}}
+\unexpanded\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
+\unexpanded\def\buildtextbottomdot {\bottomaccent{.25ex}{0}{5}{\textbottomdot}}
+\unexpanded\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}}
+\unexpanded\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
+\unexpanded\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}}
+
+\let\d\buildtextbottomdot
\unexpanded\def\topaccent#1#2#3#4#5% down right slantcorrection accent char
{\dontleavehmode
@@ -143,7 +145,7 @@
\def\buildtextgrave{\topaccent{0pt}{0}{15}{\textgrave}} % e.g.
-\def\definemathaccent#1 #2%
+\unexpanded\def\definemathaccent#1 #2%
{\setvalue{#1}{\mathaccent#2 }}
%D Math (will move):
@@ -322,37 +324,65 @@
\unexpanded\def\schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}}
\unexpanded\def\schwagrave {\buildtextgrave\schwa}
-\unexpanded\def\normalcontrolspace{\getglyph{ComputerModernMono}{\char32}}
-\unexpanded\def\textvisiblespace {\fakecontrolspace}
-\unexpanded\def\fakecontrolspace {\let\normalcontrolspace\fakedcontrolspace}
-
-% helpers
-
-\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}
-
-\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\!!height -2\scratchdimen\!!depth3\scratchdimen
- \vrule \!!width\scratchdimen \!!height5.5\scratchdimen\!!depth3\scratchdimen
- \kern\scratchdimen}}
+\chardef\textcontrolspace"2423
+
+\unexpanded\def\fallbackcontrolspace
+ %{\getglyph{ComputerModernMono}\textcontrolspace}
+ {\getglyph{LMTypewriter10-Regular}\textcontrolspace}
+
+\unexpanded\def\normalcontrolspace
+ {\iffontchar\font\textcontrolspace
+ \textcontrolspace
+ \else
+ \fallbackcontrolspace
+ \fi}
+
+\let\textvisiblespace\normalcontrolspace
+
+\unexpanded\def\fastcontrolspace % no glyph resolving after first (use grouped)
+ {\dofastcontrolspace}
+
+\def\dofastcontrolspace
+ {\iffontchar\font\textcontrolspace
+ \nofastfallbackcontrolspace
+ \else
+ \dofastfallbackcontrolspace
+ \fi
+ \dofastcontrolspace}
+
+\newbox\controlspacebox
+
+\def\nofastfallbackcontrolspace
+ {\let\dofastcontrolspace\textcontrolspace}
+
+\def\dofastfallbackcontrolspace
+ {\setbox\controlspacebox\hbox{\space}%
+ \setbox\controlspacebox\hbox to \wd\controlspacebox{\hss\fallbackcontrolspace\hss}%
+ \let\dofastcontrolspace\flushcontrolspacebox}
+
+\def\flushcontrolspacebox
+ {\copy\controlspacebox}
+
+% a few defaults (\<whatever>{}), we really need the verbose \empty as it will be
+% stringified
+
+\defineaccent ^ {\empty} {\textcircumflex}
+\defineaccent ` {\empty} {\textgrave}
+\defineaccent ~ {\empty} {\texttilde}
+\defineaccent " {\empty} {\textdiaeresis}
+\defineaccent ' {\empty} {\textacute}
+\defineaccent . {\empty} {\textdotaccent}
+\defineaccent = {\empty} {\textmacron}
+\defineaccent c {\empty} {\textcedilla}
+\defineaccent H {\empty} {\texthungarumlaut}
+\defineaccent k {\empty} {\textogonek}
+\defineaccent r {\empty} {\textring}
+\defineaccent u {\empty} {\textbreve}
+\defineaccent v {\empty} {\textcaron}
% from enco-acc:
+%
+% we should to this at the lua end and share code ..
\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex}
\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex}
@@ -469,15 +499,27 @@
%D A smaller and bolder variant, more like the math and monospaced ones.
+% \def\fakeunderscore
+% {\dontleavehmode\hbox % was \leavevmode
+% {\setbox\scratchbox\hbox{(}%
+% \scratchdimen.2\dp\scratchbox
+% \setbox\scratchbox\hbox{\space}%
+% \vrule
+% \!!depth \scratchdimen
+% \!!width \wd\scratchbox
+% \!!height\zeropoint}}
+
+% \startTEXpage
+% \ruledhbox{\strut$1\fakeunderscore^{1\fakeunderscore}$}
+% \ruledhbox{\strut$1\xfakeunderscore^{1\xfakeunderscore}$}
+% \stopTEXpage
+
\def\fakeunderscore
- {\leavevmode\hbox
- {\setbox\scratchbox\hbox{(}%
- \scratchdimen.2\dp\scratchbox
- \setbox\scratchbox\hbox{\space}%
- \vrule
- \!!depth \scratchdimen
- \!!width \wd\scratchbox
- \!!height\zeropoint}}
+ {\relax\ifmmode
+ \vrule\!!depth .12\fontexheight\mathstylefont\normalmathstyle\!!width \fontinterwordspace\mathstylefont\normalmathstyle\!!height\zeropoint\relax
+ \else
+ \dontleavehmode\hbox{\vrule\!!depth .12\fontexheight\font\!!width \fontinterwordspace\font\!!height\zeropoint}%
+ \fi}
\def\fakeunderscores{\let\_\fakeunderscore}
\def\textunderscores{\let\_\textunderscore}
diff --git a/Master/texmf-dist/tex/context/base/enco-l7x.mkii b/Master/texmf-dist/tex/context/base/enco-l7x.mkii
new file mode 100644
index 00000000000..8f355317b56
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/enco-l7x.mkii
@@ -0,0 +1,236 @@
+%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]
+%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/font-afm.lua b/Master/texmf-dist/tex/context/base/font-afm.lua
index 81b47a2698c..87dec59c6e6 100644
--- a/Master/texmf-dist/tex/context/base/font-afm.lua
+++ b/Master/texmf-dist/tex/context/base/font-afm.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-afm'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -21,7 +21,9 @@ local trace_features = false trackers.register("afm.features", function(v) trac
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 format, match, gmatch, lower = string.format, string.match, string.gmatch, string.lower
+local format, match, gmatch, lower, gsub = string.format, string.match, string.gmatch, string.lower, string.gsub
+local lpegmatch = lpeg.match
+local abs = math.abs
fonts = fonts or { }
fonts.afm = fonts.afm or { }
@@ -29,7 +31,7 @@ fonts.afm = fonts.afm or { }
local afm = fonts.afm
local tfm = fonts.tfm
-afm.version = 1.400 -- incrementing this number one up will force a re-cache
+afm.version = 1.402 -- incrementing this number one up will force a re-cache
afm.syncspace = true -- when true, nicer stretch values
afm.enhance_data = true -- best leave this set to true
afm.features = { }
@@ -88,7 +90,7 @@ local pattern = ( c * s^1 * (
local function scan_comment(str)
fd = { }
- pattern:match(str)
+ lpegmatch(pattern,str)
return fd
end
@@ -219,21 +221,21 @@ function afm.read_afm(filename)
filename = file.removesuffix(file.basename(filename))
}
}
- afmblob = afmblob:gsub("StartCharMetrics(.-)EndCharMetrics", function(charmetrics)
+ afmblob = gsub(afmblob,"StartCharMetrics(.-)EndCharMetrics", function(charmetrics)
if trace_loading then
logs.report("load afm","loading char metrics")
end
get_charmetrics(data,charmetrics,vector)
return ""
end)
- afmblob = afmblob:gsub("StartKernPairs(.-)EndKernPairs", function(kernpairs)
+ afmblob = gsub(afmblob,"StartKernPairs(.-)EndKernPairs", function(kernpairs)
if trace_loading then
logs.report("load afm","loading kern pairs")
end
get_kernpairs(data,kernpairs)
return ""
end)
- afmblob = afmblob:gsub("StartFontMetrics%s+([%d%.]+)(.-)EndFontMetrics", function(version,fontmetrics)
+ afmblob = gsub(afmblob,"StartFontMetrics%s+([%d%.]+)(.-)EndFontMetrics", function(version,fontmetrics)
if trace_loading then
logs.report("load afm","loading variables")
end
@@ -281,6 +283,8 @@ function afm.load(filename)
logs.report("load afm", "add extra kerns")
afm.add_kerns(data) -- faster this way
end
+ logs.report("load afm", "add tounicode data")
+ fonts.map.add_to_unicode(data,filename)
data.size = size
data.verbose = fonts.verbose
logs.report("load afm","saving: %s in cache",name)
@@ -453,6 +457,9 @@ function afm.add_dimensions(data) -- we need to normalize afm to otf i.e. indexe
end
end
+fonts.formats.afm = "type1"
+fonts.formats.pfb = "type1"
+
function afm.copy_to_tfm(data)
if data then
local glyphs = data.glyphs
@@ -460,74 +467,48 @@ function afm.copy_to_tfm(data)
local metadata, luatex = data.metadata, data.luatex
local unicodes, indices = luatex.unicodes, luatex.indices
local characters, parameters, descriptions = { }, { }, { }
- local tfm = {
- characters = characters,
- parameters = parameters,
- descriptions = descriptions,
- indices = indices,
- unicodes = unicodes,
- luatex = luatex,
- }
+ -- todo : merge into tfm
for u, i in next, indices do
local d = glyphs[i]
characters[u] = { }
descriptions[u] = d
end
- tfm.encodingbytes = metadata.encodingbytes or 2
- tfm.fullname = metadata.fullname
- tfm.filename = metadata.filename
- tfm.name = tfm.fullname
- tfm.psname = tfm.fullname
- tfm.type = "real"
- tfm.units = 1000
- tfm.stretch = stretch -- nil
- tfm.slant = slant -- nil
- tfm.direction = 0
- tfm.boundarychar_label = 0
- tfm.boundarychar = 65536
- --~ tfm.false_boundarychar = 65536 -- produces invalid tfm in luatex
- tfm.designsize = (metadata.designsize or 10)*65536
- local spaceunits = 500
- tfm.spacer = "500 units"
+ local filename = fonts.tfm.checked_filename(luatex) -- was metadata.filename
+ local fontname = metadata.fontname or metadata.fullname
+ local fullname = metadata.fullname or metadata.fontname
+ local endash, emdash, space, spaceunits = unicodes['space'], unicodes['emdash'], "space", 500
-- same as otf
- local endash, emdash = unicodes['space'], unicodes['emdash']
if metadata.isfixedpitch then
if descriptions[endash] then
- spaceunits, tfm.spacer = descriptions[endash].width, "space"
+ spaceunits, spacer = descriptions[endash].width, "space"
end
if not spaceunits and descriptions[emdash] then
- spaceunits, tfm.spacer = descriptions[emdash].width, "emdash"
+ spaceunits, spacer = descriptions[emdash].width, "emdash"
end
if not spaceunits and metadata.charwidth then
- spaceunits, tfm.spacer = metadata.charwidth, "charwidth"
+ spaceunits, spacer = metadata.charwidth, "charwidth"
end
else
if descriptions[endash] then
- spaceunits, tfm.spacer = descriptions[endash].width, "space"
+ spaceunits, spacer = descriptions[endash].width, "space"
end
- -- if not spaceunits and descriptions[emdash] then
- -- spaceunits, tfm.spacer = descriptions[emdash].width/2, "emdash/2"
- -- end
if not spaceunits and metadata.charwidth then
- spaceunits, tfm.spacer = metadata.charwidth, "charwidth"
+ spaceunits, spacer = metadata.charwidth, "charwidth"
end
end
- --
spaceunits = tonumber(spaceunits)
+ if spaceunits < 200 then
+ -- todo: warning
+ end
+ --
parameters.slant = 0
parameters.space = spaceunits
parameters.space_stretch = 500
parameters.space_shrink = 333
parameters.x_height = 400
parameters.quad = 1000
- if spaceunits < 200 then
- -- todo: warning
- end
- tfm.ascender = math.abs(metadata.ascender or 0)
- tfm.descender = math.abs(metadata.descender or 0)
local italicangle = data.metadata.italicangle
if italicangle then
- tfm.italicangle = italicangle
parameters.slant = parameters.slant - math.round(math.tan(italicangle*math.pi/180))
end
if metadata.isfixedpitch then
@@ -557,8 +538,34 @@ function afm.copy_to_tfm(data)
parameters[k] = v
end
end
+ --
if next(characters) then
- return tfm
+ return {
+ characters = characters,
+ parameters = parameters,
+ descriptions = descriptions,
+ indices = indices,
+ unicodes = unicodes,
+ luatex = luatex,
+ encodingbytes = 2,
+ filename = filename,
+ fontname = fontname,
+ fullname = fullname,
+ psname = fullname, -- in otf: tfm.fontname or tfm.fullname
+ name = filename or fullname or fontname,
+ format = fonts.fontformat(filename,"type1"),
+ type = 'real',
+ units = 1000,
+ direction = 0,
+ boundarychar_label = 0,
+ boundarychar = 65536,
+ --~ false_boundarychar = 65536, -- produces invalid tfm in luatex
+ designsize = (metadata.designsize or 10)*65536,
+ spacer = spacer,
+ ascender = abs(metadata.ascender or 0),
+ descender = abs(metadata.descender or 0),
+ italicangle = italicangle,
+ }
end
end
end
@@ -581,7 +588,7 @@ function afm.set_features(tfmdata)
local shared = tfmdata.shared
local afmdata = shared.afmdata
local features = shared.features
- if not table.is_empty(features) then
+ if features and next(features) then
local mode = tfmdata.mode or fonts.mode
local initializers = fonts.initializers
local fi = initializers[mode]
@@ -670,10 +677,10 @@ function afm.afm_to_tfm(specification)
local tfmdata = containers.read(tfm.cache(), cache_id) -- cache with features applied
if not tfmdata then
local afmdata = afm.load(afmname)
- if not table.is_empty(afmdata) then
+ if afmdata and next(afmdata) then
afm.add_dimensions(afmdata)
tfmdata = afm.copy_to_tfm(afmdata)
- if not table.is_empty(tfmdata) then
+ if tfmdata and next(tfmdata) then
tfmdata.shared = tfmdata.shared or { }
tfmdata.unique = tfmdata.unique or { }
tfmdata.shared.afmdata = afmdata
@@ -711,21 +718,19 @@ function tfm.read_from_afm(specification)
local tfmtable = afm.afm_to_tfm(specification)
if tfmtable then
tfmtable.name = specification.name
- tfmtable = tfm.scale(tfmtable, specification.size)
+ tfmtable = tfm.scale(tfmtable, specification.size, specification.relativeid)
local afmdata = tfmtable.shared.afmdata
- local filename = afmdata and afmdata.luatex and afmdata.luatex.filename
- if not filename then
- -- try to locate anyway and set afmdata.luatex.filename
- end
- if filename then
- tfmtable.encodingbytes = 2
- tfmtable.filename = resolvers.findbinfile(filename,"") or filename
- tfmtable.fullname = afmdata.metadata.fontname or afmdata.metadata.fullname
- tfmtable.format = 'type1'
- tfmtable.name = afmdata.luatex.filename or tfmtable.fullname
- end
+--~ local filename = afmdata and afmdata.luatex and afmdata.luatex.filename
+--~ if filename then
+--~ tfmtable.encodingbytes = 2
+--~ tfmtable.filename = resolvers.findbinfile(filename,"") or filename
+--~ tfmtable.fontname = afmdata.metadata.fontname or afmdata.metadata.fullname
+--~ tfmtable.fullname = afmdata.metadata.fullname or afmdata.metadata.fontname
+--~ tfmtable.format = 'type1'
+--~ tfmtable.name = afmdata.luatex.filename or tfmtable.fullname
+--~ end
if fonts.dontembed[filename] then
- tfmtable.file = nil
+ tfmtable.file = nil -- or filename ?
end
fonts.logger.save(tfmtable,'afm',specification)
end
diff --git a/Master/texmf-dist/tex/context/base/font-agl.lua b/Master/texmf-dist/tex/context/base/font-agl.lua
new file mode 100644
index 00000000000..8a087b12381
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/font-agl.lua
@@ -0,0 +1,3695 @@
+if not modules then modules = { } end modules ['font-map'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "derived from http://www.adobe.com/devnet/opentype/archives/glyphlist.txt",
+ comment = "Adobe Glyph List, version 2.0, September 20, 2002",
+}
+
+fonts = fonts or { }
+fonts.map = fonts.map or { }
+
+fonts.map.unicode_to_agl = {
+ "controlSTX",
+ "controlSOT",
+ "controlETX",
+ "controlEOT",
+ "controlENQ",
+ "controlACK",
+ "controlBEL",
+ "controlBS",
+ "controlHT",
+ "controlLF",
+ "controlVT",
+ "controlFF",
+ "controlCR",
+ "controlSO",
+ "controlSI",
+ "controlDLE",
+ "controlDC1",
+ "controlDC2",
+ "controlDC3",
+ "controlDC4",
+ "controlNAK",
+ "controlSYN",
+ "controlETB",
+ "controlCAN",
+ "controlEM",
+ "controlSUB",
+ "controlESC",
+ "controlFS",
+ "controlGS",
+ "controlRS",
+ "controlUS",
+ "spacehackarabic",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "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",
+ "grave",
+ "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",
+ "verticalbar",
+ "braceright",
+ "asciitilde",
+ "controlDEL",
+ [0x00A0] = "nonbreakingspace",
+ [0x00A1] = "exclamdown",
+ [0x00A2] = "cent",
+ [0x00A3] = "sterling",
+ [0x00A4] = "currency",
+ [0x00A5] = "yen",
+ [0x00A6] = "brokenbar",
+ [0x00A7] = "section",
+ [0x00A8] = "dieresis",
+ [0x00A9] = "copyright",
+ [0x00AA] = "ordfeminine",
+ [0x00AB] = "guillemotleft",
+ [0x00AC] = "logicalnot",
+ [0x00AD] = "softhyphen",
+ [0x00AE] = "registered",
+ [0x00AF] = "overscore",
+ [0x00B0] = "degree",
+ [0x00B1] = "plusminus",
+ [0x00B2] = "twosuperior",
+ [0x00B3] = "threesuperior",
+ [0x00B4] = "acute",
+ [0x00B5] = "mu1",
+ [0x00B6] = "paragraph",
+ [0x00B7] = "periodcentered",
+ [0x00B8] = "cedilla",
+ [0x00B9] = "onesuperior",
+ [0x00BA] = "ordmasculine",
+ [0x00BB] = "guillemotright",
+ [0x00BC] = "onequarter",
+ [0x00BD] = "onehalf",
+ [0x00BE] = "threequarters",
+ [0x00BF] = "questiondown",
+ [0x00C0] = "Agrave",
+ [0x00C1] = "Aacute",
+ [0x00C2] = "Acircumflex",
+ [0x00C3] = "Atilde",
+ [0x00C4] = "Adieresis",
+ [0x00C5] = "Aring",
+ [0x00C6] = "AE",
+ [0x00C7] = "Ccedilla",
+ [0x00C8] = "Egrave",
+ [0x00C9] = "Eacute",
+ [0x00CA] = "Ecircumflex",
+ [0x00CB] = "Edieresis",
+ [0x00CC] = "Igrave",
+ [0x00CD] = "Iacute",
+ [0x00CE] = "Icircumflex",
+ [0x00CF] = "Idieresis",
+ [0x00D0] = "Eth",
+ [0x00D1] = "Ntilde",
+ [0x00D2] = "Ograve",
+ [0x00D3] = "Oacute",
+ [0x00D4] = "Ocircumflex",
+ [0x00D5] = "Otilde",
+ [0x00D6] = "Odieresis",
+ [0x00D7] = "multiply",
+ [0x00D8] = "Oslash",
+ [0x00D9] = "Ugrave",
+ [0x00DA] = "Uacute",
+ [0x00DB] = "Ucircumflex",
+ [0x00DC] = "Udieresis",
+ [0x00DD] = "Yacute",
+ [0x00DE] = "Thorn",
+ [0x00DF] = "germandbls",
+ [0x00E0] = "agrave",
+ [0x00E1] = "aacute",
+ [0x00E2] = "acircumflex",
+ [0x00E3] = "atilde",
+ [0x00E4] = "adieresis",
+ [0x00E5] = "aring",
+ [0x00E6] = "ae",
+ [0x00E7] = "ccedilla",
+ [0x00E8] = "egrave",
+ [0x00E9] = "eacute",
+ [0x00EA] = "ecircumflex",
+ [0x00EB] = "edieresis",
+ [0x00EC] = "igrave",
+ [0x00ED] = "iacute",
+ [0x00EE] = "icircumflex",
+ [0x00EF] = "idieresis",
+ [0x00F0] = "eth",
+ [0x00F1] = "ntilde",
+ [0x00F2] = "ograve",
+ [0x00F3] = "oacute",
+ [0x00F4] = "ocircumflex",
+ [0x00F5] = "otilde",
+ [0x00F6] = "odieresis",
+ [0x00F7] = "divide",
+ [0x00F8] = "oslash",
+ [0x00F9] = "ugrave",
+ [0x00FA] = "uacute",
+ [0x00FB] = "ucircumflex",
+ [0x00FC] = "udieresis",
+ [0x00FD] = "yacute",
+ [0x00FE] = "thorn",
+ [0x00FF] = "ydieresis",
+ [0x0100] = "Amacron",
+ [0x0101] = "amacron",
+ [0x0102] = "Abreve",
+ [0x0103] = "abreve",
+ [0x0104] = "Aogonek",
+ [0x0105] = "aogonek",
+ [0x0106] = "Cacute",
+ [0x0107] = "cacute",
+ [0x0108] = "Ccircumflex",
+ [0x0109] = "ccircumflex",
+ [0x010A] = "Cdotaccent",
+ [0x010B] = "cdotaccent",
+ [0x010C] = "Ccaron",
+ [0x010D] = "ccaron",
+ [0x010E] = "Dcaron",
+ [0x010F] = "dcaron",
+ [0x0110] = "Dslash",
+ [0x0111] = "dmacron",
+ [0x0112] = "Emacron",
+ [0x0113] = "emacron",
+ [0x0114] = "Ebreve",
+ [0x0115] = "ebreve",
+ [0x0116] = "Edotaccent",
+ [0x0117] = "edotaccent",
+ [0x0118] = "Eogonek",
+ [0x0119] = "eogonek",
+ [0x011A] = "Ecaron",
+ [0x011B] = "ecaron",
+ [0x011C] = "Gcircumflex",
+ [0x011D] = "gcircumflex",
+ [0x011E] = "Gbreve",
+ [0x011F] = "gbreve",
+ [0x0120] = "Gdotaccent",
+ [0x0121] = "gdotaccent",
+ [0x0122] = "Gcommaaccent",
+ [0x0123] = "gcommaaccent",
+ [0x0124] = "Hcircumflex",
+ [0x0125] = "hcircumflex",
+ [0x0126] = "Hbar",
+ [0x0127] = "hbar",
+ [0x0128] = "Itilde",
+ [0x0129] = "itilde",
+ [0x012A] = "Imacron",
+ [0x012B] = "imacron",
+ [0x012C] = "Ibreve",
+ [0x012D] = "ibreve",
+ [0x012E] = "Iogonek",
+ [0x012F] = "iogonek",
+ [0x0130] = "Idotaccent",
+ [0x0131] = "dotlessi",
+ [0x0132] = "IJ",
+ [0x0133] = "ij",
+ [0x0134] = "Jcircumflex",
+ [0x0135] = "jcircumflex",
+ [0x0136] = "Kcommaaccent",
+ [0x0137] = "kcommaaccent",
+ [0x0138] = "kgreenlandic",
+ [0x0139] = "Lacute",
+ [0x013A] = "lacute",
+ [0x013B] = "Lcommaaccent",
+ [0x013C] = "lcommaaccent",
+ [0x013D] = "Lcaron",
+ [0x013E] = "lcaron",
+ [0x013F] = "Ldotaccent",
+ [0x0140] = "ldotaccent",
+ [0x0141] = "Lslash",
+ [0x0142] = "lslash",
+ [0x0143] = "Nacute",
+ [0x0144] = "nacute",
+ [0x0145] = "Ncommaaccent",
+ [0x0146] = "ncommaaccent",
+ [0x0147] = "Ncaron",
+ [0x0148] = "ncaron",
+ [0x0149] = "quoterightn",
+ [0x014A] = "Eng",
+ [0x014B] = "eng",
+ [0x014C] = "Omacron",
+ [0x014D] = "omacron",
+ [0x014E] = "Obreve",
+ [0x014F] = "obreve",
+ [0x0150] = "Ohungarumlaut",
+ [0x0151] = "ohungarumlaut",
+ [0x0152] = "OE",
+ [0x0153] = "oe",
+ [0x0154] = "Racute",
+ [0x0155] = "racute",
+ [0x0156] = "Rcommaaccent",
+ [0x0157] = "rcommaaccent",
+ [0x0158] = "Rcaron",
+ [0x0159] = "rcaron",
+ [0x015A] = "Sacute",
+ [0x015B] = "sacute",
+ [0x015C] = "Scircumflex",
+ [0x015D] = "scircumflex",
+ [0x015E] = "Scedilla",
+ [0x015F] = "scedilla",
+ [0x0160] = "Scaron",
+ [0x0161] = "scaron",
+ [0x0162] = "Tcommaaccent",
+ [0x0163] = "tcommaaccent",
+ [0x0164] = "Tcaron",
+ [0x0165] = "tcaron",
+ [0x0166] = "Tbar",
+ [0x0167] = "tbar",
+ [0x0168] = "Utilde",
+ [0x0169] = "utilde",
+ [0x016A] = "Umacron",
+ [0x016B] = "umacron",
+ [0x016C] = "Ubreve",
+ [0x016D] = "ubreve",
+ [0x016E] = "Uring",
+ [0x016F] = "uring",
+ [0x0170] = "Uhungarumlaut",
+ [0x0171] = "uhungarumlaut",
+ [0x0172] = "Uogonek",
+ [0x0173] = "uogonek",
+ [0x0174] = "Wcircumflex",
+ [0x0175] = "wcircumflex",
+ [0x0176] = "Ycircumflex",
+ [0x0177] = "ycircumflex",
+ [0x0178] = "Ydieresis",
+ [0x0179] = "Zacute",
+ [0x017A] = "zacute",
+ [0x017B] = "Zdotaccent",
+ [0x017C] = "zdotaccent",
+ [0x017D] = "Zcaron",
+ [0x017E] = "zcaron",
+ [0x017F] = "slong",
+ [0x0180] = "bstroke",
+ [0x0181] = "Bhook",
+ [0x0182] = "Btopbar",
+ [0x0183] = "btopbar",
+ [0x0184] = "Tonesix",
+ [0x0185] = "tonesix",
+ [0x0186] = "Oopen",
+ [0x0187] = "Chook",
+ [0x0188] = "chook",
+ [0x0189] = "Dafrican",
+ [0x018A] = "Dhook",
+ [0x018B] = "Dtopbar",
+ [0x018C] = "dtopbar",
+ [0x018D] = "deltaturned",
+ [0x018E] = "Ereversed",
+ [0x018F] = "Schwa",
+ [0x0190] = "Eopen",
+ [0x0191] = "Fhook",
+ [0x0192] = "florin",
+ [0x0193] = "Ghook",
+ [0x0194] = "Gammaafrican",
+ [0x0195] = "hv",
+ [0x0196] = "Iotaafrican",
+ [0x0197] = "Istroke",
+ [0x0198] = "Khook",
+ [0x0199] = "khook",
+ [0x019A] = "lbar",
+ [0x019B] = "lambdastroke",
+ [0x019C] = "Mturned",
+ [0x019D] = "Nhookleft",
+ [0x019E] = "nlegrightlong",
+ [0x019F] = "Ocenteredtilde",
+ [0x01A0] = "Ohorn",
+ [0x01A1] = "ohorn",
+ [0x01A2] = "Oi",
+ [0x01A3] = "oi",
+ [0x01A4] = "Phook",
+ [0x01A5] = "phook",
+ [0x01A6] = "yr",
+ [0x01A7] = "Tonetwo",
+ [0x01A8] = "tonetwo",
+ [0x01A9] = "Esh",
+ [0x01AA] = "eshreversedloop",
+ [0x01AB] = "tpalatalhook",
+ [0x01AC] = "Thook",
+ [0x01AD] = "thook",
+ [0x01AE] = "Tretroflexhook",
+ [0x01AF] = "Uhorn",
+ [0x01B0] = "uhorn",
+ [0x01B1] = "Upsilonafrican",
+ [0x01B2] = "Vhook",
+ [0x01B3] = "Yhook",
+ [0x01B4] = "yhook",
+ [0x01B5] = "Zstroke",
+ [0x01B6] = "zstroke",
+ [0x01B7] = "Ezh",
+ [0x01B8] = "Ezhreversed",
+ [0x01B9] = "ezhreversed",
+ [0x01BA] = "ezhtail",
+ [0x01BB] = "twostroke",
+ [0x01BC] = "Tonefive",
+ [0x01BD] = "tonefive",
+ [0x01BE] = "glottalinvertedstroke",
+ [0x01BF] = "wynn",
+ [0x01C0] = "clickdental",
+ [0x01C1] = "clicklateral",
+ [0x01C2] = "clickalveolar",
+ [0x01C3] = "clickretroflex",
+ [0x01C4] = "DZcaron",
+ [0x01C5] = "Dzcaron",
+ [0x01C6] = "dzcaron",
+ [0x01C7] = "LJ",
+ [0x01C8] = "Lj",
+ [0x01C9] = "lj",
+ [0x01CA] = "NJ",
+ [0x01CB] = "Nj",
+ [0x01CC] = "nj",
+ [0x01CD] = "Acaron",
+ [0x01CE] = "acaron",
+ [0x01CF] = "Icaron",
+ [0x01D0] = "icaron",
+ [0x01D1] = "Ocaron",
+ [0x01D2] = "ocaron",
+ [0x01D3] = "Ucaron",
+ [0x01D4] = "ucaron",
+ [0x01D5] = "Udieresismacron",
+ [0x01D6] = "udieresismacron",
+ [0x01D7] = "Udieresisacute",
+ [0x01D8] = "udieresisacute",
+ [0x01D9] = "Udieresiscaron",
+ [0x01DA] = "udieresiscaron",
+ [0x01DB] = "Udieresisgrave",
+ [0x01DC] = "udieresisgrave",
+ [0x01DD] = "eturned",
+ [0x01DE] = "Adieresismacron",
+ [0x01DF] = "adieresismacron",
+ [0x01E0] = "Adotmacron",
+ [0x01E1] = "adotmacron",
+ [0x01E2] = "AEmacron",
+ [0x01E3] = "aemacron",
+ [0x01E4] = "Gstroke",
+ [0x01E5] = "gstroke",
+ [0x01E6] = "Gcaron",
+ [0x01E7] = "gcaron",
+ [0x01E8] = "Kcaron",
+ [0x01E9] = "kcaron",
+ [0x01EA] = "Oogonek",
+ [0x01EB] = "oogonek",
+ [0x01EC] = "Oogonekmacron",
+ [0x01ED] = "oogonekmacron",
+ [0x01EE] = "Ezhcaron",
+ [0x01EF] = "ezhcaron",
+ [0x01F0] = "jcaron",
+ [0x01F1] = "DZ",
+ [0x01F2] = "Dz",
+ [0x01F3] = "dz",
+ [0x01F4] = "Gacute",
+ [0x01F5] = "gacute",
+ [0x01FA] = "Aringacute",
+ [0x01FB] = "aringacute",
+ [0x01FC] = "AEacute",
+ [0x01FD] = "aeacute",
+ [0x01FE] = "Ostrokeacute",
+ [0x01FF] = "ostrokeacute",
+ [0x0200] = "Adblgrave",
+ [0x0201] = "adblgrave",
+ [0x0202] = "Ainvertedbreve",
+ [0x0203] = "ainvertedbreve",
+ [0x0204] = "Edblgrave",
+ [0x0205] = "edblgrave",
+ [0x0206] = "Einvertedbreve",
+ [0x0207] = "einvertedbreve",
+ [0x0208] = "Idblgrave",
+ [0x0209] = "idblgrave",
+ [0x020A] = "Iinvertedbreve",
+ [0x020B] = "iinvertedbreve",
+ [0x020C] = "Odblgrave",
+ [0x020D] = "odblgrave",
+ [0x020E] = "Oinvertedbreve",
+ [0x020F] = "oinvertedbreve",
+ [0x0210] = "Rdblgrave",
+ [0x0211] = "rdblgrave",
+ [0x0212] = "Rinvertedbreve",
+ [0x0213] = "rinvertedbreve",
+ [0x0214] = "Udblgrave",
+ [0x0215] = "udblgrave",
+ [0x0216] = "Uinvertedbreve",
+ [0x0217] = "uinvertedbreve",
+ [0x0218] = "Scommaaccent",
+ [0x0219] = "scommaaccent",
+ [0x0250] = "aturned",
+ [0x0251] = "ascript",
+ [0x0252] = "ascriptturned",
+ [0x0253] = "bhook",
+ [0x0254] = "oopen",
+ [0x0255] = "ccurl",
+ [0x0256] = "dtail",
+ [0x0257] = "dhook",
+ [0x0258] = "ereversed",
+ [0x0259] = "schwa",
+ [0x025A] = "schwahook",
+ [0x025B] = "eopen",
+ [0x025C] = "eopenreversed",
+ [0x025D] = "eopenreversedhook",
+ [0x025E] = "eopenreversedclosed",
+ [0x025F] = "jdotlessstroke",
+ [0x0260] = "ghook",
+ [0x0261] = "gscript",
+ [0x0263] = "gammalatinsmall",
+ [0x0264] = "ramshorn",
+ [0x0265] = "hturned",
+ [0x0266] = "hhook",
+ [0x0267] = "henghook",
+ [0x0268] = "istroke",
+ [0x0269] = "iotalatin",
+ [0x026B] = "lmiddletilde",
+ [0x026C] = "lbelt",
+ [0x026D] = "lhookretroflex",
+ [0x026E] = "lezh",
+ [0x026F] = "mturned",
+ [0x0270] = "mlonglegturned",
+ [0x0271] = "mhook",
+ [0x0272] = "nhookleft",
+ [0x0273] = "nhookretroflex",
+ [0x0275] = "obarred",
+ [0x0277] = "omegalatinclosed",
+ [0x0278] = "philatin",
+ [0x0279] = "rturned",
+ [0x027A] = "rlonglegturned",
+ [0x027B] = "rhookturned",
+ [0x027C] = "rlongleg",
+ [0x027D] = "rhook",
+ [0x027E] = "rfishhook",
+ [0x027F] = "rfishhookreversed",
+ [0x0281] = "Rsmallinverted",
+ [0x0282] = "shook",
+ [0x0283] = "esh",
+ [0x0284] = "dotlessjstrokehook",
+ [0x0285] = "eshsquatreversed",
+ [0x0286] = "eshcurl",
+ [0x0287] = "tturned",
+ [0x0288] = "tretroflexhook",
+ [0x0289] = "ubar",
+ [0x028A] = "upsilonlatin",
+ [0x028B] = "vhook",
+ [0x028C] = "vturned",
+ [0x028D] = "wturned",
+ [0x028E] = "yturned",
+ [0x0290] = "zretroflexhook",
+ [0x0291] = "zcurl",
+ [0x0292] = "ezh",
+ [0x0293] = "ezhcurl",
+ [0x0294] = "glottalstop",
+ [0x0295] = "glottalstopreversed",
+ [0x0296] = "glottalstopinverted",
+ [0x0297] = "cstretched",
+ [0x0298] = "bilabialclick",
+ [0x029A] = "eopenclosed",
+ [0x029B] = "Gsmallhook",
+ [0x029D] = "jcrossedtail",
+ [0x029E] = "kturned",
+ [0x02A0] = "qhook",
+ [0x02A1] = "glottalstopstroke",
+ [0x02A2] = "glottalstopstrokereversed",
+ [0x02A3] = "dzaltone",
+ [0x02A4] = "dezh",
+ [0x02A5] = "dzcurl",
+ [0x02A6] = "ts",
+ [0x02A7] = "tesh",
+ [0x02A8] = "tccurl",
+ [0x02B0] = "hsuperior",
+ [0x02B1] = "hhooksuperior",
+ [0x02B2] = "jsuperior",
+ [0x02B4] = "rturnedsuperior",
+ [0x02B5] = "rhookturnedsuperior",
+ [0x02B6] = "Rsmallinvertedsuperior",
+ [0x02B7] = "wsuperior",
+ [0x02B8] = "ysuperior",
+ [0x02B9] = "primemod",
+ [0x02BA] = "dblprimemod",
+ [0x02BB] = "commaturnedmod",
+ [0x02BC] = "apostrophemod",
+ [0x02BD] = "commareversedmod",
+ [0x02BE] = "ringhalfright",
+ [0x02BF] = "ringhalfleft",
+ [0x02C0] = "glottalstopmod",
+ [0x02C1] = "glottalstopreversedmod",
+ [0x02C2] = "arrowheadleftmod",
+ [0x02C3] = "arrowheadrightmod",
+ [0x02C4] = "arrowheadupmod",
+ [0x02C5] = "arrowheaddownmod",
+ [0x02C6] = "circumflex",
+ [0x02C7] = "caron",
+ [0x02C8] = "verticallinemod",
+ [0x02C9] = "firsttonechinese",
+ [0x02CA] = "secondtonechinese",
+ [0x02CB] = "fourthtonechinese",
+ [0x02CC] = "verticallinelowmod",
+ [0x02CD] = "macronlowmod",
+ [0x02CE] = "gravelowmod",
+ [0x02CF] = "acutelowmod",
+ [0x02D0] = "colontriangularmod",
+ [0x02D1] = "colontriangularhalfmod",
+ [0x02D2] = "ringhalfrightcentered",
+ [0x02D3] = "ringhalfleftcentered",
+ [0x02D4] = "uptackmod",
+ [0x02D5] = "downtackmod",
+ [0x02D6] = "plusmod",
+ [0x02D7] = "minusmod",
+ [0x02D8] = "breve",
+ [0x02D9] = "dotaccent",
+ [0x02DA] = "ring",
+ [0x02DB] = "ogonek",
+ [0x02DC] = "tilde",
+ [0x02DD] = "hungarumlaut",
+ [0x02DE] = "rhotichookmod",
+ [0x02E0] = "gammasuperior",
+ [0x02E3] = "xsuperior",
+ [0x02E4] = "glottalstopreversedsuperior",
+ [0x02E5] = "tonebarextrahighmod",
+ [0x02E6] = "tonebarhighmod",
+ [0x02E7] = "tonebarmidmod",
+ [0x02E8] = "tonebarlowmod",
+ [0x02E9] = "tonebarextralowmod",
+ [0x0300] = "gravecomb",
+ [0x0301] = "acutecomb",
+ [0x0302] = "circumflexcmb",
+ [0x0303] = "tildecomb",
+ [0x0304] = "macroncmb",
+ [0x0305] = "overlinecmb",
+ [0x0306] = "brevecmb",
+ [0x0307] = "dotaccentcmb",
+ [0x0308] = "dieresiscmb",
+ [0x0309] = "hookcmb",
+ [0x030A] = "ringcmb",
+ [0x030B] = "hungarumlautcmb",
+ [0x030C] = "caroncmb",
+ [0x030D] = "verticallineabovecmb",
+ [0x030E] = "dblverticallineabovecmb",
+ [0x030F] = "dblgravecmb",
+ [0x0310] = "candrabinducmb",
+ [0x0311] = "breveinvertedcmb",
+ [0x0312] = "commaturnedabovecmb",
+ [0x0313] = "commaabovecmb",
+ [0x0314] = "commareversedabovecmb",
+ [0x0315] = "commaaboverightcmb",
+ [0x0316] = "gravebelowcmb",
+ [0x0317] = "acutebelowcmb",
+ [0x0318] = "lefttackbelowcmb",
+ [0x0319] = "righttackbelowcmb",
+ [0x031A] = "leftangleabovecmb",
+ [0x031B] = "horncmb",
+ [0x031C] = "ringhalfleftbelowcmb",
+ [0x031D] = "uptackbelowcmb",
+ [0x031E] = "downtackbelowcmb",
+ [0x031F] = "plusbelowcmb",
+ [0x0320] = "minusbelowcmb",
+ [0x0321] = "hookpalatalizedbelowcmb",
+ [0x0322] = "hookretroflexbelowcmb",
+ [0x0323] = "dotbelowcomb",
+ [0x0324] = "dieresisbelowcmb",
+ [0x0325] = "ringbelowcmb",
+ [0x0327] = "cedillacmb",
+ [0x0328] = "ogonekcmb",
+ [0x0329] = "verticallinebelowcmb",
+ [0x032A] = "bridgebelowcmb",
+ [0x032B] = "dblarchinvertedbelowcmb",
+ [0x032C] = "caronbelowcmb",
+ [0x032D] = "circumflexbelowcmb",
+ [0x032E] = "brevebelowcmb",
+ [0x032F] = "breveinvertedbelowcmb",
+ [0x0330] = "tildebelowcmb",
+ [0x0331] = "macronbelowcmb",
+ [0x0332] = "lowlinecmb",
+ [0x0333] = "dbllowlinecmb",
+ [0x0334] = "tildeoverlaycmb",
+ [0x0335] = "strokeshortoverlaycmb",
+ [0x0336] = "strokelongoverlaycmb",
+ [0x0337] = "solidusshortoverlaycmb",
+ [0x0338] = "soliduslongoverlaycmb",
+ [0x0339] = "ringhalfrightbelowcmb",
+ [0x033A] = "bridgeinvertedbelowcmb",
+ [0x033B] = "squarebelowcmb",
+ [0x033C] = "seagullbelowcmb",
+ [0x033D] = "xabovecmb",
+ [0x033E] = "tildeverticalcmb",
+ [0x033F] = "dbloverlinecmb",
+ [0x0340] = "gravetonecmb",
+ [0x0341] = "acutetonecmb",
+ [0x0342] = "perispomenigreekcmb",
+ [0x0343] = "koroniscmb",
+ [0x0344] = "dialytikatonoscmb",
+ [0x0345] = "ypogegrammenigreekcmb",
+ [0x0360] = "tildedoublecmb",
+ [0x0361] = "breveinverteddoublecmb",
+ [0x0374] = "numeralsigngreek",
+ [0x0375] = "numeralsignlowergreek",
+ [0x037A] = "ypogegrammeni",
+ [0x037E] = "questiongreek",
+ [0x0384] = "tonos",
+ [0x0385] = "dieresistonos",
+ [0x0386] = "Alphatonos",
+ [0x0387] = "anoteleia",
+ [0x0388] = "Epsilontonos",
+ [0x0389] = "Etatonos",
+ [0x038A] = "Iotatonos",
+ [0x038C] = "Omicrontonos",
+ [0x038E] = "Upsilontonos",
+ [0x038F] = "Omegatonos",
+ [0x0390] = "iotadieresistonos",
+ [0x0391] = "Alpha",
+ [0x0392] = "Beta",
+ [0x0393] = "Gamma",
+ [0x0394] = "Deltagreek",
+ [0x0395] = "Epsilon",
+ [0x0396] = "Zeta",
+ [0x0397] = "Eta",
+ [0x0398] = "Theta",
+ [0x0399] = "Iota",
+ [0x039A] = "Kappa",
+ [0x039B] = "Lambda",
+ [0x039C] = "Mu",
+ [0x039D] = "Nu",
+ [0x039E] = "Xi",
+ [0x039F] = "Omicron",
+ [0x03A0] = "Pi",
+ [0x03A1] = "Rho",
+ [0x03A3] = "Sigma",
+ [0x03A4] = "Tau",
+ [0x03A5] = "Upsilon",
+ [0x03A6] = "Phi",
+ [0x03A7] = "Chi",
+ [0x03A8] = "Psi",
+ [0x03A9] = "Omegagreek",
+ [0x03AA] = "Iotadieresis",
+ [0x03AB] = "Upsilondieresis",
+ [0x03AC] = "alphatonos",
+ [0x03AD] = "epsilontonos",
+ [0x03AE] = "etatonos",
+ [0x03AF] = "iotatonos",
+ [0x03B0] = "upsilondieresistonos",
+ [0x03B1] = "alpha",
+ [0x03B2] = "beta",
+ [0x03B3] = "gamma",
+ [0x03B4] = "delta",
+ [0x03B5] = "epsilon",
+ [0x03B6] = "zeta",
+ [0x03B7] = "eta",
+ [0x03B8] = "theta",
+ [0x03B9] = "iota",
+ [0x03BA] = "kappa",
+ [0x03BB] = "lambda",
+ [0x03BC] = "mugreek",
+ [0x03BD] = "nu",
+ [0x03BE] = "xi",
+ [0x03BF] = "omicron",
+ [0x03C0] = "pi",
+ [0x03C1] = "rho",
+ [0x03C2] = "sigmafinal",
+ [0x03C3] = "sigma",
+ [0x03C4] = "tau",
+ [0x03C5] = "upsilon",
+ [0x03C6] = "phi",
+ [0x03C7] = "chi",
+ [0x03C8] = "psi",
+ [0x03C9] = "omega",
+ [0x03CA] = "iotadieresis",
+ [0x03CB] = "upsilondieresis",
+ [0x03CC] = "omicrontonos",
+ [0x03CD] = "upsilontonos",
+ [0x03CE] = "omegatonos",
+ [0x03D0] = "betasymbolgreek",
+ [0x03D1] = "thetasymbolgreek",
+ [0x03D2] = "Upsilonhooksymbol",
+ [0x03D3] = "Upsilonacutehooksymbolgreek",
+ [0x03D4] = "Upsilondieresishooksymbolgreek",
+ [0x03D5] = "phisymbolgreek",
+ [0x03D6] = "pisymbolgreek",
+ [0x03DA] = "Stigmagreek",
+ [0x03DC] = "Digammagreek",
+ [0x03DE] = "Koppagreek",
+ [0x03E0] = "Sampigreek",
+ [0x03E2] = "Sheicoptic",
+ [0x03E3] = "sheicoptic",
+ [0x03E4] = "Feicoptic",
+ [0x03E5] = "feicoptic",
+ [0x03E6] = "Kheicoptic",
+ [0x03E7] = "kheicoptic",
+ [0x03E8] = "Horicoptic",
+ [0x03E9] = "horicoptic",
+ [0x03EA] = "Gangiacoptic",
+ [0x03EB] = "gangiacoptic",
+ [0x03EC] = "Shimacoptic",
+ [0x03ED] = "shimacoptic",
+ [0x03EE] = "Deicoptic",
+ [0x03EF] = "deicoptic",
+ [0x03F0] = "kappasymbolgreek",
+ [0x03F1] = "rhosymbolgreek",
+ [0x03F2] = "sigmalunatesymbolgreek",
+ [0x03F3] = "yotgreek",
+ [0x0401] = "afii10023",
+ [0x0402] = "afii10051",
+ [0x0403] = "afii10052",
+ [0x0404] = "afii10053",
+ [0x0405] = "afii10054",
+ [0x0406] = "afii10055",
+ [0x0407] = "afii10056",
+ [0x0408] = "afii10057",
+ [0x0409] = "afii10058",
+ [0x040A] = "afii10059",
+ [0x040B] = "afii10060",
+ [0x040C] = "afii10061",
+ [0x040E] = "afii10062",
+ [0x040F] = "afii10145",
+ [0x0410] = "afii10017",
+ [0x0411] = "afii10018",
+ [0x0412] = "afii10019",
+ [0x0413] = "afii10020",
+ [0x0414] = "afii10021",
+ [0x0415] = "afii10022",
+ [0x0416] = "afii10024",
+ [0x0417] = "afii10025",
+ [0x0418] = "afii10026",
+ [0x0419] = "afii10027",
+ [0x041A] = "afii10028",
+ [0x041B] = "afii10029",
+ [0x041C] = "afii10030",
+ [0x041D] = "afii10031",
+ [0x041E] = "afii10032",
+ [0x041F] = "afii10033",
+ [0x0420] = "afii10034",
+ [0x0421] = "afii10035",
+ [0x0422] = "afii10036",
+ [0x0423] = "afii10037",
+ [0x0424] = "afii10038",
+ [0x0425] = "afii10039",
+ [0x0426] = "afii10040",
+ [0x0427] = "afii10041",
+ [0x0428] = "afii10042",
+ [0x0429] = "afii10043",
+ [0x042A] = "afii10044",
+ [0x042B] = "afii10045",
+ [0x042C] = "afii10046",
+ [0x042D] = "afii10047",
+ [0x042E] = "afii10048",
+ [0x042F] = "afii10049",
+ [0x0430] = "afii10065",
+ [0x0431] = "becyrillic",
+ [0x0432] = "vecyrillic",
+ [0x0433] = "gecyrillic",
+ [0x0434] = "decyrillic",
+ [0x0435] = "iecyrillic",
+ [0x0436] = "zhecyrillic",
+ [0x0437] = "zecyrillic",
+ [0x0438] = "iicyrillic",
+ [0x0439] = "iishortcyrillic",
+ [0x043A] = "kacyrillic",
+ [0x043B] = "elcyrillic",
+ [0x043C] = "emcyrillic",
+ [0x043D] = "encyrillic",
+ [0x043E] = "ocyrillic",
+ [0x043F] = "pecyrillic",
+ [0x0440] = "ercyrillic",
+ [0x0441] = "escyrillic",
+ [0x0442] = "tecyrillic",
+ [0x0443] = "ucyrillic",
+ [0x0444] = "efcyrillic",
+ [0x0445] = "khacyrillic",
+ [0x0446] = "tsecyrillic",
+ [0x0447] = "checyrillic",
+ [0x0448] = "shacyrillic",
+ [0x0449] = "shchacyrillic",
+ [0x044A] = "hardsigncyrillic",
+ [0x044B] = "yericyrillic",
+ [0x044C] = "softsigncyrillic",
+ [0x044D] = "ereversedcyrillic",
+ [0x044E] = "iucyrillic",
+ [0x044F] = "iacyrillic",
+ [0x0451] = "iocyrillic",
+ [0x0452] = "djecyrillic",
+ [0x0453] = "gjecyrillic",
+ [0x0454] = "ecyrillic",
+ [0x0455] = "dzecyrillic",
+ [0x0456] = "icyrillic",
+ [0x0457] = "yicyrillic",
+ [0x0458] = "jecyrillic",
+ [0x0459] = "ljecyrillic",
+ [0x045A] = "njecyrillic",
+ [0x045B] = "tshecyrillic",
+ [0x045C] = "kjecyrillic",
+ [0x045E] = "ushortcyrillic",
+ [0x045F] = "dzhecyrillic",
+ [0x0460] = "Omegacyrillic",
+ [0x0461] = "omegacyrillic",
+ [0x0462] = "afii10146",
+ [0x0463] = "yatcyrillic",
+ [0x0464] = "Eiotifiedcyrillic",
+ [0x0465] = "eiotifiedcyrillic",
+ [0x0466] = "Yuslittlecyrillic",
+ [0x0467] = "yuslittlecyrillic",
+ [0x0468] = "Yuslittleiotifiedcyrillic",
+ [0x0469] = "yuslittleiotifiedcyrillic",
+ [0x046A] = "Yusbigcyrillic",
+ [0x046B] = "yusbigcyrillic",
+ [0x046C] = "Yusbigiotifiedcyrillic",
+ [0x046D] = "yusbigiotifiedcyrillic",
+ [0x046E] = "Ksicyrillic",
+ [0x046F] = "ksicyrillic",
+ [0x0470] = "Psicyrillic",
+ [0x0471] = "psicyrillic",
+ [0x0472] = "afii10147",
+ [0x0473] = "fitacyrillic",
+ [0x0474] = "afii10148",
+ [0x0475] = "izhitsacyrillic",
+ [0x0476] = "Izhitsadblgravecyrillic",
+ [0x0477] = "izhitsadblgravecyrillic",
+ [0x0478] = "Ukcyrillic",
+ [0x0479] = "ukcyrillic",
+ [0x047A] = "Omegaroundcyrillic",
+ [0x047B] = "omegaroundcyrillic",
+ [0x047C] = "Omegatitlocyrillic",
+ [0x047D] = "omegatitlocyrillic",
+ [0x047E] = "Otcyrillic",
+ [0x047F] = "otcyrillic",
+ [0x0480] = "Koppacyrillic",
+ [0x0481] = "koppacyrillic",
+ [0x0482] = "thousandcyrillic",
+ [0x0483] = "titlocyrilliccmb",
+ [0x0484] = "palatalizationcyrilliccmb",
+ [0x0485] = "dasiapneumatacyrilliccmb",
+ [0x0486] = "psilipneumatacyrilliccmb",
+ [0x0490] = "afii10050",
+ [0x0491] = "gheupturncyrillic",
+ [0x0492] = "Ghestrokecyrillic",
+ [0x0493] = "ghestrokecyrillic",
+ [0x0494] = "Ghemiddlehookcyrillic",
+ [0x0495] = "ghemiddlehookcyrillic",
+ [0x0496] = "Zhedescendercyrillic",
+ [0x0497] = "zhedescendercyrillic",
+ [0x0498] = "Zedescendercyrillic",
+ [0x0499] = "zedescendercyrillic",
+ [0x049A] = "Kadescendercyrillic",
+ [0x049B] = "kadescendercyrillic",
+ [0x049C] = "Kaverticalstrokecyrillic",
+ [0x049D] = "kaverticalstrokecyrillic",
+ [0x049E] = "Kastrokecyrillic",
+ [0x049F] = "kastrokecyrillic",
+ [0x04A0] = "Kabashkircyrillic",
+ [0x04A1] = "kabashkircyrillic",
+ [0x04A2] = "Endescendercyrillic",
+ [0x04A3] = "endescendercyrillic",
+ [0x04A4] = "Enghecyrillic",
+ [0x04A5] = "enghecyrillic",
+ [0x04A6] = "Pemiddlehookcyrillic",
+ [0x04A7] = "pemiddlehookcyrillic",
+ [0x04A8] = "Haabkhasiancyrillic",
+ [0x04A9] = "haabkhasiancyrillic",
+ [0x04AA] = "Esdescendercyrillic",
+ [0x04AB] = "esdescendercyrillic",
+ [0x04AC] = "Tedescendercyrillic",
+ [0x04AD] = "tedescendercyrillic",
+ [0x04AE] = "Ustraightcyrillic",
+ [0x04AF] = "ustraightcyrillic",
+ [0x04B0] = "Ustraightstrokecyrillic",
+ [0x04B1] = "ustraightstrokecyrillic",
+ [0x04B2] = "Hadescendercyrillic",
+ [0x04B3] = "hadescendercyrillic",
+ [0x04B4] = "Tetsecyrillic",
+ [0x04B5] = "tetsecyrillic",
+ [0x04B6] = "Chedescendercyrillic",
+ [0x04B7] = "chedescendercyrillic",
+ [0x04B8] = "Cheverticalstrokecyrillic",
+ [0x04B9] = "cheverticalstrokecyrillic",
+ [0x04BA] = "Shhacyrillic",
+ [0x04BB] = "shhacyrillic",
+ [0x04BC] = "Cheabkhasiancyrillic",
+ [0x04BD] = "cheabkhasiancyrillic",
+ [0x04BE] = "Chedescenderabkhasiancyrillic",
+ [0x04BF] = "chedescenderabkhasiancyrillic",
+ [0x04C0] = "palochkacyrillic",
+ [0x04C1] = "Zhebrevecyrillic",
+ [0x04C2] = "zhebrevecyrillic",
+ [0x04C3] = "Kahookcyrillic",
+ [0x04C4] = "kahookcyrillic",
+ [0x04C7] = "Enhookcyrillic",
+ [0x04C8] = "enhookcyrillic",
+ [0x04CB] = "Chekhakassiancyrillic",
+ [0x04CC] = "chekhakassiancyrillic",
+ [0x04D0] = "Abrevecyrillic",
+ [0x04D1] = "abrevecyrillic",
+ [0x04D2] = "Adieresiscyrillic",
+ [0x04D3] = "adieresiscyrillic",
+ [0x04D4] = "Aiecyrillic",
+ [0x04D5] = "aiecyrillic",
+ [0x04D6] = "Iebrevecyrillic",
+ [0x04D7] = "iebrevecyrillic",
+ [0x04D8] = "Schwacyrillic",
+ [0x04D9] = "schwacyrillic",
+ [0x04DA] = "Schwadieresiscyrillic",
+ [0x04DB] = "schwadieresiscyrillic",
+ [0x04DC] = "Zhedieresiscyrillic",
+ [0x04DD] = "zhedieresiscyrillic",
+ [0x04DE] = "Zedieresiscyrillic",
+ [0x04DF] = "zedieresiscyrillic",
+ [0x04E0] = "Dzeabkhasiancyrillic",
+ [0x04E1] = "dzeabkhasiancyrillic",
+ [0x04E2] = "Imacroncyrillic",
+ [0x04E3] = "imacroncyrillic",
+ [0x04E4] = "Idieresiscyrillic",
+ [0x04E5] = "idieresiscyrillic",
+ [0x04E6] = "Odieresiscyrillic",
+ [0x04E7] = "odieresiscyrillic",
+ [0x04E8] = "Obarredcyrillic",
+ [0x04E9] = "obarredcyrillic",
+ [0x04EA] = "Obarreddieresiscyrillic",
+ [0x04EB] = "obarreddieresiscyrillic",
+ [0x04EE] = "Umacroncyrillic",
+ [0x04EF] = "umacroncyrillic",
+ [0x04F0] = "Udieresiscyrillic",
+ [0x04F1] = "udieresiscyrillic",
+ [0x04F2] = "Uhungarumlautcyrillic",
+ [0x04F3] = "uhungarumlautcyrillic",
+ [0x04F4] = "Chedieresiscyrillic",
+ [0x04F5] = "chedieresiscyrillic",
+ [0x04F8] = "Yerudieresiscyrillic",
+ [0x04F9] = "yerudieresiscyrillic",
+ [0x0531] = "Aybarmenian",
+ [0x0532] = "Benarmenian",
+ [0x0533] = "Gimarmenian",
+ [0x0534] = "Daarmenian",
+ [0x0535] = "Echarmenian",
+ [0x0536] = "Zaarmenian",
+ [0x0537] = "Eharmenian",
+ [0x0538] = "Etarmenian",
+ [0x0539] = "Toarmenian",
+ [0x053A] = "Zhearmenian",
+ [0x053B] = "Iniarmenian",
+ [0x053C] = "Liwnarmenian",
+ [0x053D] = "Xeharmenian",
+ [0x053E] = "Caarmenian",
+ [0x053F] = "Kenarmenian",
+ [0x0540] = "Hoarmenian",
+ [0x0541] = "Jaarmenian",
+ [0x0542] = "Ghadarmenian",
+ [0x0543] = "Cheharmenian",
+ [0x0544] = "Menarmenian",
+ [0x0545] = "Yiarmenian",
+ [0x0546] = "Nowarmenian",
+ [0x0547] = "Shaarmenian",
+ [0x0548] = "Voarmenian",
+ [0x0549] = "Chaarmenian",
+ [0x054A] = "Peharmenian",
+ [0x054B] = "Jheharmenian",
+ [0x054C] = "Raarmenian",
+ [0x054D] = "Seharmenian",
+ [0x054E] = "Vewarmenian",
+ [0x054F] = "Tiwnarmenian",
+ [0x0550] = "Reharmenian",
+ [0x0551] = "Coarmenian",
+ [0x0552] = "Yiwnarmenian",
+ [0x0553] = "Piwrarmenian",
+ [0x0554] = "Keharmenian",
+ [0x0555] = "Oharmenian",
+ [0x0556] = "Feharmenian",
+ [0x0559] = "ringhalfleftarmenian",
+ [0x055A] = "apostrophearmenian",
+ [0x055B] = "emphasismarkarmenian",
+ [0x055C] = "exclamarmenian",
+ [0x055D] = "commaarmenian",
+ [0x055E] = "questionarmenian",
+ [0x055F] = "abbreviationmarkarmenian",
+ [0x0561] = "aybarmenian",
+ [0x0562] = "benarmenian",
+ [0x0563] = "gimarmenian",
+ [0x0564] = "daarmenian",
+ [0x0565] = "echarmenian",
+ [0x0566] = "zaarmenian",
+ [0x0567] = "eharmenian",
+ [0x0568] = "etarmenian",
+ [0x0569] = "toarmenian",
+ [0x056A] = "zhearmenian",
+ [0x056B] = "iniarmenian",
+ [0x056C] = "liwnarmenian",
+ [0x056D] = "xeharmenian",
+ [0x056E] = "caarmenian",
+ [0x056F] = "kenarmenian",
+ [0x0570] = "hoarmenian",
+ [0x0571] = "jaarmenian",
+ [0x0572] = "ghadarmenian",
+ [0x0573] = "cheharmenian",
+ [0x0574] = "menarmenian",
+ [0x0575] = "yiarmenian",
+ [0x0576] = "nowarmenian",
+ [0x0577] = "shaarmenian",
+ [0x0578] = "voarmenian",
+ [0x0579] = "chaarmenian",
+ [0x057A] = "peharmenian",
+ [0x057B] = "jheharmenian",
+ [0x057C] = "raarmenian",
+ [0x057D] = "seharmenian",
+ [0x057E] = "vewarmenian",
+ [0x057F] = "tiwnarmenian",
+ [0x0580] = "reharmenian",
+ [0x0581] = "coarmenian",
+ [0x0582] = "yiwnarmenian",
+ [0x0583] = "piwrarmenian",
+ [0x0584] = "keharmenian",
+ [0x0585] = "oharmenian",
+ [0x0586] = "feharmenian",
+ [0x0587] = "echyiwnarmenian",
+ [0x0589] = "periodarmenian",
+ [0x0591] = "etnahtalefthebrew",
+ [0x0592] = "segoltahebrew",
+ [0x0593] = "shalshelethebrew",
+ [0x0594] = "zaqefqatanhebrew",
+ [0x0595] = "zaqefgadolhebrew",
+ [0x0596] = "tipehalefthebrew",
+ [0x0597] = "reviamugrashhebrew",
+ [0x0598] = "zarqahebrew",
+ [0x0599] = "pashtahebrew",
+ [0x059A] = "yetivhebrew",
+ [0x059B] = "tevirlefthebrew",
+ [0x059C] = "gereshaccenthebrew",
+ [0x059D] = "gereshmuqdamhebrew",
+ [0x059E] = "gershayimaccenthebrew",
+ [0x059F] = "qarneyparahebrew",
+ [0x05A0] = "telishagedolahebrew",
+ [0x05A1] = "pazerhebrew",
+ [0x05A3] = "munahlefthebrew",
+ [0x05A4] = "mahapakhlefthebrew",
+ [0x05A5] = "merkhalefthebrew",
+ [0x05A6] = "merkhakefulalefthebrew",
+ [0x05A7] = "dargalefthebrew",
+ [0x05A8] = "qadmahebrew",
+ [0x05A9] = "telishaqetanahebrew",
+ [0x05AA] = "yerahbenyomolefthebrew",
+ [0x05AB] = "olehebrew",
+ [0x05AC] = "iluyhebrew",
+ [0x05AD] = "dehihebrew",
+ [0x05AE] = "zinorhebrew",
+ [0x05AF] = "masoracirclehebrew",
+ [0x05B0] = "shevawidehebrew",
+ [0x05B1] = "hatafsegolwidehebrew",
+ [0x05B2] = "hatafpatahwidehebrew",
+ [0x05B3] = "hatafqamatswidehebrew",
+ [0x05B4] = "hiriqwidehebrew",
+ [0x05B5] = "tserewidehebrew",
+ [0x05B6] = "segolwidehebrew",
+ [0x05B7] = "patahwidehebrew",
+ [0x05B8] = "qamatswidehebrew",
+ [0x05B9] = "holamwidehebrew",
+ [0x05BB] = "qubutswidehebrew",
+ [0x05BC] = "dageshhebrew",
+ [0x05BD] = "siluqlefthebrew",
+ [0x05BE] = "maqafhebrew",
+ [0x05BF] = "rafehebrew",
+ [0x05C0] = "paseqhebrew",
+ [0x05C1] = "shindothebrew",
+ [0x05C2] = "sindothebrew",
+ [0x05C3] = "sofpasuqhebrew",
+ [0x05C4] = "upperdothebrew",
+ [0x05D0] = "alefhebrew",
+ [0x05D1] = "bethebrew",
+ [0x05D2] = "gimelhebrew",
+ [0x05D3] = "dalettserehebrew",
+ [0x05D4] = "hehebrew",
+ [0x05D5] = "vavhebrew",
+ [0x05D6] = "zayinhebrew",
+ [0x05D7] = "hethebrew",
+ [0x05D8] = "tethebrew",
+ [0x05D9] = "yodhebrew",
+ [0x05DA] = "finalkafshevahebrew",
+ [0x05DB] = "kafhebrew",
+ [0x05DC] = "lamedholamhebrew",
+ [0x05DD] = "finalmemhebrew",
+ [0x05DE] = "memhebrew",
+ [0x05DF] = "finalnunhebrew",
+ [0x05E0] = "nunhebrew",
+ [0x05E1] = "samekhhebrew",
+ [0x05E2] = "ayinhebrew",
+ [0x05E3] = "finalpehebrew",
+ [0x05E4] = "pehebrew",
+ [0x05E5] = "finaltsadihebrew",
+ [0x05E6] = "tsadihebrew",
+ [0x05E7] = "qoftserehebrew",
+ [0x05E8] = "reshtserehebrew",
+ [0x05E9] = "shinhebrew",
+ [0x05EA] = "tavhebrew",
+ [0x05F0] = "vavvavhebrew",
+ [0x05F1] = "vavyodhebrew",
+ [0x05F2] = "yodyodhebrew",
+ [0x05F3] = "gereshhebrew",
+ [0x05F4] = "gershayimhebrew",
+ [0x060C] = "commaarabic",
+ [0x061B] = "semicolonarabic",
+ [0x061F] = "questionarabic",
+ [0x0621] = "hamzasukunarabic",
+ [0x0622] = "alefmaddaabovearabic",
+ [0x0623] = "alefhamzaabovearabic",
+ [0x0624] = "wawhamzaabovearabic",
+ [0x0625] = "alefhamzabelowarabic",
+ [0x0626] = "yehhamzaabovearabic",
+ [0x0627] = "alefarabic",
+ [0x0628] = "beharabic",
+ [0x0629] = "tehmarbutaarabic",
+ [0x062A] = "teharabic",
+ [0x062B] = "theharabic",
+ [0x062C] = "jeemarabic",
+ [0x062D] = "haharabic",
+ [0x062E] = "khaharabic",
+ [0x062F] = "dalarabic",
+ [0x0630] = "thalarabic",
+ [0x0631] = "rehyehaleflamarabic",
+ [0x0632] = "zainarabic",
+ [0x0633] = "seenarabic",
+ [0x0634] = "sheenarabic",
+ [0x0635] = "sadarabic",
+ [0x0636] = "dadarabic",
+ [0x0637] = "taharabic",
+ [0x0638] = "zaharabic",
+ [0x0639] = "ainarabic",
+ [0x063A] = "ghainarabic",
+ [0x0640] = "tatweelarabic",
+ [0x0641] = "feharabic",
+ [0x0642] = "qafarabic",
+ [0x0643] = "kafarabic",
+ [0x0644] = "lamarabic",
+ [0x0645] = "meemarabic",
+ [0x0646] = "noonarabic",
+ [0x0647] = "heharabic",
+ [0x0648] = "wawarabic",
+ [0x0649] = "alefmaksuraarabic",
+ [0x064A] = "yeharabic",
+ [0x064B] = "fathatanarabic",
+ [0x064C] = "dammatanarabic",
+ [0x064D] = "kasratanarabic",
+ [0x064E] = "fathalowarabic",
+ [0x064F] = "dammalowarabic",
+ [0x0650] = "kasraarabic",
+ [0x0651] = "shaddafathatanarabic",
+ [0x0652] = "sukunarabic",
+ [0x0660] = "zerohackarabic",
+ [0x0661] = "onehackarabic",
+ [0x0662] = "twohackarabic",
+ [0x0663] = "threehackarabic",
+ [0x0664] = "fourhackarabic",
+ [0x0665] = "fivehackarabic",
+ [0x0666] = "sixhackarabic",
+ [0x0667] = "sevenhackarabic",
+ [0x0668] = "eighthackarabic",
+ [0x0669] = "ninehackarabic",
+ [0x066A] = "percentarabic",
+ [0x066B] = "decimalseparatorpersian",
+ [0x066C] = "thousandsseparatorpersian",
+ [0x066D] = "asteriskarabic",
+ [0x0679] = "tteharabic",
+ [0x067E] = "peharabic",
+ [0x0686] = "tcheharabic",
+ [0x0688] = "ddalarabic",
+ [0x0691] = "rreharabic",
+ [0x0698] = "jeharabic",
+ [0x06A4] = "veharabic",
+ [0x06AF] = "gafarabic",
+ [0x06BA] = "noonghunnaarabic",
+ [0x06C1] = "hehaltonearabic",
+ [0x06D1] = "yehthreedotsbelowarabic",
+ [0x06D2] = "yehbarreearabic",
+ [0x06D5] = "afii57534",
+ [0x06F0] = "zeropersian",
+ [0x06F1] = "onepersian",
+ [0x06F2] = "twopersian",
+ [0x06F3] = "threepersian",
+ [0x06F4] = "fourpersian",
+ [0x06F5] = "fivepersian",
+ [0x06F6] = "sixpersian",
+ [0x06F7] = "sevenpersian",
+ [0x06F8] = "eightpersian",
+ [0x06F9] = "ninepersian",
+ [0x0901] = "candrabindudeva",
+ [0x0902] = "anusvaradeva",
+ [0x0903] = "visargadeva",
+ [0x0905] = "adeva",
+ [0x0906] = "aadeva",
+ [0x0907] = "ideva",
+ [0x0908] = "iideva",
+ [0x0909] = "udeva",
+ [0x090A] = "uudeva",
+ [0x090B] = "rvocalicdeva",
+ [0x090C] = "lvocalicdeva",
+ [0x090D] = "ecandradeva",
+ [0x090E] = "eshortdeva",
+ [0x090F] = "edeva",
+ [0x0910] = "aideva",
+ [0x0911] = "ocandradeva",
+ [0x0912] = "oshortdeva",
+ [0x0913] = "odeva",
+ [0x0914] = "audeva",
+ [0x0915] = "kadeva",
+ [0x0916] = "khadeva",
+ [0x0917] = "gadeva",
+ [0x0918] = "ghadeva",
+ [0x0919] = "ngadeva",
+ [0x091A] = "cadeva",
+ [0x091B] = "chadeva",
+ [0x091C] = "jadeva",
+ [0x091D] = "jhadeva",
+ [0x091E] = "nyadeva",
+ [0x091F] = "ttadeva",
+ [0x0920] = "tthadeva",
+ [0x0921] = "ddadeva",
+ [0x0922] = "ddhadeva",
+ [0x0923] = "nnadeva",
+ [0x0924] = "tadeva",
+ [0x0925] = "thadeva",
+ [0x0926] = "dadeva",
+ [0x0927] = "dhadeva",
+ [0x0928] = "nadeva",
+ [0x0929] = "nnnadeva",
+ [0x092A] = "padeva",
+ [0x092B] = "phadeva",
+ [0x092C] = "badeva",
+ [0x092D] = "bhadeva",
+ [0x092E] = "madeva",
+ [0x092F] = "yadeva",
+ [0x0930] = "radeva",
+ [0x0931] = "rradeva",
+ [0x0932] = "ladeva",
+ [0x0933] = "lladeva",
+ [0x0934] = "llladeva",
+ [0x0935] = "vadeva",
+ [0x0936] = "shadeva",
+ [0x0937] = "ssadeva",
+ [0x0938] = "sadeva",
+ [0x0939] = "hadeva",
+ [0x093C] = "nuktadeva",
+ [0x093D] = "avagrahadeva",
+ [0x093E] = "aavowelsigndeva",
+ [0x093F] = "ivowelsigndeva",
+ [0x0940] = "iivowelsigndeva",
+ [0x0941] = "uvowelsigndeva",
+ [0x0942] = "uuvowelsigndeva",
+ [0x0943] = "rvocalicvowelsigndeva",
+ [0x0944] = "rrvocalicvowelsigndeva",
+ [0x0945] = "ecandravowelsigndeva",
+ [0x0946] = "eshortvowelsigndeva",
+ [0x0947] = "evowelsigndeva",
+ [0x0948] = "aivowelsigndeva",
+ [0x0949] = "ocandravowelsigndeva",
+ [0x094A] = "oshortvowelsigndeva",
+ [0x094B] = "ovowelsigndeva",
+ [0x094C] = "auvowelsigndeva",
+ [0x094D] = "viramadeva",
+ [0x0950] = "omdeva",
+ [0x0951] = "udattadeva",
+ [0x0952] = "anudattadeva",
+ [0x0953] = "gravedeva",
+ [0x0954] = "acutedeva",
+ [0x0958] = "qadeva",
+ [0x0959] = "khhadeva",
+ [0x095A] = "ghhadeva",
+ [0x095B] = "zadeva",
+ [0x095C] = "dddhadeva",
+ [0x095D] = "rhadeva",
+ [0x095E] = "fadeva",
+ [0x095F] = "yyadeva",
+ [0x0960] = "rrvocalicdeva",
+ [0x0961] = "llvocalicdeva",
+ [0x0962] = "lvocalicvowelsigndeva",
+ [0x0963] = "llvocalicvowelsigndeva",
+ [0x0964] = "danda",
+ [0x0965] = "dbldanda",
+ [0x0966] = "zerodeva",
+ [0x0967] = "onedeva",
+ [0x0968] = "twodeva",
+ [0x0969] = "threedeva",
+ [0x096A] = "fourdeva",
+ [0x096B] = "fivedeva",
+ [0x096C] = "sixdeva",
+ [0x096D] = "sevendeva",
+ [0x096E] = "eightdeva",
+ [0x096F] = "ninedeva",
+ [0x0970] = "abbreviationsigndeva",
+ [0x0981] = "candrabindubengali",
+ [0x0982] = "anusvarabengali",
+ [0x0983] = "visargabengali",
+ [0x0985] = "abengali",
+ [0x0986] = "aabengali",
+ [0x0987] = "ibengali",
+ [0x0988] = "iibengali",
+ [0x0989] = "ubengali",
+ [0x098A] = "uubengali",
+ [0x098B] = "rvocalicbengali",
+ [0x098C] = "lvocalicbengali",
+ [0x098F] = "ebengali",
+ [0x0990] = "aibengali",
+ [0x0993] = "obengali",
+ [0x0994] = "aubengali",
+ [0x0995] = "kabengali",
+ [0x0996] = "khabengali",
+ [0x0997] = "gabengali",
+ [0x0998] = "ghabengali",
+ [0x0999] = "ngabengali",
+ [0x099A] = "cabengali",
+ [0x099B] = "chabengali",
+ [0x099C] = "jabengali",
+ [0x099D] = "jhabengali",
+ [0x099E] = "nyabengali",
+ [0x099F] = "ttabengali",
+ [0x09A0] = "tthabengali",
+ [0x09A1] = "ddabengali",
+ [0x09A2] = "ddhabengali",
+ [0x09A3] = "nnabengali",
+ [0x09A4] = "tabengali",
+ [0x09A5] = "thabengali",
+ [0x09A6] = "dabengali",
+ [0x09A7] = "dhabengali",
+ [0x09A8] = "nabengali",
+ [0x09AA] = "pabengali",
+ [0x09AB] = "phabengali",
+ [0x09AC] = "babengali",
+ [0x09AD] = "bhabengali",
+ [0x09AE] = "mabengali",
+ [0x09AF] = "yabengali",
+ [0x09B0] = "rabengali",
+ [0x09B2] = "labengali",
+ [0x09B6] = "shabengali",
+ [0x09B7] = "ssabengali",
+ [0x09B8] = "sabengali",
+ [0x09B9] = "habengali",
+ [0x09BC] = "nuktabengali",
+ [0x09BE] = "aavowelsignbengali",
+ [0x09BF] = "ivowelsignbengali",
+ [0x09C0] = "iivowelsignbengali",
+ [0x09C1] = "uvowelsignbengali",
+ [0x09C2] = "uuvowelsignbengali",
+ [0x09C3] = "rvocalicvowelsignbengali",
+ [0x09C4] = "rrvocalicvowelsignbengali",
+ [0x09C7] = "evowelsignbengali",
+ [0x09C8] = "aivowelsignbengali",
+ [0x09CB] = "ovowelsignbengali",
+ [0x09CC] = "auvowelsignbengali",
+ [0x09CD] = "viramabengali",
+ [0x09D7] = "aulengthmarkbengali",
+ [0x09DC] = "rrabengali",
+ [0x09DD] = "rhabengali",
+ [0x09DF] = "yyabengali",
+ [0x09E0] = "rrvocalicbengali",
+ [0x09E1] = "llvocalicbengali",
+ [0x09E2] = "lvocalicvowelsignbengali",
+ [0x09E3] = "llvocalicvowelsignbengali",
+ [0x09E6] = "zerobengali",
+ [0x09E7] = "onebengali",
+ [0x09E8] = "twobengali",
+ [0x09E9] = "threebengali",
+ [0x09EA] = "fourbengali",
+ [0x09EB] = "fivebengali",
+ [0x09EC] = "sixbengali",
+ [0x09ED] = "sevenbengali",
+ [0x09EE] = "eightbengali",
+ [0x09EF] = "ninebengali",
+ [0x09F0] = "ramiddlediagonalbengali",
+ [0x09F1] = "ralowerdiagonalbengali",
+ [0x09F2] = "rupeemarkbengali",
+ [0x09F3] = "rupeesignbengali",
+ [0x09F4] = "onenumeratorbengali",
+ [0x09F5] = "twonumeratorbengali",
+ [0x09F6] = "threenumeratorbengali",
+ [0x09F7] = "fournumeratorbengali",
+ [0x09F8] = "denominatorminusonenumeratorbengali",
+ [0x09F9] = "sixteencurrencydenominatorbengali",
+ [0x09FA] = "issharbengali",
+ [0x0A02] = "bindigurmukhi",
+ [0x0A05] = "agurmukhi",
+ [0x0A06] = "aagurmukhi",
+ [0x0A07] = "igurmukhi",
+ [0x0A08] = "iigurmukhi",
+ [0x0A09] = "ugurmukhi",
+ [0x0A0A] = "uugurmukhi",
+ [0x0A0F] = "eegurmukhi",
+ [0x0A10] = "aigurmukhi",
+ [0x0A13] = "oogurmukhi",
+ [0x0A14] = "augurmukhi",
+ [0x0A15] = "kagurmukhi",
+ [0x0A16] = "khagurmukhi",
+ [0x0A17] = "gagurmukhi",
+ [0x0A18] = "ghagurmukhi",
+ [0x0A19] = "ngagurmukhi",
+ [0x0A1A] = "cagurmukhi",
+ [0x0A1B] = "chagurmukhi",
+ [0x0A1C] = "jagurmukhi",
+ [0x0A1D] = "jhagurmukhi",
+ [0x0A1E] = "nyagurmukhi",
+ [0x0A1F] = "ttagurmukhi",
+ [0x0A20] = "tthagurmukhi",
+ [0x0A21] = "ddagurmukhi",
+ [0x0A22] = "ddhagurmukhi",
+ [0x0A23] = "nnagurmukhi",
+ [0x0A24] = "tagurmukhi",
+ [0x0A25] = "thagurmukhi",
+ [0x0A26] = "dagurmukhi",
+ [0x0A27] = "dhagurmukhi",
+ [0x0A28] = "nagurmukhi",
+ [0x0A2A] = "pagurmukhi",
+ [0x0A2B] = "phagurmukhi",
+ [0x0A2C] = "bagurmukhi",
+ [0x0A2D] = "bhagurmukhi",
+ [0x0A2E] = "magurmukhi",
+ [0x0A2F] = "yagurmukhi",
+ [0x0A30] = "ragurmukhi",
+ [0x0A32] = "lagurmukhi",
+ [0x0A35] = "vagurmukhi",
+ [0x0A36] = "shagurmukhi",
+ [0x0A38] = "sagurmukhi",
+ [0x0A39] = "hagurmukhi",
+ [0x0A3C] = "nuktagurmukhi",
+ [0x0A3E] = "aamatragurmukhi",
+ [0x0A3F] = "imatragurmukhi",
+ [0x0A40] = "iimatragurmukhi",
+ [0x0A41] = "umatragurmukhi",
+ [0x0A42] = "uumatragurmukhi",
+ [0x0A47] = "eematragurmukhi",
+ [0x0A48] = "aimatragurmukhi",
+ [0x0A4B] = "oomatragurmukhi",
+ [0x0A4C] = "aumatragurmukhi",
+ [0x0A4D] = "halantgurmukhi",
+ [0x0A59] = "khhagurmukhi",
+ [0x0A5A] = "ghhagurmukhi",
+ [0x0A5B] = "zagurmukhi",
+ [0x0A5C] = "rragurmukhi",
+ [0x0A5E] = "fagurmukhi",
+ [0x0A66] = "zerogurmukhi",
+ [0x0A67] = "onegurmukhi",
+ [0x0A68] = "twogurmukhi",
+ [0x0A69] = "threegurmukhi",
+ [0x0A6A] = "fourgurmukhi",
+ [0x0A6B] = "fivegurmukhi",
+ [0x0A6C] = "sixgurmukhi",
+ [0x0A6D] = "sevengurmukhi",
+ [0x0A6E] = "eightgurmukhi",
+ [0x0A6F] = "ninegurmukhi",
+ [0x0A70] = "tippigurmukhi",
+ [0x0A71] = "addakgurmukhi",
+ [0x0A72] = "irigurmukhi",
+ [0x0A73] = "uragurmukhi",
+ [0x0A74] = "ekonkargurmukhi",
+ [0x0A81] = "candrabindugujarati",
+ [0x0A82] = "anusvaragujarati",
+ [0x0A83] = "visargagujarati",
+ [0x0A85] = "agujarati",
+ [0x0A86] = "aagujarati",
+ [0x0A87] = "igujarati",
+ [0x0A88] = "iigujarati",
+ [0x0A89] = "ugujarati",
+ [0x0A8A] = "uugujarati",
+ [0x0A8B] = "rvocalicgujarati",
+ [0x0A8D] = "ecandragujarati",
+ [0x0A8F] = "egujarati",
+ [0x0A90] = "aigujarati",
+ [0x0A91] = "ocandragujarati",
+ [0x0A93] = "ogujarati",
+ [0x0A94] = "augujarati",
+ [0x0A95] = "kagujarati",
+ [0x0A96] = "khagujarati",
+ [0x0A97] = "gagujarati",
+ [0x0A98] = "ghagujarati",
+ [0x0A99] = "ngagujarati",
+ [0x0A9A] = "cagujarati",
+ [0x0A9B] = "chagujarati",
+ [0x0A9C] = "jagujarati",
+ [0x0A9D] = "jhagujarati",
+ [0x0A9E] = "nyagujarati",
+ [0x0A9F] = "ttagujarati",
+ [0x0AA0] = "tthagujarati",
+ [0x0AA1] = "ddagujarati",
+ [0x0AA2] = "ddhagujarati",
+ [0x0AA3] = "nnagujarati",
+ [0x0AA4] = "tagujarati",
+ [0x0AA5] = "thagujarati",
+ [0x0AA6] = "dagujarati",
+ [0x0AA7] = "dhagujarati",
+ [0x0AA8] = "nagujarati",
+ [0x0AAA] = "pagujarati",
+ [0x0AAB] = "phagujarati",
+ [0x0AAC] = "bagujarati",
+ [0x0AAD] = "bhagujarati",
+ [0x0AAE] = "magujarati",
+ [0x0AAF] = "yagujarati",
+ [0x0AB0] = "ragujarati",
+ [0x0AB2] = "lagujarati",
+ [0x0AB3] = "llagujarati",
+ [0x0AB5] = "vagujarati",
+ [0x0AB6] = "shagujarati",
+ [0x0AB7] = "ssagujarati",
+ [0x0AB8] = "sagujarati",
+ [0x0AB9] = "hagujarati",
+ [0x0ABC] = "nuktagujarati",
+ [0x0ABE] = "aavowelsigngujarati",
+ [0x0ABF] = "ivowelsigngujarati",
+ [0x0AC0] = "iivowelsigngujarati",
+ [0x0AC1] = "uvowelsigngujarati",
+ [0x0AC2] = "uuvowelsigngujarati",
+ [0x0AC3] = "rvocalicvowelsigngujarati",
+ [0x0AC4] = "rrvocalicvowelsigngujarati",
+ [0x0AC5] = "ecandravowelsigngujarati",
+ [0x0AC7] = "evowelsigngujarati",
+ [0x0AC8] = "aivowelsigngujarati",
+ [0x0AC9] = "ocandravowelsigngujarati",
+ [0x0ACB] = "ovowelsigngujarati",
+ [0x0ACC] = "auvowelsigngujarati",
+ [0x0ACD] = "viramagujarati",
+ [0x0AD0] = "omgujarati",
+ [0x0AE0] = "rrvocalicgujarati",
+ [0x0AE6] = "zerogujarati",
+ [0x0AE7] = "onegujarati",
+ [0x0AE8] = "twogujarati",
+ [0x0AE9] = "threegujarati",
+ [0x0AEA] = "fourgujarati",
+ [0x0AEB] = "fivegujarati",
+ [0x0AEC] = "sixgujarati",
+ [0x0AED] = "sevengujarati",
+ [0x0AEE] = "eightgujarati",
+ [0x0AEF] = "ninegujarati",
+ [0x0E01] = "kokaithai",
+ [0x0E02] = "khokhaithai",
+ [0x0E03] = "khokhuatthai",
+ [0x0E04] = "khokhwaithai",
+ [0x0E05] = "khokhonthai",
+ [0x0E06] = "khorakhangthai",
+ [0x0E07] = "ngonguthai",
+ [0x0E08] = "chochanthai",
+ [0x0E09] = "chochingthai",
+ [0x0E0A] = "chochangthai",
+ [0x0E0B] = "sosothai",
+ [0x0E0C] = "chochoethai",
+ [0x0E0D] = "yoyingthai",
+ [0x0E0E] = "dochadathai",
+ [0x0E0F] = "topatakthai",
+ [0x0E10] = "thothanthai",
+ [0x0E11] = "thonangmonthothai",
+ [0x0E12] = "thophuthaothai",
+ [0x0E13] = "nonenthai",
+ [0x0E14] = "dodekthai",
+ [0x0E15] = "totaothai",
+ [0x0E16] = "thothungthai",
+ [0x0E17] = "thothahanthai",
+ [0x0E18] = "thothongthai",
+ [0x0E19] = "nonuthai",
+ [0x0E1A] = "bobaimaithai",
+ [0x0E1B] = "poplathai",
+ [0x0E1C] = "phophungthai",
+ [0x0E1D] = "fofathai",
+ [0x0E1E] = "phophanthai",
+ [0x0E1F] = "fofanthai",
+ [0x0E20] = "phosamphaothai",
+ [0x0E21] = "momathai",
+ [0x0E22] = "yoyakthai",
+ [0x0E23] = "roruathai",
+ [0x0E24] = "ruthai",
+ [0x0E25] = "lolingthai",
+ [0x0E26] = "luthai",
+ [0x0E27] = "wowaenthai",
+ [0x0E28] = "sosalathai",
+ [0x0E29] = "sorusithai",
+ [0x0E2A] = "sosuathai",
+ [0x0E2B] = "hohipthai",
+ [0x0E2C] = "lochulathai",
+ [0x0E2D] = "oangthai",
+ [0x0E2E] = "honokhukthai",
+ [0x0E2F] = "paiyannoithai",
+ [0x0E30] = "saraathai",
+ [0x0E31] = "maihanakatthai",
+ [0x0E32] = "saraaathai",
+ [0x0E33] = "saraamthai",
+ [0x0E34] = "saraithai",
+ [0x0E35] = "saraiithai",
+ [0x0E36] = "sarauethai",
+ [0x0E37] = "saraueethai",
+ [0x0E38] = "sarauthai",
+ [0x0E39] = "sarauuthai",
+ [0x0E3A] = "phinthuthai",
+ [0x0E3F] = "bahtthai",
+ [0x0E40] = "saraethai",
+ [0x0E41] = "saraaethai",
+ [0x0E42] = "saraothai",
+ [0x0E43] = "saraaimaimuanthai",
+ [0x0E44] = "saraaimaimalaithai",
+ [0x0E45] = "lakkhangyaothai",
+ [0x0E46] = "maiyamokthai",
+ [0x0E47] = "maitaikhuthai",
+ [0x0E48] = "maiekthai",
+ [0x0E49] = "maithothai",
+ [0x0E4A] = "maitrithai",
+ [0x0E4B] = "maichattawathai",
+ [0x0E4C] = "thanthakhatthai",
+ [0x0E4D] = "nikhahitthai",
+ [0x0E4E] = "yamakkanthai",
+ [0x0E4F] = "fongmanthai",
+ [0x0E50] = "zerothai",
+ [0x0E51] = "onethai",
+ [0x0E52] = "twothai",
+ [0x0E53] = "threethai",
+ [0x0E54] = "fourthai",
+ [0x0E55] = "fivethai",
+ [0x0E56] = "sixthai",
+ [0x0E57] = "seventhai",
+ [0x0E58] = "eightthai",
+ [0x0E59] = "ninethai",
+ [0x0E5A] = "angkhankhuthai",
+ [0x0E5B] = "khomutthai",
+ [0x1E00] = "Aringbelow",
+ [0x1E01] = "aringbelow",
+ [0x1E02] = "Bdotaccent",
+ [0x1E03] = "bdotaccent",
+ [0x1E04] = "Bdotbelow",
+ [0x1E05] = "bdotbelow",
+ [0x1E06] = "Blinebelow",
+ [0x1E07] = "blinebelow",
+ [0x1E08] = "Ccedillaacute",
+ [0x1E09] = "ccedillaacute",
+ [0x1E0A] = "Ddotaccent",
+ [0x1E0B] = "ddotaccent",
+ [0x1E0C] = "Ddotbelow",
+ [0x1E0D] = "ddotbelow",
+ [0x1E0E] = "Dlinebelow",
+ [0x1E0F] = "dlinebelow",
+ [0x1E10] = "Dcedilla",
+ [0x1E11] = "dcedilla",
+ [0x1E12] = "Dcircumflexbelow",
+ [0x1E13] = "dcircumflexbelow",
+ [0x1E14] = "Emacrongrave",
+ [0x1E15] = "emacrongrave",
+ [0x1E16] = "Emacronacute",
+ [0x1E17] = "emacronacute",
+ [0x1E18] = "Ecircumflexbelow",
+ [0x1E19] = "ecircumflexbelow",
+ [0x1E1A] = "Etildebelow",
+ [0x1E1B] = "etildebelow",
+ [0x1E1C] = "Ecedillabreve",
+ [0x1E1D] = "ecedillabreve",
+ [0x1E1E] = "Fdotaccent",
+ [0x1E1F] = "fdotaccent",
+ [0x1E20] = "Gmacron",
+ [0x1E21] = "gmacron",
+ [0x1E22] = "Hdotaccent",
+ [0x1E23] = "hdotaccent",
+ [0x1E24] = "Hdotbelow",
+ [0x1E25] = "hdotbelow",
+ [0x1E26] = "Hdieresis",
+ [0x1E27] = "hdieresis",
+ [0x1E28] = "Hcedilla",
+ [0x1E29] = "hcedilla",
+ [0x1E2A] = "Hbrevebelow",
+ [0x1E2B] = "hbrevebelow",
+ [0x1E2C] = "Itildebelow",
+ [0x1E2D] = "itildebelow",
+ [0x1E2E] = "Idieresisacute",
+ [0x1E2F] = "idieresisacute",
+ [0x1E30] = "Kacute",
+ [0x1E31] = "kacute",
+ [0x1E32] = "Kdotbelow",
+ [0x1E33] = "kdotbelow",
+ [0x1E34] = "Klinebelow",
+ [0x1E35] = "klinebelow",
+ [0x1E36] = "Ldotbelow",
+ [0x1E37] = "ldotbelow",
+ [0x1E38] = "Ldotbelowmacron",
+ [0x1E39] = "ldotbelowmacron",
+ [0x1E3A] = "Llinebelow",
+ [0x1E3B] = "llinebelow",
+ [0x1E3C] = "Lcircumflexbelow",
+ [0x1E3D] = "lcircumflexbelow",
+ [0x1E3E] = "Macute",
+ [0x1E3F] = "macute",
+ [0x1E40] = "Mdotaccent",
+ [0x1E41] = "mdotaccent",
+ [0x1E42] = "Mdotbelow",
+ [0x1E43] = "mdotbelow",
+ [0x1E44] = "Ndotaccent",
+ [0x1E45] = "ndotaccent",
+ [0x1E46] = "Ndotbelow",
+ [0x1E47] = "ndotbelow",
+ [0x1E48] = "Nlinebelow",
+ [0x1E49] = "nlinebelow",
+ [0x1E4A] = "Ncircumflexbelow",
+ [0x1E4B] = "ncircumflexbelow",
+ [0x1E4C] = "Otildeacute",
+ [0x1E4D] = "otildeacute",
+ [0x1E4E] = "Otildedieresis",
+ [0x1E4F] = "otildedieresis",
+ [0x1E50] = "Omacrongrave",
+ [0x1E51] = "omacrongrave",
+ [0x1E52] = "Omacronacute",
+ [0x1E53] = "omacronacute",
+ [0x1E54] = "Pacute",
+ [0x1E55] = "pacute",
+ [0x1E56] = "Pdotaccent",
+ [0x1E57] = "pdotaccent",
+ [0x1E58] = "Rdotaccent",
+ [0x1E59] = "rdotaccent",
+ [0x1E5A] = "Rdotbelow",
+ [0x1E5B] = "rdotbelow",
+ [0x1E5C] = "Rdotbelowmacron",
+ [0x1E5D] = "rdotbelowmacron",
+ [0x1E5E] = "Rlinebelow",
+ [0x1E5F] = "rlinebelow",
+ [0x1E60] = "Sdotaccent",
+ [0x1E61] = "sdotaccent",
+ [0x1E62] = "Sdotbelow",
+ [0x1E63] = "sdotbelow",
+ [0x1E64] = "Sacutedotaccent",
+ [0x1E65] = "sacutedotaccent",
+ [0x1E66] = "Scarondotaccent",
+ [0x1E67] = "scarondotaccent",
+ [0x1E68] = "Sdotbelowdotaccent",
+ [0x1E69] = "sdotbelowdotaccent",
+ [0x1E6A] = "Tdotaccent",
+ [0x1E6B] = "tdotaccent",
+ [0x1E6C] = "Tdotbelow",
+ [0x1E6D] = "tdotbelow",
+ [0x1E6E] = "Tlinebelow",
+ [0x1E6F] = "tlinebelow",
+ [0x1E70] = "Tcircumflexbelow",
+ [0x1E71] = "tcircumflexbelow",
+ [0x1E72] = "Udieresisbelow",
+ [0x1E73] = "udieresisbelow",
+ [0x1E74] = "Utildebelow",
+ [0x1E75] = "utildebelow",
+ [0x1E76] = "Ucircumflexbelow",
+ [0x1E77] = "ucircumflexbelow",
+ [0x1E78] = "Utildeacute",
+ [0x1E79] = "utildeacute",
+ [0x1E7A] = "Umacrondieresis",
+ [0x1E7B] = "umacrondieresis",
+ [0x1E7C] = "Vtilde",
+ [0x1E7D] = "vtilde",
+ [0x1E7E] = "Vdotbelow",
+ [0x1E7F] = "vdotbelow",
+ [0x1E80] = "Wgrave",
+ [0x1E81] = "wgrave",
+ [0x1E82] = "Wacute",
+ [0x1E83] = "wacute",
+ [0x1E84] = "Wdieresis",
+ [0x1E85] = "wdieresis",
+ [0x1E86] = "Wdotaccent",
+ [0x1E87] = "wdotaccent",
+ [0x1E88] = "Wdotbelow",
+ [0x1E89] = "wdotbelow",
+ [0x1E8A] = "Xdotaccent",
+ [0x1E8B] = "xdotaccent",
+ [0x1E8C] = "Xdieresis",
+ [0x1E8D] = "xdieresis",
+ [0x1E8E] = "Ydotaccent",
+ [0x1E8F] = "ydotaccent",
+ [0x1E90] = "Zcircumflex",
+ [0x1E91] = "zcircumflex",
+ [0x1E92] = "Zdotbelow",
+ [0x1E93] = "zdotbelow",
+ [0x1E94] = "Zlinebelow",
+ [0x1E95] = "zlinebelow",
+ [0x1E96] = "hlinebelow",
+ [0x1E97] = "tdieresis",
+ [0x1E98] = "wring",
+ [0x1E99] = "yring",
+ [0x1E9A] = "arighthalfring",
+ [0x1E9B] = "slongdotaccent",
+ [0x1EA0] = "Adotbelow",
+ [0x1EA1] = "adotbelow",
+ [0x1EA2] = "Ahookabove",
+ [0x1EA3] = "ahookabove",
+ [0x1EA4] = "Acircumflexacute",
+ [0x1EA5] = "acircumflexacute",
+ [0x1EA6] = "Acircumflexgrave",
+ [0x1EA7] = "acircumflexgrave",
+ [0x1EA8] = "Acircumflexhookabove",
+ [0x1EA9] = "acircumflexhookabove",
+ [0x1EAA] = "Acircumflextilde",
+ [0x1EAB] = "acircumflextilde",
+ [0x1EAC] = "Acircumflexdotbelow",
+ [0x1EAD] = "acircumflexdotbelow",
+ [0x1EAE] = "Abreveacute",
+ [0x1EAF] = "abreveacute",
+ [0x1EB0] = "Abrevegrave",
+ [0x1EB1] = "abrevegrave",
+ [0x1EB2] = "Abrevehookabove",
+ [0x1EB3] = "abrevehookabove",
+ [0x1EB4] = "Abrevetilde",
+ [0x1EB5] = "abrevetilde",
+ [0x1EB6] = "Abrevedotbelow",
+ [0x1EB7] = "abrevedotbelow",
+ [0x1EB8] = "Edotbelow",
+ [0x1EB9] = "edotbelow",
+ [0x1EBA] = "Ehookabove",
+ [0x1EBB] = "ehookabove",
+ [0x1EBC] = "Etilde",
+ [0x1EBD] = "etilde",
+ [0x1EBE] = "Ecircumflexacute",
+ [0x1EBF] = "ecircumflexacute",
+ [0x1EC0] = "Ecircumflexgrave",
+ [0x1EC1] = "ecircumflexgrave",
+ [0x1EC2] = "Ecircumflexhookabove",
+ [0x1EC3] = "ecircumflexhookabove",
+ [0x1EC4] = "Ecircumflextilde",
+ [0x1EC5] = "ecircumflextilde",
+ [0x1EC6] = "Ecircumflexdotbelow",
+ [0x1EC7] = "ecircumflexdotbelow",
+ [0x1EC8] = "Ihookabove",
+ [0x1EC9] = "ihookabove",
+ [0x1ECA] = "Idotbelow",
+ [0x1ECB] = "idotbelow",
+ [0x1ECC] = "Odotbelow",
+ [0x1ECD] = "odotbelow",
+ [0x1ECE] = "Ohookabove",
+ [0x1ECF] = "ohookabove",
+ [0x1ED0] = "Ocircumflexacute",
+ [0x1ED1] = "ocircumflexacute",
+ [0x1ED2] = "Ocircumflexgrave",
+ [0x1ED3] = "ocircumflexgrave",
+ [0x1ED4] = "Ocircumflexhookabove",
+ [0x1ED5] = "ocircumflexhookabove",
+ [0x1ED6] = "Ocircumflextilde",
+ [0x1ED7] = "ocircumflextilde",
+ [0x1ED8] = "Ocircumflexdotbelow",
+ [0x1ED9] = "ocircumflexdotbelow",
+ [0x1EDA] = "Ohornacute",
+ [0x1EDB] = "ohornacute",
+ [0x1EDC] = "Ohorngrave",
+ [0x1EDD] = "ohorngrave",
+ [0x1EDE] = "Ohornhookabove",
+ [0x1EDF] = "ohornhookabove",
+ [0x1EE0] = "Ohorntilde",
+ [0x1EE1] = "ohorntilde",
+ [0x1EE2] = "Ohorndotbelow",
+ [0x1EE3] = "ohorndotbelow",
+ [0x1EE4] = "Udotbelow",
+ [0x1EE5] = "udotbelow",
+ [0x1EE6] = "Uhookabove",
+ [0x1EE7] = "uhookabove",
+ [0x1EE8] = "Uhornacute",
+ [0x1EE9] = "uhornacute",
+ [0x1EEA] = "Uhorngrave",
+ [0x1EEB] = "uhorngrave",
+ [0x1EEC] = "Uhornhookabove",
+ [0x1EED] = "uhornhookabove",
+ [0x1EEE] = "Uhorntilde",
+ [0x1EEF] = "uhorntilde",
+ [0x1EF0] = "Uhorndotbelow",
+ [0x1EF1] = "uhorndotbelow",
+ [0x1EF2] = "Ygrave",
+ [0x1EF3] = "ygrave",
+ [0x1EF4] = "Ydotbelow",
+ [0x1EF5] = "ydotbelow",
+ [0x1EF6] = "Yhookabove",
+ [0x1EF7] = "yhookabove",
+ [0x1EF8] = "Ytilde",
+ [0x1EF9] = "ytilde",
+ [0x2002] = "enspace",
+ [0x200B] = "zerowidthspace",
+ [0x200C] = "zerowidthnonjoiner",
+ [0x200D] = "afii301",
+ [0x200E] = "afii299",
+ [0x200F] = "afii300",
+ [0x2010] = "hyphentwo",
+ [0x2012] = "figuredash",
+ [0x2013] = "endash",
+ [0x2014] = "emdash",
+ [0x2015] = "horizontalbar",
+ [0x2016] = "dblverticalbar",
+ [0x2017] = "underscoredbl",
+ [0x2018] = "quoteleft",
+ [0x2019] = "quoteright",
+ [0x201A] = "quotesinglbase",
+ [0x201B] = "quotereversed",
+ [0x201C] = "quotedblleft",
+ [0x201D] = "quotedblright",
+ [0x201E] = "quotedblbase",
+ [0x2020] = "dagger",
+ [0x2021] = "daggerdbl",
+ [0x2022] = "bullet",
+ [0x2024] = "onedotenleader",
+ [0x2025] = "twodotleader",
+ [0x2026] = "ellipsis",
+ [0x202C] = "afii61573",
+ [0x202D] = "afii61574",
+ [0x202E] = "afii61575",
+ [0x2030] = "perthousand",
+ [0x2032] = "minute",
+ [0x2033] = "second",
+ [0x2035] = "primereversed",
+ [0x2039] = "guilsinglleft",
+ [0x203A] = "guilsinglright",
+ [0x203B] = "referencemark",
+ [0x203C] = "exclamdbl",
+ [0x203E] = "overline",
+ [0x2042] = "asterism",
+ [0x2044] = "fraction",
+ [0x2070] = "zerosuperior",
+ [0x2074] = "foursuperior",
+ [0x2075] = "fivesuperior",
+ [0x2076] = "sixsuperior",
+ [0x2077] = "sevensuperior",
+ [0x2078] = "eightsuperior",
+ [0x2079] = "ninesuperior",
+ [0x207A] = "plussuperior",
+ [0x207C] = "equalsuperior",
+ [0x207D] = "parenleftsuperior",
+ [0x207E] = "parenrightsuperior",
+ [0x207F] = "nsuperior",
+ [0x2080] = "zeroinferior",
+ [0x2081] = "oneinferior",
+ [0x2082] = "twoinferior",
+ [0x2083] = "threeinferior",
+ [0x2084] = "fourinferior",
+ [0x2085] = "fiveinferior",
+ [0x2086] = "sixinferior",
+ [0x2087] = "seveninferior",
+ [0x2088] = "eightinferior",
+ [0x2089] = "nineinferior",
+ [0x208D] = "parenleftinferior",
+ [0x208E] = "parenrightinferior",
+ [0x20A1] = "colonsign",
+ [0x20A2] = "cruzeiro",
+ [0x20A3] = "franc",
+ [0x20A4] = "lira",
+ [0x20A7] = "peseta",
+ [0x20A9] = "won",
+ [0x20AA] = "sheqelhebrew",
+ [0x20AB] = "dong",
+ [0x20AC] = "euro",
+ [0x2103] = "centigrade",
+ [0x2105] = "careof",
+ [0x2109] = "fahrenheit",
+ [0x2111] = "Ifraktur",
+ [0x2113] = "lsquare",
+ [0x2116] = "numero",
+ [0x2118] = "weierstrass",
+ [0x211C] = "Rfraktur",
+ [0x211E] = "prescription",
+ [0x2121] = "telephone",
+ [0x2122] = "trademark",
+ [0x2126] = "Omega",
+ [0x212B] = "angstrom",
+ [0x212E] = "estimated",
+ [0x2135] = "aleph",
+ [0x2153] = "onethird",
+ [0x2154] = "twothirds",
+ [0x215B] = "oneeighth",
+ [0x215C] = "threeeighths",
+ [0x215D] = "fiveeighths",
+ [0x215E] = "seveneighths",
+ [0x2160] = "Oneroman",
+ [0x2161] = "Tworoman",
+ [0x2162] = "Threeroman",
+ [0x2163] = "Fourroman",
+ [0x2164] = "Fiveroman",
+ [0x2165] = "Sixroman",
+ [0x2166] = "Sevenroman",
+ [0x2167] = "Eightroman",
+ [0x2168] = "Nineroman",
+ [0x2169] = "Tenroman",
+ [0x216A] = "Elevenroman",
+ [0x216B] = "Twelveroman",
+ [0x2170] = "oneroman",
+ [0x2171] = "tworoman",
+ [0x2172] = "threeroman",
+ [0x2173] = "fourroman",
+ [0x2174] = "fiveroman",
+ [0x2175] = "sixroman",
+ [0x2176] = "sevenroman",
+ [0x2177] = "eightroman",
+ [0x2178] = "nineroman",
+ [0x2179] = "tenroman",
+ [0x217A] = "elevenroman",
+ [0x217B] = "twelveroman",
+ [0x2190] = "arrowleft",
+ [0x2191] = "arrowup",
+ [0x2192] = "arrowright",
+ [0x2193] = "arrowdown",
+ [0x2194] = "arrowboth",
+ [0x2195] = "arrowupdn",
+ [0x2196] = "arrowupleft",
+ [0x2197] = "arrowupright",
+ [0x2198] = "arrowdownright",
+ [0x2199] = "arrowdownleft",
+ [0x21A8] = "arrowupdownbase",
+ [0x21B5] = "carriagereturn",
+ [0x21BC] = "harpoonleftbarbup",
+ [0x21C0] = "harpoonrightbarbup",
+ [0x21C4] = "arrowrightoverleft",
+ [0x21C5] = "arrowupleftofdown",
+ [0x21C6] = "arrowleftoverright",
+ [0x21CD] = "arrowleftdblstroke",
+ [0x21CF] = "arrowrightdblstroke",
+ [0x21D0] = "arrowleftdbl",
+ [0x21D1] = "arrowdblup",
+ [0x21D2] = "dblarrowright",
+ [0x21D3] = "arrowdbldown",
+ [0x21D4] = "dblarrowleft",
+ [0x21DE] = "pageup",
+ [0x21DF] = "pagedown",
+ [0x21E0] = "arrowdashleft",
+ [0x21E1] = "arrowdashup",
+ [0x21E2] = "arrowdashright",
+ [0x21E3] = "arrowdashdown",
+ [0x21E4] = "arrowtableft",
+ [0x21E5] = "arrowtabright",
+ [0x21E6] = "arrowleftwhite",
+ [0x21E7] = "arrowupwhite",
+ [0x21E8] = "arrowrightwhite",
+ [0x21E9] = "arrowdownwhite",
+ [0x21EA] = "capslock",
+ [0x2200] = "universal",
+ [0x2202] = "partialdiff",
+ [0x2203] = "thereexists",
+ [0x2205] = "emptyset",
+ [0x2206] = "increment",
+ [0x2207] = "nabla",
+ [0x2208] = "element",
+ [0x2209] = "notelementof",
+ [0x220B] = "suchthat",
+ [0x220C] = "notcontains",
+ [0x220F] = "product",
+ [0x2211] = "summation",
+ [0x2212] = "minus",
+ [0x2213] = "minusplus",
+ [0x2215] = "divisionslash",
+ [0x2217] = "asteriskmath",
+ [0x2219] = "bulletoperator",
+ [0x221A] = "radical",
+ [0x221D] = "proportional",
+ [0x221E] = "infinity",
+ [0x221F] = "rightangle",
+ [0x2220] = "angle",
+ [0x2223] = "divides",
+ [0x2225] = "parallel",
+ [0x2226] = "notparallel",
+ [0x2227] = "logicaland",
+ [0x2228] = "logicalor",
+ [0x2229] = "intersection",
+ [0x222A] = "union",
+ [0x222B] = "integral",
+ [0x222C] = "dblintegral",
+ [0x222E] = "contourintegral",
+ [0x2234] = "therefore",
+ [0x2235] = "because",
+ [0x2236] = "ratio",
+ [0x2237] = "proportion",
+ [0x223C] = "tildeoperator",
+ [0x223D] = "reversedtilde",
+ [0x2243] = "asymptoticallyequal",
+ [0x2245] = "congruent",
+ [0x2248] = "approxequal",
+ [0x224C] = "allequal",
+ [0x2250] = "approaches",
+ [0x2251] = "geometricallyequal",
+ [0x2252] = "approxequalorimage",
+ [0x2253] = "imageorapproximatelyequal",
+ [0x2260] = "notequal",
+ [0x2261] = "equivalence",
+ [0x2262] = "notidentical",
+ [0x2264] = "lessequal",
+ [0x2265] = "greaterequal",
+ [0x2266] = "lessoverequal",
+ [0x2267] = "greateroverequal",
+ [0x226A] = "muchless",
+ [0x226B] = "muchgreater",
+ [0x226E] = "notless",
+ [0x226F] = "notgreater",
+ [0x2270] = "notlessnorequal",
+ [0x2271] = "notgreaternorequal",
+ [0x2272] = "lessorequivalent",
+ [0x2273] = "greaterorequivalent",
+ [0x2276] = "lessorgreater",
+ [0x2277] = "greaterorless",
+ [0x2279] = "notgreaternorless",
+ [0x227A] = "precedes",
+ [0x227B] = "succeeds",
+ [0x2280] = "notprecedes",
+ [0x2281] = "notsucceeds",
+ [0x2282] = "subset",
+ [0x2283] = "superset",
+ [0x2284] = "notsubset",
+ [0x2285] = "notsuperset",
+ [0x2286] = "subsetorequal",
+ [0x2287] = "supersetorequal",
+ [0x228A] = "subsetnotequal",
+ [0x228B] = "supersetnotequal",
+ [0x2295] = "pluscircle",
+ [0x2296] = "minuscircle",
+ [0x2297] = "timescircle",
+ [0x2299] = "circleot",
+ [0x22A3] = "tackleft",
+ [0x22A4] = "tackdown",
+ [0x22A5] = "perpendicular",
+ [0x22BF] = "righttriangle",
+ [0x22C5] = "dotmath",
+ [0x22CE] = "curlyor",
+ [0x22CF] = "curlyand",
+ [0x22DA] = "lessequalorgreater",
+ [0x22DB] = "greaterequalorless",
+ [0x22EE] = "ellipsisvertical",
+ [0x2302] = "house",
+ [0x2303] = "control",
+ [0x2305] = "projective",
+ [0x2310] = "revlogicalnot",
+ [0x2312] = "arc",
+ [0x2318] = "propellor",
+ [0x2320] = "integraltp",
+ [0x2321] = "integralbt",
+ [0x2325] = "option",
+ [0x2326] = "deleteright",
+ [0x2327] = "clear",
+ [0x2329] = "angleleft",
+ [0x232A] = "angleright",
+ [0x232B] = "deleteleft",
+ [0x2423] = "blank",
+ [0x2460] = "onecircle",
+ [0x2461] = "twocircle",
+ [0x2462] = "threecircle",
+ [0x2463] = "fourcircle",
+ [0x2464] = "fivecircle",
+ [0x2465] = "sixcircle",
+ [0x2466] = "sevencircle",
+ [0x2467] = "eightcircle",
+ [0x2468] = "ninecircle",
+ [0x2469] = "tencircle",
+ [0x246A] = "elevencircle",
+ [0x246B] = "twelvecircle",
+ [0x246C] = "thirteencircle",
+ [0x246D] = "fourteencircle",
+ [0x246E] = "fifteencircle",
+ [0x246F] = "sixteencircle",
+ [0x2470] = "seventeencircle",
+ [0x2471] = "eighteencircle",
+ [0x2472] = "nineteencircle",
+ [0x2473] = "twentycircle",
+ [0x2474] = "oneparen",
+ [0x2475] = "twoparen",
+ [0x2476] = "threeparen",
+ [0x2477] = "fourparen",
+ [0x2478] = "fiveparen",
+ [0x2479] = "sixparen",
+ [0x247A] = "sevenparen",
+ [0x247B] = "eightparen",
+ [0x247C] = "nineparen",
+ [0x247D] = "tenparen",
+ [0x247E] = "elevenparen",
+ [0x247F] = "twelveparen",
+ [0x2480] = "thirteenparen",
+ [0x2481] = "fourteenparen",
+ [0x2482] = "fifteenparen",
+ [0x2483] = "sixteenparen",
+ [0x2484] = "seventeenparen",
+ [0x2485] = "eighteenparen",
+ [0x2486] = "nineteenparen",
+ [0x2487] = "twentyparen",
+ [0x2488] = "oneperiod",
+ [0x2489] = "twoperiod",
+ [0x248A] = "threeperiod",
+ [0x248B] = "fourperiod",
+ [0x248C] = "fiveperiod",
+ [0x248D] = "sixperiod",
+ [0x248E] = "sevenperiod",
+ [0x248F] = "eightperiod",
+ [0x2490] = "nineperiod",
+ [0x2491] = "tenperiod",
+ [0x2492] = "elevenperiod",
+ [0x2493] = "twelveperiod",
+ [0x2494] = "thirteenperiod",
+ [0x2495] = "fourteenperiod",
+ [0x2496] = "fifteenperiod",
+ [0x2497] = "sixteenperiod",
+ [0x2498] = "seventeenperiod",
+ [0x2499] = "eighteenperiod",
+ [0x249A] = "nineteenperiod",
+ [0x249B] = "twentyperiod",
+ [0x249C] = "aparen",
+ [0x249D] = "bparen",
+ [0x249E] = "cparen",
+ [0x249F] = "dparen",
+ [0x24A0] = "eparen",
+ [0x24A1] = "fparen",
+ [0x24A2] = "gparen",
+ [0x24A3] = "hparen",
+ [0x24A4] = "iparen",
+ [0x24A5] = "jparen",
+ [0x24A6] = "kparen",
+ [0x24A7] = "lparen",
+ [0x24A8] = "mparen",
+ [0x24A9] = "nparen",
+ [0x24AA] = "oparen",
+ [0x24AB] = "pparen",
+ [0x24AC] = "qparen",
+ [0x24AD] = "rparen",
+ [0x24AE] = "sparen",
+ [0x24AF] = "tparen",
+ [0x24B0] = "uparen",
+ [0x24B1] = "vparen",
+ [0x24B2] = "wparen",
+ [0x24B3] = "xparen",
+ [0x24B4] = "yparen",
+ [0x24B5] = "zparen",
+ [0x24B6] = "Acircle",
+ [0x24B7] = "Bcircle",
+ [0x24B8] = "Ccircle",
+ [0x24B9] = "Dcircle",
+ [0x24BA] = "Ecircle",
+ [0x24BB] = "Fcircle",
+ [0x24BC] = "Gcircle",
+ [0x24BD] = "Hcircle",
+ [0x24BE] = "Icircle",
+ [0x24BF] = "Jcircle",
+ [0x24C0] = "Kcircle",
+ [0x24C1] = "Lcircle",
+ [0x24C2] = "Mcircle",
+ [0x24C3] = "Ncircle",
+ [0x24C4] = "Ocircle",
+ [0x24C5] = "Pcircle",
+ [0x24C6] = "Qcircle",
+ [0x24C7] = "Rcircle",
+ [0x24C8] = "Scircle",
+ [0x24C9] = "Tcircle",
+ [0x24CA] = "Ucircle",
+ [0x24CB] = "Vcircle",
+ [0x24CC] = "Wcircle",
+ [0x24CD] = "Xcircle",
+ [0x24CE] = "Ycircle",
+ [0x24CF] = "Zcircle",
+ [0x24D0] = "acircle",
+ [0x24D1] = "bcircle",
+ [0x24D2] = "ccircle",
+ [0x24D3] = "dcircle",
+ [0x24D4] = "ecircle",
+ [0x24D5] = "fcircle",
+ [0x24D6] = "gcircle",
+ [0x24D7] = "hcircle",
+ [0x24D8] = "icircle",
+ [0x24D9] = "jcircle",
+ [0x24DA] = "kcircle",
+ [0x24DB] = "lcircle",
+ [0x24DC] = "mcircle",
+ [0x24DD] = "ncircle",
+ [0x24DE] = "ocircle",
+ [0x24DF] = "pcircle",
+ [0x24E0] = "qcircle",
+ [0x24E1] = "rcircle",
+ [0x24E2] = "scircle",
+ [0x24E3] = "tcircle",
+ [0x24E4] = "ucircle",
+ [0x24E5] = "vcircle",
+ [0x24E6] = "wcircle",
+ [0x24E7] = "xcircle",
+ [0x24E8] = "ycircle",
+ [0x24E9] = "zcircle",
+ [0x2500] = "SF100000",
+ [0x2502] = "SF110000",
+ [0x250C] = "SF010000",
+ [0x2510] = "SF030000",
+ [0x2514] = "SF020000",
+ [0x2518] = "SF040000",
+ [0x251C] = "SF080000",
+ [0x2524] = "SF090000",
+ [0x252C] = "SF060000",
+ [0x2534] = "SF070000",
+ [0x253C] = "SF050000",
+ [0x2550] = "SF430000",
+ [0x2551] = "SF240000",
+ [0x2552] = "SF510000",
+ [0x2553] = "SF520000",
+ [0x2554] = "SF390000",
+ [0x2555] = "SF220000",
+ [0x2556] = "SF210000",
+ [0x2557] = "SF250000",
+ [0x2558] = "SF500000",
+ [0x2559] = "SF490000",
+ [0x255A] = "SF380000",
+ [0x255B] = "SF280000",
+ [0x255C] = "SF270000",
+ [0x255D] = "SF260000",
+ [0x255E] = "SF360000",
+ [0x255F] = "SF370000",
+ [0x2560] = "SF420000",
+ [0x2561] = "SF190000",
+ [0x2562] = "SF200000",
+ [0x2563] = "SF230000",
+ [0x2564] = "SF470000",
+ [0x2565] = "SF480000",
+ [0x2566] = "SF410000",
+ [0x2567] = "SF450000",
+ [0x2568] = "SF460000",
+ [0x2569] = "SF400000",
+ [0x256A] = "SF540000",
+ [0x256B] = "SF530000",
+ [0x256C] = "SF440000",
+ [0x2580] = "upblock",
+ [0x2584] = "dnblock",
+ [0x2588] = "block",
+ [0x258C] = "lfblock",
+ [0x2590] = "rtblock",
+ [0x2591] = "shadelight",
+ [0x2592] = "shademedium",
+ [0x2593] = "shadedark",
+ [0x25A0] = "filledbox",
+ [0x25A1] = "whitesquare",
+ [0x25A3] = "squarewhitewithsmallblack",
+ [0x25A4] = "squarehorizontalfill",
+ [0x25A5] = "squareverticalfill",
+ [0x25A6] = "squareorthogonalcrosshatchfill",
+ [0x25A7] = "squareupperlefttolowerrightfill",
+ [0x25A8] = "squareupperrighttolowerleftfill",
+ [0x25A9] = "squarediagonalcrosshatchfill",
+ [0x25AA] = "blacksmallsquare",
+ [0x25AB] = "whitesmallsquare",
+ [0x25AC] = "filledrect",
+ [0x25B2] = "triagup",
+ [0x25B3] = "whiteuppointingtriangle",
+ [0x25B4] = "blackuppointingsmalltriangle",
+ [0x25B5] = "whiteuppointingsmalltriangle",
+ [0x25B6] = "blackrightpointingtriangle",
+ [0x25B7] = "whiterightpointingtriangle",
+ [0x25B9] = "whiterightpointingsmalltriangle",
+ [0x25BA] = "triagrt",
+ [0x25BC] = "triagdn",
+ [0x25BD] = "whitedownpointingtriangle",
+ [0x25BF] = "whitedownpointingsmalltriangle",
+ [0x25C0] = "blackleftpointingtriangle",
+ [0x25C1] = "whiteleftpointingtriangle",
+ [0x25C3] = "whiteleftpointingsmalltriangle",
+ [0x25C4] = "triaglf",
+ [0x25C6] = "blackdiamond",
+ [0x25C7] = "whitediamond",
+ [0x25C8] = "whitediamondcontainingblacksmalldiamond",
+ [0x25C9] = "fisheye",
+ [0x25CA] = "lozenge",
+ [0x25CB] = "whitecircle",
+ [0x25CC] = "dottedcircle",
+ [0x25CE] = "bullseye",
+ [0x25CF] = "blackcircle",
+ [0x25D0] = "circlewithlefthalfblack",
+ [0x25D1] = "circlewithrighthalfblack",
+ [0x25D8] = "invbullet",
+ [0x25D9] = "whitecircleinverse",
+ [0x25E2] = "blacklowerrighttriangle",
+ [0x25E3] = "blacklowerlefttriangle",
+ [0x25E4] = "blackupperlefttriangle",
+ [0x25E5] = "blackupperrighttriangle",
+ [0x25E6] = "whitebullet",
+ [0x25EF] = "largecircle",
+ [0x2605] = "blackstar",
+ [0x2606] = "whitestar",
+ [0x260E] = "telephoneblack",
+ [0x260F] = "whitetelephone",
+ [0x261C] = "pointingindexleftwhite",
+ [0x261D] = "pointingindexupwhite",
+ [0x261E] = "pointingindexrightwhite",
+ [0x261F] = "pointingindexdownwhite",
+ [0x262F] = "yinyang",
+ [0x263A] = "whitesmilingface",
+ [0x263B] = "invsmileface",
+ [0x263C] = "sun",
+ [0x2640] = "venus",
+ [0x2641] = "earth",
+ [0x2642] = "mars",
+ [0x2660] = "spadesuitblack",
+ [0x2661] = "heartsuitwhite",
+ [0x2662] = "diamondsuitwhite",
+ [0x2663] = "clubsuitblack",
+ [0x2664] = "spadesuitwhite",
+ [0x2665] = "heartsuitblack",
+ [0x2666] = "diamond",
+ [0x2667] = "clubsuitwhite",
+ [0x2668] = "hotsprings",
+ [0x2669] = "quarternote",
+ [0x266A] = "musicalnote",
+ [0x266B] = "musicalnotedbl",
+ [0x266C] = "beamedsixteenthnotes",
+ [0x266D] = "musicflatsign",
+ [0x266F] = "musicsharpsign",
+ [0x2713] = "checkmark",
+ [0x278A] = "onecircleinversesansserif",
+ [0x278B] = "twocircleinversesansserif",
+ [0x278C] = "threecircleinversesansserif",
+ [0x278D] = "fourcircleinversesansserif",
+ [0x278E] = "fivecircleinversesansserif",
+ [0x278F] = "sixcircleinversesansserif",
+ [0x2790] = "sevencircleinversesansserif",
+ [0x2791] = "eightcircleinversesansserif",
+ [0x2792] = "ninecircleinversesansserif",
+ [0x279E] = "arrowrightheavy",
+ [0x3000] = "ideographicspace",
+ [0x3001] = "ideographiccomma",
+ [0x3002] = "ideographicperiod",
+ [0x3003] = "dittomark",
+ [0x3004] = "jis",
+ [0x3005] = "ideographiciterationmark",
+ [0x3006] = "ideographicclose",
+ [0x3007] = "ideographiczero",
+ [0x3008] = "anglebracketleft",
+ [0x3009] = "anglebracketright",
+ [0x300A] = "dblanglebracketleft",
+ [0x300B] = "dblanglebracketright",
+ [0x300C] = "cornerbracketleft",
+ [0x300D] = "cornerbracketright",
+ [0x300E] = "whitecornerbracketleft",
+ [0x300F] = "whitecornerbracketright",
+ [0x3010] = "blacklenticularbracketleft",
+ [0x3011] = "blacklenticularbracketright",
+ [0x3012] = "postalmark",
+ [0x3013] = "getamark",
+ [0x3014] = "tortoiseshellbracketleft",
+ [0x3015] = "tortoiseshellbracketright",
+ [0x3016] = "whitelenticularbracketleft",
+ [0x3017] = "whitelenticularbracketright",
+ [0x3018] = "whitetortoiseshellbracketleft",
+ [0x3019] = "whitetortoiseshellbracketright",
+ [0x301C] = "wavedash",
+ [0x301D] = "quotedblprimereversed",
+ [0x301E] = "quotedblprime",
+ [0x3020] = "postalmarkface",
+ [0x3021] = "onehangzhou",
+ [0x3022] = "twohangzhou",
+ [0x3023] = "threehangzhou",
+ [0x3024] = "fourhangzhou",
+ [0x3025] = "fivehangzhou",
+ [0x3026] = "sixhangzhou",
+ [0x3027] = "sevenhangzhou",
+ [0x3028] = "eighthangzhou",
+ [0x3029] = "ninehangzhou",
+ [0x3036] = "circlepostalmark",
+ [0x3041] = "asmallhiragana",
+ [0x3042] = "ahiragana",
+ [0x3043] = "ismallhiragana",
+ [0x3044] = "ihiragana",
+ [0x3045] = "usmallhiragana",
+ [0x3046] = "uhiragana",
+ [0x3047] = "esmallhiragana",
+ [0x3048] = "ehiragana",
+ [0x3049] = "osmallhiragana",
+ [0x304A] = "ohiragana",
+ [0x304B] = "kahiragana",
+ [0x304C] = "gahiragana",
+ [0x304D] = "kihiragana",
+ [0x304E] = "gihiragana",
+ [0x304F] = "kuhiragana",
+ [0x3050] = "guhiragana",
+ [0x3051] = "kehiragana",
+ [0x3052] = "gehiragana",
+ [0x3053] = "kohiragana",
+ [0x3054] = "gohiragana",
+ [0x3055] = "sahiragana",
+ [0x3056] = "zahiragana",
+ [0x3057] = "sihiragana",
+ [0x3058] = "zihiragana",
+ [0x3059] = "suhiragana",
+ [0x305A] = "zuhiragana",
+ [0x305B] = "sehiragana",
+ [0x305C] = "zehiragana",
+ [0x305D] = "sohiragana",
+ [0x305E] = "zohiragana",
+ [0x305F] = "tahiragana",
+ [0x3060] = "dahiragana",
+ [0x3061] = "tihiragana",
+ [0x3062] = "dihiragana",
+ [0x3063] = "tusmallhiragana",
+ [0x3064] = "tuhiragana",
+ [0x3065] = "duhiragana",
+ [0x3066] = "tehiragana",
+ [0x3067] = "dehiragana",
+ [0x3068] = "tohiragana",
+ [0x3069] = "dohiragana",
+ [0x306A] = "nahiragana",
+ [0x306B] = "nihiragana",
+ [0x306C] = "nuhiragana",
+ [0x306D] = "nehiragana",
+ [0x306E] = "nohiragana",
+ [0x306F] = "hahiragana",
+ [0x3070] = "bahiragana",
+ [0x3071] = "pahiragana",
+ [0x3072] = "hihiragana",
+ [0x3073] = "bihiragana",
+ [0x3074] = "pihiragana",
+ [0x3075] = "huhiragana",
+ [0x3076] = "buhiragana",
+ [0x3077] = "puhiragana",
+ [0x3078] = "hehiragana",
+ [0x3079] = "behiragana",
+ [0x307A] = "pehiragana",
+ [0x307B] = "hohiragana",
+ [0x307C] = "bohiragana",
+ [0x307D] = "pohiragana",
+ [0x307E] = "mahiragana",
+ [0x307F] = "mihiragana",
+ [0x3080] = "muhiragana",
+ [0x3081] = "mehiragana",
+ [0x3082] = "mohiragana",
+ [0x3083] = "yasmallhiragana",
+ [0x3084] = "yahiragana",
+ [0x3085] = "yusmallhiragana",
+ [0x3086] = "yuhiragana",
+ [0x3087] = "yosmallhiragana",
+ [0x3088] = "yohiragana",
+ [0x3089] = "rahiragana",
+ [0x308A] = "rihiragana",
+ [0x308B] = "ruhiragana",
+ [0x308C] = "rehiragana",
+ [0x308D] = "rohiragana",
+ [0x308E] = "wasmallhiragana",
+ [0x308F] = "wahiragana",
+ [0x3090] = "wihiragana",
+ [0x3091] = "wehiragana",
+ [0x3092] = "wohiragana",
+ [0x3093] = "nhiragana",
+ [0x3094] = "vuhiragana",
+ [0x309B] = "voicedmarkkana",
+ [0x309C] = "semivoicedmarkkana",
+ [0x309D] = "iterationhiragana",
+ [0x309E] = "voicediterationhiragana",
+ [0x30A1] = "asmallkatakana",
+ [0x30A2] = "akatakana",
+ [0x30A3] = "ismallkatakana",
+ [0x30A4] = "ikatakana",
+ [0x30A5] = "usmallkatakana",
+ [0x30A6] = "ukatakana",
+ [0x30A7] = "esmallkatakana",
+ [0x30A8] = "ekatakana",
+ [0x30A9] = "osmallkatakana",
+ [0x30AA] = "okatakana",
+ [0x30AB] = "kakatakana",
+ [0x30AC] = "gakatakana",
+ [0x30AD] = "kikatakana",
+ [0x30AE] = "gikatakana",
+ [0x30AF] = "kukatakana",
+ [0x30B0] = "gukatakana",
+ [0x30B1] = "kekatakana",
+ [0x30B2] = "gekatakana",
+ [0x30B3] = "kokatakana",
+ [0x30B4] = "gokatakana",
+ [0x30B5] = "sakatakana",
+ [0x30B6] = "zakatakana",
+ [0x30B7] = "sikatakana",
+ [0x30B8] = "zikatakana",
+ [0x30B9] = "sukatakana",
+ [0x30BA] = "zukatakana",
+ [0x30BB] = "sekatakana",
+ [0x30BC] = "zekatakana",
+ [0x30BD] = "sokatakana",
+ [0x30BE] = "zokatakana",
+ [0x30BF] = "takatakana",
+ [0x30C0] = "dakatakana",
+ [0x30C1] = "tikatakana",
+ [0x30C2] = "dikatakana",
+ [0x30C3] = "tusmallkatakana",
+ [0x30C4] = "tukatakana",
+ [0x30C5] = "dukatakana",
+ [0x30C6] = "tekatakana",
+ [0x30C7] = "dekatakana",
+ [0x30C8] = "tokatakana",
+ [0x30C9] = "dokatakana",
+ [0x30CA] = "nakatakana",
+ [0x30CB] = "nikatakana",
+ [0x30CC] = "nukatakana",
+ [0x30CD] = "nekatakana",
+ [0x30CE] = "nokatakana",
+ [0x30CF] = "hakatakana",
+ [0x30D0] = "bakatakana",
+ [0x30D1] = "pakatakana",
+ [0x30D2] = "hikatakana",
+ [0x30D3] = "bikatakana",
+ [0x30D4] = "pikatakana",
+ [0x30D5] = "hukatakana",
+ [0x30D6] = "bukatakana",
+ [0x30D7] = "pukatakana",
+ [0x30D8] = "hekatakana",
+ [0x30D9] = "bekatakana",
+ [0x30DA] = "pekatakana",
+ [0x30DB] = "hokatakana",
+ [0x30DC] = "bokatakana",
+ [0x30DD] = "pokatakana",
+ [0x30DE] = "makatakana",
+ [0x30DF] = "mikatakana",
+ [0x30E0] = "mukatakana",
+ [0x30E1] = "mekatakana",
+ [0x30E2] = "mokatakana",
+ [0x30E3] = "yasmallkatakana",
+ [0x30E4] = "yakatakana",
+ [0x30E5] = "yusmallkatakana",
+ [0x30E6] = "yukatakana",
+ [0x30E7] = "yosmallkatakana",
+ [0x30E8] = "yokatakana",
+ [0x30E9] = "rakatakana",
+ [0x30EA] = "rikatakana",
+ [0x30EB] = "rukatakana",
+ [0x30EC] = "rekatakana",
+ [0x30ED] = "rokatakana",
+ [0x30EE] = "wasmallkatakana",
+ [0x30EF] = "wakatakana",
+ [0x30F0] = "wikatakana",
+ [0x30F1] = "wekatakana",
+ [0x30F2] = "wokatakana",
+ [0x30F3] = "nkatakana",
+ [0x30F4] = "vukatakana",
+ [0x30F5] = "kasmallkatakana",
+ [0x30F6] = "kesmallkatakana",
+ [0x30F7] = "vakatakana",
+ [0x30F8] = "vikatakana",
+ [0x30F9] = "vekatakana",
+ [0x30FA] = "vokatakana",
+ [0x30FB] = "dotkatakana",
+ [0x30FC] = "prolongedkana",
+ [0x30FD] = "iterationkatakana",
+ [0x30FE] = "voicediterationkatakana",
+ [0x3105] = "bbopomofo",
+ [0x3106] = "pbopomofo",
+ [0x3107] = "mbopomofo",
+ [0x3108] = "fbopomofo",
+ [0x3109] = "dbopomofo",
+ [0x310A] = "tbopomofo",
+ [0x310B] = "nbopomofo",
+ [0x310C] = "lbopomofo",
+ [0x310D] = "gbopomofo",
+ [0x310E] = "kbopomofo",
+ [0x310F] = "hbopomofo",
+ [0x3110] = "jbopomofo",
+ [0x3111] = "qbopomofo",
+ [0x3112] = "xbopomofo",
+ [0x3113] = "zhbopomofo",
+ [0x3114] = "chbopomofo",
+ [0x3115] = "shbopomofo",
+ [0x3116] = "rbopomofo",
+ [0x3117] = "zbopomofo",
+ [0x3118] = "cbopomofo",
+ [0x3119] = "sbopomofo",
+ [0x311A] = "abopomofo",
+ [0x311B] = "obopomofo",
+ [0x311C] = "ebopomofo",
+ [0x311D] = "ehbopomofo",
+ [0x311E] = "aibopomofo",
+ [0x311F] = "eibopomofo",
+ [0x3120] = "aubopomofo",
+ [0x3121] = "oubopomofo",
+ [0x3122] = "anbopomofo",
+ [0x3123] = "enbopomofo",
+ [0x3124] = "angbopomofo",
+ [0x3125] = "engbopomofo",
+ [0x3126] = "erbopomofo",
+ [0x3127] = "ibopomofo",
+ [0x3128] = "ubopomofo",
+ [0x3129] = "iubopomofo",
+ [0x3131] = "kiyeokkorean",
+ [0x3132] = "ssangkiyeokkorean",
+ [0x3133] = "kiyeoksioskorean",
+ [0x3134] = "nieunkorean",
+ [0x3135] = "nieuncieuckorean",
+ [0x3136] = "nieunhieuhkorean",
+ [0x3137] = "tikeutkorean",
+ [0x3138] = "ssangtikeutkorean",
+ [0x3139] = "rieulkorean",
+ [0x313A] = "rieulkiyeokkorean",
+ [0x313B] = "rieulmieumkorean",
+ [0x313C] = "rieulpieupkorean",
+ [0x313D] = "rieulsioskorean",
+ [0x313E] = "rieulthieuthkorean",
+ [0x313F] = "rieulphieuphkorean",
+ [0x3140] = "rieulhieuhkorean",
+ [0x3141] = "mieumkorean",
+ [0x3142] = "pieupkorean",
+ [0x3143] = "ssangpieupkorean",
+ [0x3144] = "pieupsioskorean",
+ [0x3145] = "sioskorean",
+ [0x3146] = "ssangsioskorean",
+ [0x3147] = "ieungkorean",
+ [0x3148] = "cieuckorean",
+ [0x3149] = "ssangcieuckorean",
+ [0x314A] = "chieuchkorean",
+ [0x314B] = "khieukhkorean",
+ [0x314C] = "thieuthkorean",
+ [0x314D] = "phieuphkorean",
+ [0x314E] = "hieuhkorean",
+ [0x314F] = "akorean",
+ [0x3150] = "aekorean",
+ [0x3151] = "yakorean",
+ [0x3152] = "yaekorean",
+ [0x3153] = "eokorean",
+ [0x3154] = "ekorean",
+ [0x3155] = "yeokorean",
+ [0x3156] = "yekorean",
+ [0x3157] = "okorean",
+ [0x3158] = "wakorean",
+ [0x3159] = "waekorean",
+ [0x315A] = "oekorean",
+ [0x315B] = "yokorean",
+ [0x315C] = "ukorean",
+ [0x315D] = "weokorean",
+ [0x315E] = "wekorean",
+ [0x315F] = "wikorean",
+ [0x3160] = "yukorean",
+ [0x3161] = "eukorean",
+ [0x3162] = "yikorean",
+ [0x3163] = "ikorean",
+ [0x3164] = "hangulfiller",
+ [0x3165] = "ssangnieunkorean",
+ [0x3166] = "nieuntikeutkorean",
+ [0x3167] = "nieunsioskorean",
+ [0x3168] = "nieunpansioskorean",
+ [0x3169] = "rieulkiyeoksioskorean",
+ [0x316A] = "rieultikeutkorean",
+ [0x316B] = "rieulpieupsioskorean",
+ [0x316C] = "rieulpansioskorean",
+ [0x316D] = "rieulyeorinhieuhkorean",
+ [0x316E] = "mieumpieupkorean",
+ [0x316F] = "mieumsioskorean",
+ [0x3170] = "mieumpansioskorean",
+ [0x3171] = "kapyeounmieumkorean",
+ [0x3172] = "pieupkiyeokkorean",
+ [0x3173] = "pieuptikeutkorean",
+ [0x3174] = "pieupsioskiyeokkorean",
+ [0x3175] = "pieupsiostikeutkorean",
+ [0x3176] = "pieupcieuckorean",
+ [0x3177] = "pieupthieuthkorean",
+ [0x3178] = "kapyeounpieupkorean",
+ [0x3179] = "kapyeounssangpieupkorean",
+ [0x317A] = "sioskiyeokkorean",
+ [0x317B] = "siosnieunkorean",
+ [0x317C] = "siostikeutkorean",
+ [0x317D] = "siospieupkorean",
+ [0x317E] = "sioscieuckorean",
+ [0x317F] = "pansioskorean",
+ [0x3180] = "ssangieungkorean",
+ [0x3181] = "yesieungkorean",
+ [0x3182] = "yesieungsioskorean",
+ [0x3183] = "yesieungpansioskorean",
+ [0x3184] = "kapyeounphieuphkorean",
+ [0x3185] = "ssanghieuhkorean",
+ [0x3186] = "yeorinhieuhkorean",
+ [0x3187] = "yoyakorean",
+ [0x3188] = "yoyaekorean",
+ [0x3189] = "yoikorean",
+ [0x318A] = "yuyeokorean",
+ [0x318B] = "yuyekorean",
+ [0x318C] = "yuikorean",
+ [0x318D] = "araeakorean",
+ [0x318E] = "araeaekorean",
+ [0x3200] = "kiyeokparenkorean",
+ [0x3201] = "nieunparenkorean",
+ [0x3202] = "tikeutparenkorean",
+ [0x3203] = "rieulparenkorean",
+ [0x3204] = "mieumparenkorean",
+ [0x3205] = "pieupparenkorean",
+ [0x3206] = "siosparenkorean",
+ [0x3207] = "ieungparenkorean",
+ [0x3208] = "cieucparenkorean",
+ [0x3209] = "chieuchparenkorean",
+ [0x320A] = "khieukhparenkorean",
+ [0x320B] = "thieuthparenkorean",
+ [0x320C] = "phieuphparenkorean",
+ [0x320D] = "hieuhparenkorean",
+ [0x320E] = "kiyeokaparenkorean",
+ [0x320F] = "nieunaparenkorean",
+ [0x3210] = "tikeutaparenkorean",
+ [0x3211] = "rieulaparenkorean",
+ [0x3212] = "mieumaparenkorean",
+ [0x3213] = "pieupaparenkorean",
+ [0x3214] = "siosaparenkorean",
+ [0x3215] = "ieungaparenkorean",
+ [0x3216] = "cieucaparenkorean",
+ [0x3217] = "chieuchaparenkorean",
+ [0x3218] = "khieukhaparenkorean",
+ [0x3219] = "thieuthaparenkorean",
+ [0x321A] = "phieuphaparenkorean",
+ [0x321B] = "hieuhaparenkorean",
+ [0x321C] = "cieucuparenkorean",
+ [0x3220] = "oneideographicparen",
+ [0x3221] = "twoideographicparen",
+ [0x3222] = "threeideographicparen",
+ [0x3223] = "fourideographicparen",
+ [0x3224] = "fiveideographicparen",
+ [0x3225] = "sixideographicparen",
+ [0x3226] = "sevenideographicparen",
+ [0x3227] = "eightideographicparen",
+ [0x3228] = "nineideographicparen",
+ [0x3229] = "tenideographicparen",
+ [0x322A] = "ideographicmoonparen",
+ [0x322B] = "ideographicfireparen",
+ [0x322C] = "ideographicwaterparen",
+ [0x322D] = "ideographicwoodparen",
+ [0x322E] = "ideographicmetalparen",
+ [0x322F] = "ideographicearthparen",
+ [0x3230] = "ideographicsunparen",
+ [0x3231] = "ideographicstockparen",
+ [0x3232] = "ideographichaveparen",
+ [0x3233] = "ideographicsocietyparen",
+ [0x3234] = "ideographicnameparen",
+ [0x3235] = "ideographicspecialparen",
+ [0x3236] = "ideographicfinancialparen",
+ [0x3237] = "ideographiccongratulationparen",
+ [0x3238] = "ideographiclaborparen",
+ [0x3239] = "ideographicrepresentparen",
+ [0x323A] = "ideographiccallparen",
+ [0x323B] = "ideographicstudyparen",
+ [0x323C] = "ideographicsuperviseparen",
+ [0x323D] = "ideographicenterpriseparen",
+ [0x323E] = "ideographicresourceparen",
+ [0x323F] = "ideographicallianceparen",
+ [0x3240] = "ideographicfestivalparen",
+ [0x3242] = "ideographicselfparen",
+ [0x3243] = "ideographicreachparen",
+ [0x3260] = "kiyeokcirclekorean",
+ [0x3261] = "nieuncirclekorean",
+ [0x3262] = "tikeutcirclekorean",
+ [0x3263] = "rieulcirclekorean",
+ [0x3264] = "mieumcirclekorean",
+ [0x3265] = "pieupcirclekorean",
+ [0x3266] = "sioscirclekorean",
+ [0x3267] = "ieungcirclekorean",
+ [0x3268] = "cieuccirclekorean",
+ [0x3269] = "chieuchcirclekorean",
+ [0x326A] = "khieukhcirclekorean",
+ [0x326B] = "thieuthcirclekorean",
+ [0x326C] = "phieuphcirclekorean",
+ [0x326D] = "hieuhcirclekorean",
+ [0x326E] = "kiyeokacirclekorean",
+ [0x326F] = "nieunacirclekorean",
+ [0x3270] = "tikeutacirclekorean",
+ [0x3271] = "rieulacirclekorean",
+ [0x3272] = "mieumacirclekorean",
+ [0x3273] = "pieupacirclekorean",
+ [0x3274] = "siosacirclekorean",
+ [0x3275] = "ieungacirclekorean",
+ [0x3276] = "cieucacirclekorean",
+ [0x3277] = "chieuchacirclekorean",
+ [0x3278] = "khieukhacirclekorean",
+ [0x3279] = "thieuthacirclekorean",
+ [0x327A] = "phieuphacirclekorean",
+ [0x327B] = "hieuhacirclekorean",
+ [0x327F] = "koreanstandardsymbol",
+ [0x328A] = "ideographmooncircle",
+ [0x328B] = "ideographfirecircle",
+ [0x328C] = "ideographwatercircle",
+ [0x328D] = "ideographwoodcircle",
+ [0x328E] = "ideographmetalcircle",
+ [0x328F] = "ideographearthcircle",
+ [0x3290] = "ideographsuncircle",
+ [0x3294] = "ideographnamecircle",
+ [0x3296] = "ideographicfinancialcircle",
+ [0x3298] = "ideographiclaborcircle",
+ [0x3299] = "ideographicsecretcircle",
+ [0x329D] = "ideographicexcellentcircle",
+ [0x329E] = "ideographicprintcircle",
+ [0x32A3] = "ideographiccorrectcircle",
+ [0x32A4] = "ideographichighcircle",
+ [0x32A5] = "ideographiccentrecircle",
+ [0x32A6] = "ideographiclowcircle",
+ [0x32A7] = "ideographicleftcircle",
+ [0x32A8] = "ideographicrightcircle",
+ [0x32A9] = "ideographicmedicinecircle",
+ [0x3300] = "apaatosquare",
+ [0x3303] = "aarusquare",
+ [0x3305] = "intisquare",
+ [0x330D] = "karoriisquare",
+ [0x3314] = "kirosquare",
+ [0x3315] = "kiroguramusquare",
+ [0x3316] = "kiromeetorusquare",
+ [0x3318] = "guramusquare",
+ [0x331E] = "kooposquare",
+ [0x3322] = "sentisquare",
+ [0x3323] = "sentosquare",
+ [0x3326] = "dorusquare",
+ [0x3327] = "tonsquare",
+ [0x332A] = "haitusquare",
+ [0x332B] = "paasentosquare",
+ [0x3331] = "birusquare",
+ [0x3333] = "huiitosquare",
+ [0x3336] = "hekutaarusquare",
+ [0x3339] = "herutusquare",
+ [0x333B] = "peezisquare",
+ [0x3342] = "hoonsquare",
+ [0x3347] = "mansyonsquare",
+ [0x3349] = "mirisquare",
+ [0x334A] = "miribaarusquare",
+ [0x334D] = "meetorusquare",
+ [0x334E] = "yaadosquare",
+ [0x3351] = "rittorusquare",
+ [0x3357] = "wattosquare",
+ [0x337B] = "heiseierasquare",
+ [0x337C] = "syouwaerasquare",
+ [0x337D] = "taisyouerasquare",
+ [0x337E] = "meizierasquare",
+ [0x337F] = "corporationsquare",
+ [0x3380] = "paampssquare",
+ [0x3381] = "nasquare",
+ [0x3382] = "muasquare",
+ [0x3383] = "masquare",
+ [0x3384] = "kasquare",
+ [0x3385] = "KBsquare",
+ [0x3386] = "MBsquare",
+ [0x3387] = "GBsquare",
+ [0x3388] = "calsquare",
+ [0x3389] = "kcalsquare",
+ [0x338A] = "pfsquare",
+ [0x338B] = "nfsquare",
+ [0x338C] = "mufsquare",
+ [0x338D] = "mugsquare",
+ [0x338E] = "squaremg",
+ [0x338F] = "squarekg",
+ [0x3390] = "Hzsquare",
+ [0x3391] = "khzsquare",
+ [0x3392] = "mhzsquare",
+ [0x3393] = "ghzsquare",
+ [0x3394] = "thzsquare",
+ [0x3395] = "mulsquare",
+ [0x3396] = "mlsquare",
+ [0x3397] = "dlsquare",
+ [0x3398] = "klsquare",
+ [0x3399] = "fmsquare",
+ [0x339A] = "nmsquare",
+ [0x339B] = "mumsquare",
+ [0x339C] = "squaremm",
+ [0x339D] = "squarecm",
+ [0x339E] = "squarekm",
+ [0x339F] = "mmsquaredsquare",
+ [0x33A0] = "cmsquaredsquare",
+ [0x33A1] = "squaremsquared",
+ [0x33A2] = "kmsquaredsquare",
+ [0x33A3] = "mmcubedsquare",
+ [0x33A4] = "cmcubedsquare",
+ [0x33A5] = "mcubedsquare",
+ [0x33A6] = "kmcubedsquare",
+ [0x33A7] = "moverssquare",
+ [0x33A8] = "moverssquaredsquare",
+ [0x33A9] = "pasquare",
+ [0x33AA] = "kpasquare",
+ [0x33AB] = "mpasquare",
+ [0x33AC] = "gpasquare",
+ [0x33AD] = "radsquare",
+ [0x33AE] = "radoverssquare",
+ [0x33AF] = "radoverssquaredsquare",
+ [0x33B0] = "pssquare",
+ [0x33B1] = "nssquare",
+ [0x33B2] = "mussquare",
+ [0x33B3] = "mssquare",
+ [0x33B4] = "pvsquare",
+ [0x33B5] = "nvsquare",
+ [0x33B6] = "muvsquare",
+ [0x33B7] = "mvsquare",
+ [0x33B8] = "kvsquare",
+ [0x33B9] = "mvmegasquare",
+ [0x33BA] = "pwsquare",
+ [0x33BB] = "nwsquare",
+ [0x33BC] = "muwsquare",
+ [0x33BD] = "mwsquare",
+ [0x33BE] = "kwsquare",
+ [0x33BF] = "mwmegasquare",
+ [0x33C0] = "kohmsquare",
+ [0x33C1] = "mohmsquare",
+ [0x33C2] = "amsquare",
+ [0x33C3] = "bqsquare",
+ [0x33C4] = "squarecc",
+ [0x33C5] = "cdsquare",
+ [0x33C6] = "coverkgsquare",
+ [0x33C7] = "cosquare",
+ [0x33C8] = "dbsquare",
+ [0x33C9] = "gysquare",
+ [0x33CA] = "hasquare",
+ [0x33CB] = "HPsquare",
+ [0x33CD] = "KKsquare",
+ [0x33CE] = "squarekmcapital",
+ [0x33CF] = "ktsquare",
+ [0x33D0] = "lmsquare",
+ [0x33D1] = "squareln",
+ [0x33D2] = "squarelog",
+ [0x33D3] = "lxsquare",
+ [0x33D4] = "mbsquare",
+ [0x33D5] = "squaremil",
+ [0x33D6] = "molsquare",
+ [0x33D8] = "pmsquare",
+ [0x33DB] = "srsquare",
+ [0x33DC] = "svsquare",
+ [0x33DD] = "wbsquare",
+ [0x5344] = "twentyhangzhou",
+ [0xF6BE] = "dotlessj",
+ [0xF6BF] = "LL",
+ [0xF6C0] = "ll",
+ [0xF6C3] = "commaaccent",
+ [0xF6C4] = "afii10063",
+ [0xF6C5] = "afii10064",
+ [0xF6C6] = "afii10192",
+ [0xF6C7] = "afii10831",
+ [0xF6C8] = "afii10832",
+ [0xF6C9] = "Acute",
+ [0xF6CA] = "Caron",
+ [0xF6CB] = "Dieresis",
+ [0xF6CC] = "DieresisAcute",
+ [0xF6CD] = "DieresisGrave",
+ [0xF6CE] = "Grave",
+ [0xF6CF] = "Hungarumlaut",
+ [0xF6D0] = "Macron",
+ [0xF6D1] = "cyrBreve",
+ [0xF6D2] = "cyrFlex",
+ [0xF6D3] = "dblGrave",
+ [0xF6D4] = "cyrbreve",
+ [0xF6D5] = "cyrflex",
+ [0xF6D6] = "dblgrave",
+ [0xF6D7] = "dieresisacute",
+ [0xF6D8] = "dieresisgrave",
+ [0xF6D9] = "copyrightserif",
+ [0xF6DA] = "registerserif",
+ [0xF6DB] = "trademarkserif",
+ [0xF6DC] = "onefitted",
+ [0xF6DD] = "rupiah",
+ [0xF6DE] = "threequartersemdash",
+ [0xF6DF] = "centinferior",
+ [0xF6E0] = "centsuperior",
+ [0xF6E1] = "commainferior",
+ [0xF6E2] = "commasuperior",
+ [0xF6E3] = "dollarinferior",
+ [0xF6E4] = "dollarsuperior",
+ [0xF6E5] = "hypheninferior",
+ [0xF6E6] = "hyphensuperior",
+ [0xF6E7] = "periodinferior",
+ [0xF6E8] = "periodsuperior",
+ [0xF6E9] = "asuperior",
+ [0xF6EA] = "bsuperior",
+ [0xF6EB] = "dsuperior",
+ [0xF6EC] = "esuperior",
+ [0xF6ED] = "isuperior",
+ [0xF6EE] = "lsuperior",
+ [0xF6EF] = "msuperior",
+ [0xF6F0] = "osuperior",
+ [0xF6F1] = "rsuperior",
+ [0xF6F2] = "ssuperior",
+ [0xF6F3] = "tsuperior",
+ [0xF6F4] = "Brevesmall",
+ [0xF6F5] = "Caronsmall",
+ [0xF6F6] = "Circumflexsmall",
+ [0xF6F7] = "Dotaccentsmall",
+ [0xF6F8] = "Hungarumlautsmall",
+ [0xF6F9] = "Lslashsmall",
+ [0xF6FA] = "OEsmall",
+ [0xF6FB] = "Ogoneksmall",
+ [0xF6FC] = "Ringsmall",
+ [0xF6FD] = "Scaronsmall",
+ [0xF6FE] = "Tildesmall",
+ [0xF6FF] = "Zcaronsmall",
+ [0xF721] = "exclamsmall",
+ [0xF724] = "dollaroldstyle",
+ [0xF726] = "ampersandsmall",
+ [0xF730] = "zerooldstyle",
+ [0xF731] = "oneoldstyle",
+ [0xF732] = "twooldstyle",
+ [0xF733] = "threeoldstyle",
+ [0xF734] = "fouroldstyle",
+ [0xF735] = "fiveoldstyle",
+ [0xF736] = "sixoldstyle",
+ [0xF737] = "sevenoldstyle",
+ [0xF738] = "eightoldstyle",
+ [0xF739] = "nineoldstyle",
+ [0xF73F] = "questionsmall",
+ [0xF760] = "Gravesmall",
+ [0xF761] = "Asmall",
+ [0xF762] = "Bsmall",
+ [0xF763] = "Csmall",
+ [0xF764] = "Dsmall",
+ [0xF765] = "Esmall",
+ [0xF766] = "Fsmall",
+ [0xF767] = "Gsmall",
+ [0xF768] = "Hsmall",
+ [0xF769] = "Ismall",
+ [0xF76A] = "Jsmall",
+ [0xF76B] = "Ksmall",
+ [0xF76C] = "Lsmall",
+ [0xF76D] = "Msmall",
+ [0xF76E] = "Nsmall",
+ [0xF76F] = "Osmall",
+ [0xF770] = "Psmall",
+ [0xF771] = "Qsmall",
+ [0xF772] = "Rsmall",
+ [0xF773] = "Ssmall",
+ [0xF774] = "Tsmall",
+ [0xF775] = "Usmall",
+ [0xF776] = "Vsmall",
+ [0xF777] = "Wsmall",
+ [0xF778] = "Xsmall",
+ [0xF779] = "Ysmall",
+ [0xF77A] = "Zsmall",
+ [0xF7A1] = "exclamdownsmall",
+ [0xF7A2] = "centoldstyle",
+ [0xF7A8] = "Dieresissmall",
+ [0xF7AF] = "Macronsmall",
+ [0xF7B4] = "Acutesmall",
+ [0xF7B8] = "Cedillasmall",
+ [0xF7BF] = "questiondownsmall",
+ [0xF7E0] = "Agravesmall",
+ [0xF7E1] = "Aacutesmall",
+ [0xF7E2] = "Acircumflexsmall",
+ [0xF7E3] = "Atildesmall",
+ [0xF7E4] = "Adieresissmall",
+ [0xF7E5] = "Aringsmall",
+ [0xF7E6] = "AEsmall",
+ [0xF7E7] = "Ccedillasmall",
+ [0xF7E8] = "Egravesmall",
+ [0xF7E9] = "Eacutesmall",
+ [0xF7EA] = "Ecircumflexsmall",
+ [0xF7EB] = "Edieresissmall",
+ [0xF7EC] = "Igravesmall",
+ [0xF7ED] = "Iacutesmall",
+ [0xF7EE] = "Icircumflexsmall",
+ [0xF7EF] = "Idieresissmall",
+ [0xF7F0] = "Ethsmall",
+ [0xF7F1] = "Ntildesmall",
+ [0xF7F2] = "Ogravesmall",
+ [0xF7F3] = "Oacutesmall",
+ [0xF7F4] = "Ocircumflexsmall",
+ [0xF7F5] = "Otildesmall",
+ [0xF7F6] = "Odieresissmall",
+ [0xF7F8] = "Oslashsmall",
+ [0xF7F9] = "Ugravesmall",
+ [0xF7FA] = "Uacutesmall",
+ [0xF7FB] = "Ucircumflexsmall",
+ [0xF7FC] = "Udieresissmall",
+ [0xF7FD] = "Yacutesmall",
+ [0xF7FE] = "Thornsmall",
+ [0xF7FF] = "Ydieresissmall",
+ [0xF884] = "maihanakatleftthai",
+ [0xF885] = "saraileftthai",
+ [0xF886] = "saraiileftthai",
+ [0xF887] = "saraueleftthai",
+ [0xF888] = "saraueeleftthai",
+ [0xF889] = "maitaikhuleftthai",
+ [0xF88A] = "maiekupperleftthai",
+ [0xF88B] = "maieklowrightthai",
+ [0xF88C] = "maieklowleftthai",
+ [0xF88D] = "maithoupperleftthai",
+ [0xF88E] = "maitholowrightthai",
+ [0xF88F] = "maitholowleftthai",
+ [0xF890] = "maitriupperleftthai",
+ [0xF891] = "maitrilowrightthai",
+ [0xF892] = "maitrilowleftthai",
+ [0xF893] = "maichattawaupperleftthai",
+ [0xF894] = "maichattawalowrightthai",
+ [0xF895] = "maichattawalowleftthai",
+ [0xF896] = "thanthakhatupperleftthai",
+ [0xF897] = "thanthakhatlowrightthai",
+ [0xF898] = "thanthakhatlowleftthai",
+ [0xF899] = "nikhahitleftthai",
+ [0xF8E5] = "radicalex",
+ [0xF8E6] = "arrowvertex",
+ [0xF8E7] = "arrowhorizex",
+ [0xF8E8] = "registersans",
+ [0xF8E9] = "copyrightsans",
+ [0xF8EA] = "trademarksans",
+ [0xF8EB] = "parenlefttp",
+ [0xF8EC] = "parenleftex",
+ [0xF8ED] = "parenleftbt",
+ [0xF8EE] = "bracketlefttp",
+ [0xF8EF] = "bracketleftex",
+ [0xF8F0] = "bracketleftbt",
+ [0xF8F1] = "bracelefttp",
+ [0xF8F2] = "braceleftmid",
+ [0xF8F3] = "braceleftbt",
+ [0xF8F4] = "braceex",
+ [0xF8F5] = "integralex",
+ [0xF8F6] = "parenrighttp",
+ [0xF8F7] = "parenrightex",
+ [0xF8F8] = "parenrightbt",
+ [0xF8F9] = "bracketrighttp",
+ [0xF8FA] = "bracketrightex",
+ [0xF8FB] = "bracketrightbt",
+ [0xF8FC] = "bracerighttp",
+ [0xF8FD] = "bracerightmid",
+ [0xF8FE] = "bracerightbt",
+ [0xF8FF] = "apple",
+ [0xFB00] = "ff",
+ [0xFB01] = "fi",
+ [0xFB02] = "fl",
+ [0xFB03] = "ffi",
+ [0xFB04] = "ffl",
+ [0xFB1F] = "yodyodpatahhebrew",
+ [0xFB20] = "ayinaltonehebrew",
+ [0xFB2A] = "shinshindothebrew",
+ [0xFB2B] = "shinsindothebrew",
+ [0xFB2C] = "shindageshshindothebrew",
+ [0xFB2D] = "shindageshsindothebrew",
+ [0xFB2E] = "alefpatahhebrew",
+ [0xFB2F] = "alefqamatshebrew",
+ [0xFB30] = "alefdageshhebrew",
+ [0xFB31] = "betdageshhebrew",
+ [0xFB32] = "gimeldageshhebrew",
+ [0xFB33] = "daletdageshhebrew",
+ [0xFB34] = "hedageshhebrew",
+ [0xFB35] = "vavdageshhebrew",
+ [0xFB36] = "zayindageshhebrew",
+ [0xFB38] = "tetdageshhebrew",
+ [0xFB39] = "yoddageshhebrew",
+ [0xFB3A] = "finalkafdageshhebrew",
+ [0xFB3B] = "kafdageshhebrew",
+ [0xFB3C] = "lameddageshhebrew",
+ [0xFB3E] = "memdageshhebrew",
+ [0xFB40] = "nundageshhebrew",
+ [0xFB41] = "samekhdageshhebrew",
+ [0xFB43] = "pefinaldageshhebrew",
+ [0xFB44] = "pedageshhebrew",
+ [0xFB46] = "tsadidageshhebrew",
+ [0xFB47] = "qofdageshhebrew",
+ [0xFB48] = "reshdageshhebrew",
+ [0xFB49] = "shindageshhebrew",
+ [0xFB4A] = "tavdageshhebrew",
+ [0xFB4B] = "vavholamhebrew",
+ [0xFB4C] = "betrafehebrew",
+ [0xFB4D] = "kafrafehebrew",
+ [0xFB4E] = "perafehebrew",
+ [0xFB4F] = "aleflamedhebrew",
+ [0xFB57] = "pehfinalarabic",
+ [0xFB58] = "pehinitialarabic",
+ [0xFB59] = "pehmedialarabic",
+ [0xFB67] = "ttehfinalarabic",
+ [0xFB68] = "ttehinitialarabic",
+ [0xFB69] = "ttehmedialarabic",
+ [0xFB6B] = "vehfinalarabic",
+ [0xFB6C] = "vehinitialarabic",
+ [0xFB6D] = "vehmedialarabic",
+ [0xFB7B] = "tchehfinalarabic",
+ [0xFB7C] = "tchehmeeminitialarabic",
+ [0xFB7D] = "tchehmedialarabic",
+ [0xFB89] = "ddalfinalarabic",
+ [0xFB8B] = "jehfinalarabic",
+ [0xFB8D] = "rrehfinalarabic",
+ [0xFB93] = "gaffinalarabic",
+ [0xFB94] = "gafinitialarabic",
+ [0xFB95] = "gafmedialarabic",
+ [0xFB9F] = "noonghunnafinalarabic",
+ [0xFBA4] = "hehhamzaaboveisolatedarabic",
+ [0xFBA5] = "hehhamzaabovefinalarabic",
+ [0xFBA7] = "hehfinalaltonearabic",
+ [0xFBA8] = "hehinitialaltonearabic",
+ [0xFBA9] = "hehmedialaltonearabic",
+ [0xFBAF] = "yehbarreefinalarabic",
+ [0xFC08] = "behmeemisolatedarabic",
+ [0xFC0B] = "tehjeemisolatedarabic",
+ [0xFC0C] = "tehhahisolatedarabic",
+ [0xFC0E] = "tehmeemisolatedarabic",
+ [0xFC48] = "meemmeemisolatedarabic",
+ [0xFC4B] = "noonjeemisolatedarabic",
+ [0xFC4E] = "noonmeemisolatedarabic",
+ [0xFC58] = "yehmeemisolatedarabic",
+ [0xFC5E] = "shaddadammatanarabic",
+ [0xFC5F] = "shaddakasratanarabic",
+ [0xFC60] = "shaddafathaarabic",
+ [0xFC61] = "shaddadammaarabic",
+ [0xFC62] = "shaddakasraarabic",
+ [0xFC6D] = "behnoonfinalarabic",
+ [0xFC73] = "tehnoonfinalarabic",
+ [0xFC8D] = "noonnoonfinalarabic",
+ [0xFC94] = "yehnoonfinalarabic",
+ [0xFC9F] = "behmeeminitialarabic",
+ [0xFCA1] = "tehjeeminitialarabic",
+ [0xFCA2] = "tehhahinitialarabic",
+ [0xFCA4] = "tehmeeminitialarabic",
+ [0xFCC9] = "lamjeeminitialarabic",
+ [0xFCCA] = "lamhahinitialarabic",
+ [0xFCCB] = "lamkhahinitialarabic",
+ [0xFCCC] = "lammeeminitialarabic",
+ [0xFCD1] = "meemmeeminitialarabic",
+ [0xFCD2] = "noonjeeminitialarabic",
+ [0xFCD5] = "noonmeeminitialarabic",
+ [0xFCDD] = "yehmeeminitialarabic",
+ [0xFD3E] = "parenleftaltonearabic",
+ [0xFD3F] = "parenrightaltonearabic",
+ [0xFD88] = "lammeemhahinitialarabic",
+ [0xFDF2] = "lamlamhehisolatedarabic",
+ [0xFDFA] = "sallallahoualayhewasallamarabic",
+ [0xFE30] = "twodotleadervertical",
+ [0xFE31] = "emdashvertical",
+ [0xFE32] = "endashvertical",
+ [0xFE33] = "underscorevertical",
+ [0xFE34] = "wavyunderscorevertical",
+ [0xFE35] = "parenleftvertical",
+ [0xFE36] = "parenrightvertical",
+ [0xFE37] = "braceleftvertical",
+ [0xFE38] = "bracerightvertical",
+ [0xFE39] = "tortoiseshellbracketleftvertical",
+ [0xFE3A] = "tortoiseshellbracketrightvertical",
+ [0xFE3B] = "blacklenticularbracketleftvertical",
+ [0xFE3C] = "blacklenticularbracketrightvertical",
+ [0xFE3D] = "dblanglebracketleftvertical",
+ [0xFE3E] = "dblanglebracketrightvertical",
+ [0xFE3F] = "anglebracketleftvertical",
+ [0xFE40] = "anglebracketrightvertical",
+ [0xFE41] = "cornerbracketleftvertical",
+ [0xFE42] = "cornerbracketrightvertical",
+ [0xFE43] = "whitecornerbracketleftvertical",
+ [0xFE44] = "whitecornerbracketrightvertical",
+ [0xFE49] = "overlinedashed",
+ [0xFE4A] = "overlinecenterline",
+ [0xFE4B] = "overlinewavy",
+ [0xFE4C] = "overlinedblwavy",
+ [0xFE4D] = "lowlinedashed",
+ [0xFE4E] = "lowlinecenterline",
+ [0xFE4F] = "underscorewavy",
+ [0xFE50] = "commasmall",
+ [0xFE52] = "periodsmall",
+ [0xFE54] = "semicolonsmall",
+ [0xFE55] = "colonsmall",
+ [0xFE59] = "parenleftsmall",
+ [0xFE5A] = "parenrightsmall",
+ [0xFE5B] = "braceleftsmall",
+ [0xFE5C] = "bracerightsmall",
+ [0xFE5D] = "tortoiseshellbracketleftsmall",
+ [0xFE5E] = "tortoiseshellbracketrightsmall",
+ [0xFE5F] = "numbersignsmall",
+ [0xFE61] = "asterisksmall",
+ [0xFE62] = "plussmall",
+ [0xFE63] = "hyphensmall",
+ [0xFE64] = "lesssmall",
+ [0xFE65] = "greatersmall",
+ [0xFE66] = "equalsmall",
+ [0xFE69] = "dollarsmall",
+ [0xFE6A] = "percentsmall",
+ [0xFE6B] = "atsmall",
+ [0xFE82] = "alefmaddaabovefinalarabic",
+ [0xFE84] = "alefhamzaabovefinalarabic",
+ [0xFE86] = "wawhamzaabovefinalarabic",
+ [0xFE88] = "alefhamzabelowfinalarabic",
+ [0xFE8A] = "yehhamzaabovefinalarabic",
+ [0xFE8B] = "yehhamzaaboveinitialarabic",
+ [0xFE8C] = "yehhamzaabovemedialarabic",
+ [0xFE8E] = "aleffinalarabic",
+ [0xFE90] = "behfinalarabic",
+ [0xFE91] = "behinitialarabic",
+ [0xFE92] = "behmedialarabic",
+ [0xFE94] = "tehmarbutafinalarabic",
+ [0xFE96] = "tehfinalarabic",
+ [0xFE97] = "tehinitialarabic",
+ [0xFE98] = "tehmedialarabic",
+ [0xFE9A] = "thehfinalarabic",
+ [0xFE9B] = "thehinitialarabic",
+ [0xFE9C] = "thehmedialarabic",
+ [0xFE9E] = "jeemfinalarabic",
+ [0xFE9F] = "jeeminitialarabic",
+ [0xFEA0] = "jeemmedialarabic",
+ [0xFEA2] = "hahfinalarabic",
+ [0xFEA3] = "hahinitialarabic",
+ [0xFEA4] = "hahmedialarabic",
+ [0xFEA6] = "khahfinalarabic",
+ [0xFEA7] = "khahinitialarabic",
+ [0xFEA8] = "khahmedialarabic",
+ [0xFEAA] = "dalfinalarabic",
+ [0xFEAC] = "thalfinalarabic",
+ [0xFEAE] = "rehfinalarabic",
+ [0xFEB0] = "zainfinalarabic",
+ [0xFEB2] = "seenfinalarabic",
+ [0xFEB3] = "seeninitialarabic",
+ [0xFEB4] = "seenmedialarabic",
+ [0xFEB6] = "sheenfinalarabic",
+ [0xFEB7] = "sheeninitialarabic",
+ [0xFEB8] = "sheenmedialarabic",
+ [0xFEBA] = "sadfinalarabic",
+ [0xFEBB] = "sadinitialarabic",
+ [0xFEBC] = "sadmedialarabic",
+ [0xFEBE] = "dadfinalarabic",
+ [0xFEBF] = "dadinitialarabic",
+ [0xFEC0] = "dadmedialarabic",
+ [0xFEC2] = "tahfinalarabic",
+ [0xFEC3] = "tahinitialarabic",
+ [0xFEC4] = "tahmedialarabic",
+ [0xFEC6] = "zahfinalarabic",
+ [0xFEC7] = "zahinitialarabic",
+ [0xFEC8] = "zahmedialarabic",
+ [0xFECA] = "ainfinalarabic",
+ [0xFECB] = "aininitialarabic",
+ [0xFECC] = "ainmedialarabic",
+ [0xFECE] = "ghainfinalarabic",
+ [0xFECF] = "ghaininitialarabic",
+ [0xFED0] = "ghainmedialarabic",
+ [0xFED2] = "fehfinalarabic",
+ [0xFED3] = "fehinitialarabic",
+ [0xFED4] = "fehmedialarabic",
+ [0xFED6] = "qaffinalarabic",
+ [0xFED7] = "qafinitialarabic",
+ [0xFED8] = "qafmedialarabic",
+ [0xFEDA] = "kaffinalarabic",
+ [0xFEDB] = "kafinitialarabic",
+ [0xFEDC] = "kafmedialarabic",
+ [0xFEDE] = "lamfinalarabic",
+ [0xFEDF] = "lammeemkhahinitialarabic",
+ [0xFEE0] = "lammedialarabic",
+ [0xFEE2] = "meemfinalarabic",
+ [0xFEE3] = "meeminitialarabic",
+ [0xFEE4] = "meemmedialarabic",
+ [0xFEE6] = "noonfinalarabic",
+ [0xFEE7] = "nooninitialarabic",
+ [0xFEE8] = "noonmedialarabic",
+ [0xFEEA] = "hehfinalarabic",
+ [0xFEEB] = "hehinitialarabic",
+ [0xFEEC] = "hehmedialarabic",
+ [0xFEEE] = "wawfinalarabic",
+ [0xFEF0] = "alefmaksurafinalarabic",
+ [0xFEF2] = "yehfinalarabic",
+ [0xFEF3] = "yehinitialarabic",
+ [0xFEF4] = "yehmedialarabic",
+ [0xFEF5] = "lamalefmaddaaboveisolatedarabic",
+ [0xFEF6] = "lamalefmaddaabovefinalarabic",
+ [0xFEF7] = "lamalefhamzaaboveisolatedarabic",
+ [0xFEF8] = "lamalefhamzaabovefinalarabic",
+ [0xFEF9] = "lamalefhamzabelowisolatedarabic",
+ [0xFEFA] = "lamalefhamzabelowfinalarabic",
+ [0xFEFB] = "lamalefisolatedarabic",
+ [0xFEFC] = "lamaleffinalarabic",
+ [0xFEFF] = "zerowidthjoiner",
+ [0xFF01] = "exclammonospace",
+ [0xFF02] = "quotedblmonospace",
+ [0xFF03] = "numbersignmonospace",
+ [0xFF04] = "dollarmonospace",
+ [0xFF05] = "percentmonospace",
+ [0xFF06] = "ampersandmonospace",
+ [0xFF07] = "quotesinglemonospace",
+ [0xFF08] = "parenleftmonospace",
+ [0xFF09] = "parenrightmonospace",
+ [0xFF0A] = "asteriskmonospace",
+ [0xFF0B] = "plusmonospace",
+ [0xFF0C] = "commamonospace",
+ [0xFF0D] = "hyphenmonospace",
+ [0xFF0E] = "periodmonospace",
+ [0xFF0F] = "slashmonospace",
+ [0xFF10] = "zeromonospace",
+ [0xFF11] = "onemonospace",
+ [0xFF12] = "twomonospace",
+ [0xFF13] = "threemonospace",
+ [0xFF14] = "fourmonospace",
+ [0xFF15] = "fivemonospace",
+ [0xFF16] = "sixmonospace",
+ [0xFF17] = "sevenmonospace",
+ [0xFF18] = "eightmonospace",
+ [0xFF19] = "ninemonospace",
+ [0xFF1A] = "colonmonospace",
+ [0xFF1B] = "semicolonmonospace",
+ [0xFF1C] = "lessmonospace",
+ [0xFF1D] = "equalmonospace",
+ [0xFF1E] = "greatermonospace",
+ [0xFF1F] = "questionmonospace",
+ [0xFF20] = "atmonospace",
+ [0xFF21] = "Amonospace",
+ [0xFF22] = "Bmonospace",
+ [0xFF23] = "Cmonospace",
+ [0xFF24] = "Dmonospace",
+ [0xFF25] = "Emonospace",
+ [0xFF26] = "Fmonospace",
+ [0xFF27] = "Gmonospace",
+ [0xFF28] = "Hmonospace",
+ [0xFF29] = "Imonospace",
+ [0xFF2A] = "Jmonospace",
+ [0xFF2B] = "Kmonospace",
+ [0xFF2C] = "Lmonospace",
+ [0xFF2D] = "Mmonospace",
+ [0xFF2E] = "Nmonospace",
+ [0xFF2F] = "Omonospace",
+ [0xFF30] = "Pmonospace",
+ [0xFF31] = "Qmonospace",
+ [0xFF32] = "Rmonospace",
+ [0xFF33] = "Smonospace",
+ [0xFF34] = "Tmonospace",
+ [0xFF35] = "Umonospace",
+ [0xFF36] = "Vmonospace",
+ [0xFF37] = "Wmonospace",
+ [0xFF38] = "Xmonospace",
+ [0xFF39] = "Ymonospace",
+ [0xFF3A] = "Zmonospace",
+ [0xFF3B] = "bracketleftmonospace",
+ [0xFF3C] = "backslashmonospace",
+ [0xFF3D] = "bracketrightmonospace",
+ [0xFF3E] = "asciicircummonospace",
+ [0xFF3F] = "underscoremonospace",
+ [0xFF40] = "gravemonospace",
+ [0xFF41] = "amonospace",
+ [0xFF42] = "bmonospace",
+ [0xFF43] = "cmonospace",
+ [0xFF44] = "dmonospace",
+ [0xFF45] = "emonospace",
+ [0xFF46] = "fmonospace",
+ [0xFF47] = "gmonospace",
+ [0xFF48] = "hmonospace",
+ [0xFF49] = "imonospace",
+ [0xFF4A] = "jmonospace",
+ [0xFF4B] = "kmonospace",
+ [0xFF4C] = "lmonospace",
+ [0xFF4D] = "mmonospace",
+ [0xFF4E] = "nmonospace",
+ [0xFF4F] = "omonospace",
+ [0xFF50] = "pmonospace",
+ [0xFF51] = "qmonospace",
+ [0xFF52] = "rmonospace",
+ [0xFF53] = "smonospace",
+ [0xFF54] = "tmonospace",
+ [0xFF55] = "umonospace",
+ [0xFF56] = "vmonospace",
+ [0xFF57] = "wmonospace",
+ [0xFF58] = "xmonospace",
+ [0xFF59] = "ymonospace",
+ [0xFF5A] = "zmonospace",
+ [0xFF5B] = "braceleftmonospace",
+ [0xFF5C] = "barmonospace",
+ [0xFF5D] = "bracerightmonospace",
+ [0xFF5E] = "asciitildemonospace",
+ [0xFF61] = "periodhalfwidth",
+ [0xFF62] = "cornerbracketlefthalfwidth",
+ [0xFF63] = "cornerbracketrighthalfwidth",
+ [0xFF64] = "ideographiccommaleft",
+ [0xFF65] = "middledotkatakanahalfwidth",
+ [0xFF66] = "wokatakanahalfwidth",
+ [0xFF67] = "asmallkatakanahalfwidth",
+ [0xFF68] = "ismallkatakanahalfwidth",
+ [0xFF69] = "usmallkatakanahalfwidth",
+ [0xFF6A] = "esmallkatakanahalfwidth",
+ [0xFF6B] = "osmallkatakanahalfwidth",
+ [0xFF6C] = "yasmallkatakanahalfwidth",
+ [0xFF6D] = "yusmallkatakanahalfwidth",
+ [0xFF6E] = "yosmallkatakanahalfwidth",
+ [0xFF6F] = "tusmallkatakanahalfwidth",
+ [0xFF70] = "katahiraprolongmarkhalfwidth",
+ [0xFF71] = "akatakanahalfwidth",
+ [0xFF72] = "ikatakanahalfwidth",
+ [0xFF73] = "ukatakanahalfwidth",
+ [0xFF74] = "ekatakanahalfwidth",
+ [0xFF75] = "okatakanahalfwidth",
+ [0xFF76] = "kakatakanahalfwidth",
+ [0xFF77] = "kikatakanahalfwidth",
+ [0xFF78] = "kukatakanahalfwidth",
+ [0xFF79] = "kekatakanahalfwidth",
+ [0xFF7A] = "kokatakanahalfwidth",
+ [0xFF7B] = "sakatakanahalfwidth",
+ [0xFF7C] = "sikatakanahalfwidth",
+ [0xFF7D] = "sukatakanahalfwidth",
+ [0xFF7E] = "sekatakanahalfwidth",
+ [0xFF7F] = "sokatakanahalfwidth",
+ [0xFF80] = "takatakanahalfwidth",
+ [0xFF81] = "tikatakanahalfwidth",
+ [0xFF82] = "tukatakanahalfwidth",
+ [0xFF83] = "tekatakanahalfwidth",
+ [0xFF84] = "tokatakanahalfwidth",
+ [0xFF85] = "nakatakanahalfwidth",
+ [0xFF86] = "nikatakanahalfwidth",
+ [0xFF87] = "nukatakanahalfwidth",
+ [0xFF88] = "nekatakanahalfwidth",
+ [0xFF89] = "nokatakanahalfwidth",
+ [0xFF8A] = "hakatakanahalfwidth",
+ [0xFF8B] = "hikatakanahalfwidth",
+ [0xFF8C] = "hukatakanahalfwidth",
+ [0xFF8D] = "hekatakanahalfwidth",
+ [0xFF8E] = "hokatakanahalfwidth",
+ [0xFF8F] = "makatakanahalfwidth",
+ [0xFF90] = "mikatakanahalfwidth",
+ [0xFF91] = "mukatakanahalfwidth",
+ [0xFF92] = "mekatakanahalfwidth",
+ [0xFF93] = "mokatakanahalfwidth",
+ [0xFF94] = "yakatakanahalfwidth",
+ [0xFF95] = "yukatakanahalfwidth",
+ [0xFF96] = "yokatakanahalfwidth",
+ [0xFF97] = "rakatakanahalfwidth",
+ [0xFF98] = "rikatakanahalfwidth",
+ [0xFF99] = "rukatakanahalfwidth",
+ [0xFF9A] = "rekatakanahalfwidth",
+ [0xFF9B] = "rokatakanahalfwidth",
+ [0xFF9C] = "wakatakanahalfwidth",
+ [0xFF9D] = "nkatakanahalfwidth",
+ [0xFF9E] = "voicedmarkkanahalfwidth",
+ [0xFF9F] = "semivoicedmarkkanahalfwidth",
+ [0xFFE0] = "centmonospace",
+ [0xFFE1] = "sterlingmonospace",
+ [0xFFE3] = "macronmonospace",
+ [0xFFE5] = "yenmonospace",
+ [0xFFE6] = "wonmonospace",
+}
+
+fonts.map.agl_to_unicode = table.swapped(fonts.map.unicode_to_agl)
diff --git a/Master/texmf-dist/tex/context/base/font-chk.lua b/Master/texmf-dist/tex/context/base/font-chk.lua
index 382f671d8a8..32fdf88940a 100644
--- a/Master/texmf-dist/tex/context/base/font-chk.lua
+++ b/Master/texmf-dist/tex/context/base/font-chk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-chk'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -74,3 +74,17 @@ function checkers.missing(head)
end
return head, false
end
+
+trackers.register("fonts.missing", function(v)
+ tasks.enableaction("processors", "fonts.checkers.missing") -- always on then
+ checkers.enabled = v
+end)
+
+function checkers.enable(delete)
+ tasks.enableaction("processors", "fonts.checkers.missing") -- always on then
+ if delete ~= nil then
+ checkers.delete = delete
+ end
+ checkers.enabled = true
+end
+
diff --git a/Master/texmf-dist/tex/context/base/font-cid.lua b/Master/texmf-dist/tex/context/base/font-cid.lua
index 13e9cce8949..d1c727af2d9 100644
--- a/Master/texmf-dist/tex/context/base/font-cid.lua
+++ b/Master/texmf-dist/tex/context/base/font-cid.lua
@@ -6,8 +6,9 @@ if not modules then modules = { } end modules ['font-cid'] = {
license = "see context related readme files"
}
-local format, match = string.format, string.match
+local format, match, lower = string.format, string.match, string.lower
local tonumber = tonumber
+local lpegmatch = lpeg.match
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -61,7 +62,7 @@ function fonts.cid.load(filename)
local data = io.loaddata(filename)
if data then
unicodes, names = { }, { }
- grammar:match(data)
+ lpegmatch(grammar,data)
local supplement, registry, ordering = match(filename,"^(.-)%-(.-)%-()%.(.-)$")
return {
supplement = supplement,
@@ -78,9 +79,11 @@ end
local template = "%s-%s-%s.cidmap"
+
local function locate(registry,ordering,supplement)
- local filename = string.lower(format(template,registry,ordering,supplement))
- local cidmap = fonts.cid.map[filename]
+ local filename = format(template,registry,ordering,supplement)
+ local hashname = lower(filename)
+ local cidmap = fonts.cid.map[hashname]
if not cidmap then
if trace_loading then
logs.report("load otf","checking cidmap, registry: %s, ordering: %s, supplement: %s, filename: %s",registry,ordering,supplement,filename)
@@ -92,7 +95,7 @@ local function locate(registry,ordering,supplement)
if trace_loading then
logs.report("load otf","using cidmap file %s",filename)
end
- fonts.cid.map[filename] = cidmap
+ fonts.cid.map[hashname] = cidmap
cidmap.usedname = file.basename(filename)
return cidmap
end
diff --git a/Master/texmf-dist/tex/context/base/font-col.lua b/Master/texmf-dist/tex/context/base/font-col.lua
index f2ee3f1ae4b..d313357a2e0 100644
--- a/Master/texmf-dist/tex/context/base/font-col.lua
+++ b/Master/texmf-dist/tex/context/base/font-col.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-col'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -10,6 +10,7 @@ if not modules then modules = { } end modules ['font-col'] = {
local format, gmatch, texsprint, type = string.format, string.gmatch, tex.sprint, type
local traverse_id, first_character = node.traverse_id, node.first_character
+local lpegmatch = lpeg.match
local ctxcatcodes = tex.ctxcatcodes
@@ -166,7 +167,7 @@ function collections.prepare(name)
local f = d[i]
local name = f.font
local scale = f.rscale or 1
- if okay:match(name) then
+ if lpegmatch(okay,name) then
texsprint(ctxcatcodes,format("\\doclonefonta{%s}{%s}",name,scale)) -- define with unique specs
else
texsprint(ctxcatcodes,format("\\doclonefontb{%s}{%s}",name,scale)) -- define with inherited specs
diff --git a/Master/texmf-dist/tex/context/base/font-col.mkiv b/Master/texmf-dist/tex/context/base/font-col.mkiv
index 22a67ac8eab..181b985f68e 100644
--- a/Master/texmf-dist/tex/context/base/font-col.mkiv
+++ b/Master/texmf-dist/tex/context/base/font-col.mkiv
@@ -12,6 +12,8 @@
%C details.
% ! EXPERIMENTAL ! code will be made more nice
+%
+% actually we can now do more at the lua end
% todo: missing only, force always, multiple fallbacks with test, scale
%
@@ -27,7 +29,7 @@
\unprotect
-\def\definefontfallback
+\unexpanded\def\definefontfallback
{\doquadrupleempty\dodefinefontfallback}
\def\dodefinefontfallback[#1][#2][#3][#4]%
diff --git a/Master/texmf-dist/tex/context/base/font-ctx.lua b/Master/texmf-dist/tex/context/base/font-ctx.lua
index 2f51c5229bc..76e9f095a48 100644
--- a/Master/texmf-dist/tex/context/base/font-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/font-ctx.lua
@@ -1,14 +1,19 @@
if not modules then modules = { } end modules ['font-ctx'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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 texsprint, count = tex.sprint, tex.count
-local format, concat, gmatch, match, find, lower = string.format, table.concat, string.gmatch, string.match, string.find, string.lower
-local tostring, next = tostring, next
+-- needs a cleanup: merge of replace, lang/script etc
+
+local texsprint, count, texsetcount = tex.sprint, tex.count, tex.setcount
+local format, concat, gmatch, match, find, lower, gsub, byte = string.format, table.concat, string.gmatch, string.match, string.find, string.lower, string.gsub, string.byte
+
+local tostring, next, type = tostring, next, type
+local lpegmatch = lpeg.match
+local round = math.round
local ctxcatcodes = tex.ctxcatcodes
@@ -16,7 +21,7 @@ local trace_defining = false trackers.register("fonts.defining", function(v) tr
local tfm = fonts.tfm
local define = fonts.define
-local fontdata = fonts.ids
+local fontdata = fonts.identifiers
local specify = define.specify
specify.context_setups = specify.context_setups or { }
@@ -46,7 +51,7 @@ name*context specification
function specify.predefined(specification)
local detail = specification.detail
if detail ~= "" then
- -- detail = detail:gsub("["..define.splitsymbols.."].*$","") -- get rid of *whatever specs and such
+ -- detail = gsub(detail,"["..define.splitsymbols.."].*$","") -- get rid of *whatever specs and such
if define.methods[detail] then -- since these may be appended at the
specification.features.vtf = { preset = detail } -- tex end by default
end
@@ -66,22 +71,25 @@ local settings_to_hash = aux.settings_to_hash
local default_features = fonts.otf.features.default
local function preset_context(name,parent,features) -- currently otf only
+ if features == "" and find(parent,"=") then
+ features = parent
+ parent = ""
+ end
if features == "" then
- if find(parent,"=") then
- features = parent
- parent = ""
- end
+ features = { }
+ elseif type(features) == "string" then
+ features = normalize_meanings(settings_to_hash(features))
+ else
+ features = normalize_meanings(features)
end
- local number = (setups[name] and setups[name].number) or 0
- local t = (features == "" and { }) or normalize_meanings(settings_to_hash(features))
-- todo: synonyms, and not otf bound
if parent ~= "" then
for p in gmatch(parent,"[^, ]+") do
local s = setups[p]
if s then
for k,v in next, s do
- if t[k] == nil then
- t[k] = v
+ if features[k] == nil then
+ features[k] = v
end
end
end
@@ -91,25 +99,26 @@ local function preset_context(name,parent,features) -- currently otf only
-- we need to preset them (we hash the features and adding a default
-- setting during initialization may result in a different hash)
for k,v in next, triggers do
- if type(t[v]) == "nil" then
+ if features[v] == nil then -- not false !
local vv = default_features[v]
- if vv then t[v] = vv end
+ if vv then features[v] = vv end
end
end
-- sparse 'm so that we get a better hash and less test (experimental
-- optimization)
- local tt = { } -- maybe avoid tt
- for k,v in next, t do
- if v then tt[k] = v end
+ local t = { } -- can we avoid t ?
+ for k,v in next, features do
+ if v then t[k] = v end
end
-- needed for dynamic features
+ local number = (setups[name] and setups[name].number) or 0
if number == 0 then
number = #numbers + 1
numbers[number] = name
end
- tt.number = number
- setups[name] = tt
- return number
+ t.number = number
+ setups[name] = t
+ return number, t
end
local function context_number(name) -- will be replaced
@@ -267,13 +276,16 @@ local P, C, Cc = lpeg.P, lpeg.C, lpeg.Cc
local space = P(" ")
local spaces = space^0
-local value = C((1-space)^1)
+local leftparent = (P"(")
+local rightparent = (P")")
+local value = C((leftparent * (1-rightparent)^0 * rightparent + (1-space))^1)
+local dimension = C((space/"" + P(1))^1)
local rest = C(P(1)^0)
local scale_none = Cc(0)
-local scale_at = P("at") * Cc(1) * spaces * value
-local scale_sa = P("sa") * Cc(2) * spaces * value
-local scale_mo = P("mo") * Cc(3) * spaces * value
-local scale_scaled = P("scaled") * Cc(4) * spaces * value
+local scale_at = P("at") * Cc(1) * spaces * dimension -- value
+local scale_sa = P("sa") * Cc(2) * spaces * dimension -- value
+local scale_mo = P("mo") * Cc(3) * spaces * dimension -- value
+local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- value
local sizepattern = spaces * (scale_at + scale_sa + scale_mo + scale_scaled + scale_none)
local splitpattern = spaces * value * spaces * rest
@@ -287,7 +299,7 @@ local get_specification = define.get_specification
function define.command_1(str)
statistics.starttiming(fonts)
- local fullname, size = splitpattern:match(str)
+ local fullname, size = lpegmatch(splitpattern,str)
local lookup, name, sub, method, detail = get_specification(fullname)
if not name then
logs.report("define font","strange definition '%s'",str)
@@ -295,40 +307,50 @@ function define.command_1(str)
elseif name == "unknown" then
texsprint(ctxcatcodes,"\\fcglet\\somefontname\\defaultfontfile")
else
- texsprint(ctxcatcodes,format("\\fcxdef\\somefontname{%s}",name))
+ texsprint(ctxcatcodes,"\\fcxdef\\somefontname{",name,"}")
end
-- we can also use a count for the size
if size and size ~= "" then
- local mode, size = sizepattern:match(size)
+ local mode, size = lpegmatch(sizepattern,size)
if size and mode then
count.scaledfontmode = mode
- texsprint(ctxcatcodes,format("\\def\\somefontsize{%s}",size))
+ texsprint(ctxcatcodes,"\\def\\somefontsize{",size,"}")
else
count.scaledfontmode = 0
- texsprint(ctxcatcodes,format("\\let\\somefontsize\\empty",size))
+ texsprint(ctxcatcodes,"\\let\\somefontsize\\empty")
end
elseif true then
-- so we don't need to check in tex
count.scaledfontmode = 2
---~ texsprint(ctxcatcodes,format("\\def\\somefontsize{*}",size))
- texsprint(ctxcatcodes,format("\\let\\somefontsize\\empty",size))
+ texsprint(ctxcatcodes,"\\let\\somefontsize\\empty")
else
count.scaledfontmode = 0
- texsprint(ctxcatcodes,format("\\let\\somefontsize\\empty",size))
+ texsprint(ctxcatcodes,"\\let\\somefontsize\\empty")
end
specification = define.makespecification(str,lookup,name,sub,method,detail,size)
end
local n = 0
-function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfallbacks,fontfallbacks,mathsize,textsize)
+-- we can also move rscale to here (more consistent)
+
+function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfallbacks,fontfallbacks,mathsize,textsize,relativeid)
+ if trace_defining then
+ logs.report("define font","memory usage before: %s",statistics.memused())
+ end
-- name is now resolved and size is scaled cf sa/mo
local lookup, name, sub, method, detail = get_specification(str or "")
-- asome settings can be overloaded
- if lookup and lookup ~= "" then specification.lookup = lookup end
+ if lookup and lookup ~= "" then
+ specification.lookup = lookup
+ end
+ if relativeid and relativeid ~= "" then -- experimental hook
+ local id = tonumber(relativeid) or 0
+ specification.relativeid = id > 0 and id
+ end
specification.name = name
specification.size = size
- specification.sub = sub
+ specification.sub = (sub and sub ~= "" and sub) or specification.sub
specification.mathsize = mathsize
specification.textsize = textsize
if detail and detail ~= "" then
@@ -340,9 +362,6 @@ function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfal
elseif classfeatures and classfeatures ~= "" then
specification.method, specification.detail = "*", classfeatures
end
- if trace_defining then
- logs.report("define font","memory usage before: %s",statistics.memused())
- end
if fontfallbacks and fontfallbacks ~= "" then
specification.fallbacks = fontfallbacks
elseif classfallbacks and classfallbacks ~= "" then
@@ -351,6 +370,7 @@ function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfal
local tfmdata = define.read(specification,size) -- id not yet known
if not tfmdata then
logs.report("define font","unable to define %s as \\%s",name,cs)
+ texsetcount("global","lastfontid",-1)
elseif type(tfmdata) == "number" then
if trace_defining then
logs.report("define font","reusing %s with id %s as \\%s (features: %s/%s, fallbacks: %s/%s)",name,tfmdata,cs,classfeatures,fontfeatures,classfallbacks,fontfallbacks)
@@ -358,6 +378,7 @@ function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfal
tex.definefont(global,cs,tfmdata)
-- resolved (when designsize is used):
texsprint(ctxcatcodes,format("\\def\\somefontsize{%isp}",fontdata[tfmdata].size))
+ texsetcount("global","lastfontid",tfmdata)
else
-- local t = os.clock(t)
local id = font.define(tfmdata)
@@ -374,6 +395,7 @@ function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfal
--~ if specification.fallbacks then
--~ fonts.collections.prepare(specification.fallbacks)
--~ end
+ texsetcount("global","lastfontid",id)
end
if trace_defining then
logs.report("define font","memory usage after: %s",statistics.memused())
@@ -381,6 +403,28 @@ function define.command_2(global,cs,str,size,classfeatures,fontfeatures,classfal
statistics.stoptiming(fonts)
end
+local enable_auto_r_scale = false
+
+experiments.register("fonts.autorscale", function(v)
+ enable_auto_r_scale = v
+end)
+
+local calculate_scale = fonts.tfm.calculate_scale
+
+function fonts.tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
+ local scaledpoints, delta, units = calculate_scale(tfmtable, scaledpoints, relativeid)
+ if enable_auto_r_scale and relativeid then -- for the moment this is rather context specific
+ local relativedata = fontdata[relativeid]
+ local id_x_height = relativedata and relativedata.parameters and relativedata.parameters.x_height
+ local tf_x_height = id_x_height and tfmtable.parameters and tfmtable.parameters.x_height * delta
+ if tf_x_height then
+ scaledpoints = (id_x_height/tf_x_height) * scaledpoints
+ delta = scaledpoints/units
+ end
+ end
+ return scaledpoints, delta, units
+end
+
--~ table.insert(readers.sequence,1,'vtf')
--~ function readers.vtf(specification)
@@ -390,3 +434,191 @@ end
--~ return nil
--~ end
--~ end
+
+-- we need a place for this .. outside the generic scope
+
+local dimenfactors = number.dimenfactors
+
+function fonts.dimenfactor(unit,tfmdata)
+ if unit == "ex" then
+ return (tfmdata and tfmdata.parameters.x_height) or 655360
+ elseif unit == "em" then
+ return (tfmdata and tfmdata.parameters.em_height) or 655360
+ else
+ return dimenfactors[unit] or unit
+ end
+end
+
+function fonts.cleanname(name)
+ texsprint(ctxcatcodes,fonts.names.cleanname(name))
+end
+
+local p, f = 1, "%0.1fpt" -- normally this value is changed only once
+
+local stripper = lpeg.patterns.strip_zeros
+
+function fonts.nbfs(amount,precision)
+ if precision ~= p then
+ p = precision
+ f = "%0." .. p .. "fpt"
+ end
+ texsprint(ctxcatcodes,lpegmatch(stripper,format(f,amount/65536)))
+end
+
+-- for the moment here, this will become a chain of extras that is
+-- hooked into the ctx registration (or scaler or ...)
+
+function fonts.set_digit_width(font)
+ local tfmtable = fontdata[font]
+ local parameters = tfmtable.parameters
+ local width = parameters.digitwidth
+ if not width then
+ width = round(parameters.quad/2) -- maybe tex.scale
+ local characters = tfmtable.characters
+ for i=48,57 do
+ local wd = round(characters[i].width)
+ if wd > width then
+ width = wd
+ end
+ end
+ parameters.digitwidth = width
+ end
+ return width
+end
+
+fonts.get_digit_width = fonts.set_digit_width
+
+-- soon to be obsolete:
+
+local loaded = { -- prevent loading (happens in cont-sys files)
+ ["original-base.map" ] = true,
+ ["original-ams-base.map" ] = true,
+ ["original-ams-euler.map"] = true,
+ ["original-public-lm.map"] = true,
+}
+
+function fonts.map.loadfile(name)
+ name = file.addsuffix(name,"map")
+ if not loaded[name] then
+ pdf.mapfile(name)
+ loaded[name] = true
+ end
+end
+
+local loaded = { -- prevent double loading
+}
+
+function fonts.map.loadline(how,line)
+ if line then
+ how = how .. " " .. line
+ elseif how == "" then
+ how = "= " .. line
+ end
+ if not loaded[how] then
+ pdf.mapline(how)
+ loaded[how] = true
+ end
+end
+
+function fonts.map.reset()
+ pdf.mapfile("")
+end
+
+fonts.map.reset() -- resets the default file
+
+-- we need an 'do after the banner hook'
+
+-- pdf.mapfile("mkiv-base.map") -- loads the default file
+
+local nounicode = byte("?")
+
+local function name_to_slot(name) -- maybe some day rawdata
+ local tfmdata = fonts.ids[font.current()]
+ local shared = tfmdata and tfmdata.shared
+ local fntdata = shared and shared.otfdata or shared.afmdata
+ if fntdata then
+ local unicode = fntdata.luatex.unicodes[name]
+ if not unicode then
+ return nounicode
+ elseif type(unicode) == "number" then
+ return unicode
+ else -- multiple unicodes
+ return unicode[1]
+ end
+ end
+ return nounicode
+end
+
+fonts.name_to_slot = name_to_slot
+
+function fonts.char(n) -- todo: afm en tfm
+ if type(n) == "string" then
+ n = name_to_slot(n)
+ end
+ if type(n) == "number" then
+ texsprint(ctxcatcodes,format("\\char%s ",n))
+ end
+end
+
+-- moved from ini:
+
+fonts.color = { } -- dummy in ini
+
+local attribute = attributes.private('color')
+local mapping = (attributes and attributes.list[attribute]) or { }
+
+local set_attribute = node.set_attribute
+local unset_attribute = node.unset_attribute
+
+function fonts.color.set(n,c)
+ local mc = mapping[c]
+ if not mc then
+ unset_attribute(n,attribute)
+ else
+ set_attribute(n,attribute,mc)
+ end
+end
+
+function fonts.color.reset(n)
+ unset_attribute(n,attribute)
+end
+
+-- this will become obsolete:
+
+fonts.otf.name_to_slot = name_to_slot
+fonts.afm.name_to_slot = name_to_slot
+
+fonts.otf.char = fonts.char
+fonts.afm.char = fonts.char
+
+-- this will change ...
+
+function fonts.show_char_data(n)
+ local tfmdata = fonts.ids[font.current()]
+ if tfmdata then
+ if type(n) == "string" then
+ n = utf.byte(n)
+ end
+ local chr = tfmdata.characters[n]
+ if chr then
+ write_nl(format("%s @ %s => U%04X => %s => ",tfmdata.fullname,tfmdata.size,n,utf.char(n)) .. serialize(chr,false))
+ end
+ end
+end
+
+function fonts.show_font_parameters()
+ local tfmdata = fonts.ids[font.current()]
+ if tfmdata then
+ local parameters, mathconstants = tfmdata.parameters, tfmdata.MathConstants
+ local hasparameters, hasmathconstants = parameters and next(parameters), mathconstants and next(mathconstants)
+ if hasparameters then
+ write_nl(format("%s @ %s => parameters => ",tfmdata.fullname,tfmdata.size) .. serialize(parameters,false))
+ end
+ if hasmathconstants then
+ write_nl(format("%s @ %s => math constants => ",tfmdata.fullname,tfmdata.size) .. serialize(mathconstants,false))
+ end
+ if not hasparameters and not hasmathconstants then
+ write_nl(format("%s @ %s => no parameters and/or mathconstants",tfmdata.fullname,tfmdata.size))
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/font-def.lua b/Master/texmf-dist/tex/context/base/font-def.lua
index 28afe670b55..c3b10162ce6 100644
--- a/Master/texmf-dist/tex/context/base/font-def.lua
+++ b/Master/texmf-dist/tex/context/base/font-def.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-def'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -8,8 +8,10 @@ if not modules then modules = { } end modules ['font-def'] = {
local format, concat, gmatch, match, find, lower = string.format, table.concat, string.gmatch, string.match, string.find, string.lower
local tostring, next = tostring, next
+local lpegmatch = lpeg.match
-local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
+local trace_defining = false trackers .register("fonts.defining", function(v) trace_defining = v end)
+local directive_embedall = false directives.register("fonts.embedall", function(v) directive_embedall = v end)
trackers.register("fonts.loading", "fonts.defining", "otf.loading", "afm.loading", "tfm.loading")
trackers.register("fonts.all", "fonts.*", "otf.*", "afm.*", "tfm.*")
@@ -77,22 +79,37 @@ and prepares a table that will move along as we proceed.</p>
local splitter, specifiers = nil, ""
+local P, C, S, Cc = lpeg.P, lpeg.C, lpeg.S, lpeg.Cc
+
+local left = P("(")
+local right = P(")")
+local colon = P(":")
+local space = P(" ")
+
+define.defaultlookup = "file"
+
+local prefixpattern = P(false)
+
function define.add_specifier(symbol)
specifiers = specifiers .. symbol
- local left = lpeg.P("(")
- local right = lpeg.P(")")
- local colon = lpeg.P(":")
- local method = lpeg.S(specifiers)
- local lookup = lpeg.C(lpeg.P("file")+lpeg.P("name")) * colon -- hard test, else problems with : method
- local sub = left * lpeg.C(lpeg.P(1-left-right-method)^1) * right
---~ local specification = lpeg.C(method) * lpeg.C(lpeg.P(1-method)^1)
- local specification = lpeg.C(method) * lpeg.C(lpeg.P(1)^1)
- local name = lpeg.C((1-sub-specification)^1)
- splitter = lpeg.P((lookup + lpeg.Cc("")) * name * (sub + lpeg.Cc("")) * (specification + lpeg.Cc("")))
+ local method = S(specifiers)
+ local lookup = C(prefixpattern) * colon
+ local sub = left * C(P(1-left-right-method)^1) * right
+ local specification = C(method) * C(P(1)^1)
+ local name = C((1-sub-specification)^1)
+ splitter = P((lookup + Cc("")) * name * (sub + Cc("")) * (specification + Cc("")))
end
+function define.add_lookup(str,default)
+ prefixpattern = prefixpattern + P(str)
+end
+
+define.add_lookup("file")
+define.add_lookup("name")
+define.add_lookup("spec")
+
function define.get_specification(str)
- return splitter:match(str)
+ return lpegmatch(splitter,str)
end
function define.register_split(symbol,action)
@@ -111,8 +128,8 @@ function define.makespecification(specification, lookup, name, sub, method, deta
--~ lookup = specification.lookup -- can come from xetex [] syntax
--~ specification.lookup = nil
--~ end
- if lookup ~= 'name' then -- for the moment only two lookups, maybe some day also system:
- lookup = 'file'
+ if not lookup or lookup == "" then
+ lookup = define.defaultlookup
end
local t = {
lookup = lookup, -- forced type
@@ -132,7 +149,7 @@ end
function define.analyze(specification, size)
-- can be optimized with locals
local lookup, name, sub, method, detail = define.get_specification(specification or "")
- return define.makespecification(specification,lookup, name, sub, method, detail, size)
+ return define.makespecification(specification, lookup, name, sub, method, detail, size)
end
--[[ldx--
@@ -214,17 +231,44 @@ end
<p>We can resolve the filename using the next function:</p>
--ldx]]--
+define.resolvers = resolvers
+
+function define.resolvers.file(specification)
+ specification.forced = file.extname(specification.name)
+ specification.name = file.removesuffix(specification.name)
+end
+
+function define.resolvers.name(specification)
+ local resolve = fonts.names.resolve
+ if resolve then
+ specification.resolved, specification.sub = fonts.names.resolve(specification.name,specification.sub)
+ if specification.resolved then
+ specification.forced = file.extname(specification.resolved)
+ specification.name = file.removesuffix(specification.resolved)
+ end
+ else
+ define.resolvers.file(specification)
+ end
+end
+
+function define.resolvers.spec(specification)
+ local resolvespec = fonts.names.resolvespec
+ if resolvespec then
+ specification.resolved, specification.sub = fonts.names.resolvespec(specification.name,specification.sub)
+ if specification.resolved then
+ specification.forced = file.extname(specification.resolved)
+ specification.name = file.removesuffix(specification.resolved)
+ end
+ else
+ define.resolvers.name(specification)
+ end
+end
+
function define.resolve(specification)
if not specification.resolved or specification.resolved == "" then -- resolved itself not per se in mapping hash
- if specification.lookup == 'name' then
- specification.resolved, specification.sub = fonts.names.resolve(specification.name,specification.sub)
- if specification.resolved then
- specification.forced = file.extname(specification.resolved)
- specification.name = file.removesuffix(specification.resolved)
- end
- elseif specification.lookup == 'file' then
- specification.forced = file.extname(specification.name)
- specification.name = file.removesuffix(specification.name)
+ local r = define.resolvers[specification.lookup]
+ if r then
+ r(specification)
end
end
if specification.forced == "" then
@@ -232,7 +276,6 @@ function define.resolve(specification)
else
specification.forced = specification.forced
end
---~ specification.hash = specification.name .. ' @ ' .. tfm.hash_features(specification)
specification.hash = lower(specification.name .. ' @ ' .. tfm.hash_features(specification))
if specification.sub and specification.sub ~= "" then
specification.hash = specification.sub .. ' @ ' .. specification.hash
@@ -271,7 +314,7 @@ function tfm.read(specification)
local reader = sequence[s]
if readers[reader] then -- not really needed
if trace_defining then
- logs.report("define font","trying (sequence driven) type %s for %s with file %s",reader,specification.name,specification.filename or "unknown")
+ logs.report("define font","trying (reader sequence driven) type %s for %s with file %s",reader,specification.name,specification.filename or "unknown")
end
tfmtable = readers[reader](specification)
if tfmtable then
@@ -283,7 +326,9 @@ function tfm.read(specification)
end
end
if tfmtable then
- if tfmtable.filename and fonts.dontembed[tfmtable.filename] then
+ if directive_embedall then
+ tfmtable.embedding = "full"
+ elseif tfmtable.filename and fonts.dontembed[tfmtable.filename] then
tfmtable.embedding = "no"
else
tfmtable.embedding = "subset"
@@ -406,16 +451,22 @@ function readers.afm(specification,method)
return tfmtable
end
-local function check_otf(specification,suffix,what)
- local fullname, tfmtable = resolvers.findbinfile(specification.name,suffix) or "", nil
+-- maybe some day a set of names
+
+local function check_otf(forced,specification,suffix,what)
+ local name = specification.name
+ if forced then
+ name = file.addsuffix(name,suffix)
+ end
+ local fullname, tfmtable = resolvers.findbinfile(name,suffix) or "", nil -- one shot
if fullname == "" then
- local fb = fonts.names.old_to_new[specification.name]
+ local fb = fonts.names.old_to_new[name]
if fb then
fullname = resolvers.findbinfile(fb,suffix) or ""
end
end
if fullname == "" then
- local fb = fonts.names.new_to_old[specification.name]
+ local fb = fonts.names.new_to_old[name]
if fb then
fullname = resolvers.findbinfile(fb,suffix) or ""
end
@@ -430,13 +481,11 @@ end
function readers.opentype(specification,suffix,what)
local forced = specification.forced or ""
if forced == "otf" then
- return check_otf(specification,forced,"opentype")
- elseif forced == "ttf" then
- return check_otf(specification,forced,"truetype")
- elseif forced == "ttf" then
- return check_otf(specification,forced,"truetype")
+ return check_otf(true,specification,forced,"opentype")
+ elseif forced == "ttf" or forced == "ttc" or forced == "dfont" then
+ return check_otf(true,specification,forced,"truetype")
else
- return check_otf(specification,suffix,what)
+ return check_otf(false,specification,suffix,what)
end
end
@@ -452,14 +501,14 @@ a helper function.</p>
function define.check(features,defaults) -- nb adapts features !
local done = false
- if table.is_empty(features) then
- features, done = table.fastcopy(defaults), true
- else
+ if features and next(features) then
for k,v in next, defaults do
if features[k] == nil then
features[k], done = v, true
end
end
+ else
+ features, done = table.fastcopy(defaults), true
end
return features, done -- done signals a change
end
@@ -485,7 +534,10 @@ function define.register(fontdata,id)
if trace_defining then
logs.report("define font","loading at 2 id %s, hash: %s",id or "?",hash or "?")
end
- fonts.ids[id] = fontdata
+ fonts.identifiers[id] = fontdata
+ fonts.characters [id] = fontdata.characters
+ fonts.quads [id] = fontdata.parameters.quad
+ -- todo: extra functions, e.g. setdigitwidth etc in list
tfm.internalized[hash] = id
end
end
@@ -595,5 +647,5 @@ end
<p>We overload both the <l n='tfm'/> and <l n='vf'/> readers.</p>
--ldx]]--
-callback.register('define_font' , define.read)
-callback.register('find_vf_file', vf.find ) -- not that relevant any more
+callbacks.register('define_font' , define.read, "definition of fonts (tfmtable preparation)")
+callbacks.register('find_vf_file', vf.find , "locating virtual fonts, insofar needed") -- not that relevant any more
diff --git a/Master/texmf-dist/tex/context/base/font-dum.lua b/Master/texmf-dist/tex/context/base/font-dum.lua
index ef267a42c14..0a9bcd301d5 100644
--- a/Master/texmf-dist/tex/context/base/font-dum.lua
+++ b/Master/texmf-dist/tex/context/base/font-dum.lua
@@ -10,8 +10,9 @@ fonts = fonts or { }
-- general
-fonts.otf.pack = false
-fonts.tfm.resolve_vf = false -- no sure about this
+fonts.otf.pack = false -- only makes sense in context
+fonts.tfm.resolve_vf = false -- no sure about this
+fonts.tfm.fontname_mode = "specification" -- somehow latex needs this
-- readers
@@ -39,52 +40,56 @@ function fonts.logger.save()
end
-- names
+--
+-- Watch out, the version number is the same as the one used in
+-- the mtx-fonts.lua function scripts.fonts.names as we use a
+-- simplified font database in the plain solution and by using
+-- a different number we're less dependent on context.
fonts.names = fonts.names or { }
+fonts.names.version = 1.001 -- not the same as in context
fonts.names.basename = "luatex-fonts-names.lua"
fonts.names.new_to_old = { }
fonts.names.old_to_new = { }
local data, loaded = nil, false
+local fileformats = { "lua", "tex", "other text files" }
+
function fonts.names.resolve(name,sub)
if not loaded then
local basename = fonts.names.basename
if basename and basename ~= "" then
- for _, format in ipairs { "lua", "tex", "other text files" } do
+ for i=1,#fileformats do
+ local format = fileformats[i]
local foundname = resolvers.find_file(basename,format) or ""
if foundname ~= "" then
data = dofile(foundname)
- if data then
- local d = { }
- for k, v in pairs(data.mapping) do
- local t = v[1]
- if t == "ttf" or t == "otf" or t == "ttc" or t == "dfont" then
- d[k] = v
- end
- end
- data.mapping = d
- end
break
end
end
end
loaded = true
end
- if type(data) == "table" and data.version == 1.08 then
+ if type(data) == "table" and data.version == fonts.names.version then
local condensed = string.gsub(string.lower(name),"[^%a%d]","")
- local found = data.mapping and data.mapping[condensed]
+ local found = data.mappings and data.mappings[condensed]
if found then
- local filename, is_sub = found[3], found[4]
- if is_sub then is_sub = found[2] end
- return filename, is_sub
+ local fontname, filename, subfont = found[1], found[2], found[3]
+ if subfont then
+ return filename, fontname
+ else
+ return filename, false
+ end
else
return name, false -- fallback to filename
end
end
end
+fonts.names.resolvespec = fonts.names.resolve -- only supported in mkiv
+
-- For the moment we put this (adapted) pseudo feature here.
table.insert(fonts.triggers,"itlc")
@@ -112,5 +117,185 @@ end
fonts.initializers.base.otf.itlc = itlc
fonts.initializers.node.otf.itlc = itlc
+-- slant and extend
+
+function fonts.initializers.common.slant(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 1 then
+ value = 1
+ elseif value < -1 then
+ value = -1
+ end
+ tfmdata.slant_factor = value
+end
+
+function fonts.initializers.common.extend(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 10 then
+ value = 10
+ elseif value < -10 then
+ value = -10
+ end
+ tfmdata.extend_factor = value
+end
+
+table.insert(fonts.triggers,"slant")
+table.insert(fonts.triggers,"extend")
+
+fonts.initializers.base.otf.slant = fonts.initializers.common.slant
+fonts.initializers.node.otf.slant = fonts.initializers.common.slant
+fonts.initializers.base.otf.extend = fonts.initializers.common.extend
+fonts.initializers.node.otf.extend = fonts.initializers.common.extend
+
+-- expansion and protrusion
+
+fonts.protrusions = fonts.protrusions or { }
+fonts.protrusions.setups = fonts.protrusions.setups or { }
+
+local setups = fonts.protrusions.setups
+
+function fonts.initializers.common.protrusion(tfmdata,value)
+ if value then
+ local setup = setups[value]
+ if setup then
+ local factor, left, right = setup.factor or 1, setup.left or 1, setup.right or 1
+ local emwidth = tfmdata.parameters.quad
+ tfmdata.auto_protrude = true
+ for i, chr in next, tfmdata.characters do
+ local v, pl, pr = setup[i], nil, nil
+ if v then
+ pl, pr = v[1], v[2]
+ end
+ if pl and pl ~= 0 then chr.left_protruding = left *pl*factor end
+ if pr and pr ~= 0 then chr.right_protruding = right*pr*factor end
+ end
+ end
+ end
+end
+
+fonts.expansions = fonts.expansions or { }
+fonts.expansions.setups = fonts.expansions.setups or { }
+
+local setups = fonts.expansions.setups
+
+function fonts.initializers.common.expansion(tfmdata,value)
+ if value then
+ local setup = setups[value]
+ if setup then
+ local stretch, shrink, step, factor = setup.stretch or 0, setup.shrink or 0, setup.step or 0, setup.factor or 1
+ tfmdata.stretch, tfmdata.shrink, tfmdata.step, tfmdata.auto_expand = stretch * 10, shrink * 10, step * 10, true
+ for i, chr in next, tfmdata.characters do
+ local v = setup[i]
+ if v and v ~= 0 then
+ chr.expansion_factor = v*factor
+ else -- can be option
+ chr.expansion_factor = factor
+ end
+ end
+ end
+ end
+end
+
+table.insert(fonts.manipulators,"protrusion")
+table.insert(fonts.manipulators,"expansion")
+
+fonts.initializers.base.otf.protrusion = fonts.initializers.common.protrusion
+fonts.initializers.node.otf.protrusion = fonts.initializers.common.protrusion
+fonts.initializers.base.otf.expansion = fonts.initializers.common.expansion
+fonts.initializers.node.otf.expansion = fonts.initializers.common.expansion
+
+-- left over
+
function fonts.register_message()
end
+
+-- example vectors
+
+local byte = string.byte
+
+fonts.expansions.setups['default'] = {
+
+ stretch = 2, shrink = 2, step = .5, factor = 1,
+
+ [byte('A')] = 0.5, [byte('B')] = 0.7, [byte('C')] = 0.7, [byte('D')] = 0.5, [byte('E')] = 0.7,
+ [byte('F')] = 0.7, [byte('G')] = 0.5, [byte('H')] = 0.7, [byte('K')] = 0.7, [byte('M')] = 0.7,
+ [byte('N')] = 0.7, [byte('O')] = 0.5, [byte('P')] = 0.7, [byte('Q')] = 0.5, [byte('R')] = 0.7,
+ [byte('S')] = 0.7, [byte('U')] = 0.7, [byte('W')] = 0.7, [byte('Z')] = 0.7,
+ [byte('a')] = 0.7, [byte('b')] = 0.7, [byte('c')] = 0.7, [byte('d')] = 0.7, [byte('e')] = 0.7,
+ [byte('g')] = 0.7, [byte('h')] = 0.7, [byte('k')] = 0.7, [byte('m')] = 0.7, [byte('n')] = 0.7,
+ [byte('o')] = 0.7, [byte('p')] = 0.7, [byte('q')] = 0.7, [byte('s')] = 0.7, [byte('u')] = 0.7,
+ [byte('w')] = 0.7, [byte('z')] = 0.7,
+ [byte('2')] = 0.7, [byte('3')] = 0.7, [byte('6')] = 0.7, [byte('8')] = 0.7, [byte('9')] = 0.7,
+}
+
+fonts.protrusions.setups['default'] = {
+
+ factor = 1, left = 1, right = 1,
+
+ [0x002C] = { 0, 1 }, -- comma
+ [0x002E] = { 0, 1 }, -- period
+ [0x003A] = { 0, 1 }, -- colon
+ [0x003B] = { 0, 1 }, -- semicolon
+ [0x002D] = { 0, 1 }, -- 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 ۔
+
+}
+
+-- normalizer
+
+fonts.otf.meanings = fonts.otf.meanings or { }
+
+fonts.otf.meanings.normalize = fonts.otf.meanings.normalize or function(t)
+ if t.rand then
+ t.rand = "random"
+ end
+end
+
+-- bonus
+
+function fonts.otf.name_to_slot(name)
+ local tfmdata = fonts.ids[font.current()]
+ if tfmdata and tfmdata.shared then
+ local otfdata = tfmdata.shared.otfdata
+ local unicode = otfdata.luatex.unicodes[name]
+ return unicode and (type(unicode) == "number" and unicode or unicode[1])
+ end
+end
+
+function fonts.otf.char(n)
+ if type(n) == "string" then
+ n = fonts.otf.name_to_slot(n)
+ end
+ if type(n) == "number" then
+ tex.sprint("\\char" .. n)
+ end
+end
+
+-- another one:
+
+fonts.strippables = table.tohash {
+ 0x000AD, 0x017B4, 0x017B5, 0x0200B, 0x0200C, 0x0200D, 0x0200E, 0x0200F, 0x0202A, 0x0202B,
+ 0x0202C, 0x0202D, 0x0202E, 0x02060, 0x02061, 0x02062, 0x02063, 0x0206A, 0x0206B, 0x0206C,
+ 0x0206D, 0x0206E, 0x0206F, 0x0FEFF, 0x1D173, 0x1D174, 0x1D175, 0x1D176, 0x1D177, 0x1D178,
+ 0x1D179, 0x1D17A, 0xE0001, 0xE0020, 0xE0021, 0xE0022, 0xE0023, 0xE0024, 0xE0025, 0xE0026,
+ 0xE0027, 0xE0028, 0xE0029, 0xE002A, 0xE002B, 0xE002C, 0xE002D, 0xE002E, 0xE002F, 0xE0030,
+ 0xE0031, 0xE0032, 0xE0033, 0xE0034, 0xE0035, 0xE0036, 0xE0037, 0xE0038, 0xE0039, 0xE003A,
+ 0xE003B, 0xE003C, 0xE003D, 0xE003E, 0xE003F, 0xE0040, 0xE0041, 0xE0042, 0xE0043, 0xE0044,
+ 0xE0045, 0xE0046, 0xE0047, 0xE0048, 0xE0049, 0xE004A, 0xE004B, 0xE004C, 0xE004D, 0xE004E,
+ 0xE004F, 0xE0050, 0xE0051, 0xE0052, 0xE0053, 0xE0054, 0xE0055, 0xE0056, 0xE0057, 0xE0058,
+ 0xE0059, 0xE005A, 0xE005B, 0xE005C, 0xE005D, 0xE005E, 0xE005F, 0xE0060, 0xE0061, 0xE0062,
+ 0xE0063, 0xE0064, 0xE0065, 0xE0066, 0xE0067, 0xE0068, 0xE0069, 0xE006A, 0xE006B, 0xE006C,
+ 0xE006D, 0xE006E, 0xE006F, 0xE0070, 0xE0071, 0xE0072, 0xE0073, 0xE0074, 0xE0075, 0xE0076,
+ 0xE0077, 0xE0078, 0xE0079, 0xE007A, 0xE007B, 0xE007C, 0xE007D, 0xE007E, 0xE007F,
+}
+
diff --git a/Master/texmf-dist/tex/context/base/font-enc.lua b/Master/texmf-dist/tex/context/base/font-enc.lua
index faeae3a1084..874f7c3f4ed 100644
--- a/Master/texmf-dist/tex/context/base/font-enc.lua
+++ b/Master/texmf-dist/tex/context/base/font-enc.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-enc'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -17,7 +17,7 @@ fonts.enc = fonts.enc or { }
fonts.enc.version = 1.03
fonts.enc.cache = containers.define("fonts", "enc", fonts.enc.version, true)
-fonts.enc.known = {
+fonts.enc.known = { -- sort of obsolete
texnansi = true,
ec = true,
qx = true,
diff --git a/Master/texmf-dist/tex/context/base/font-enh.lua b/Master/texmf-dist/tex/context/base/font-enh.lua
new file mode 100644
index 00000000000..fc70c04c566
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/font-enh.lua
@@ -0,0 +1,201 @@
+if not modules then modules = { } end modules ['font-enh'] = {
+ 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 next, match = next, string.match
+
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
+
+-- tfmdata has also fast access to indices and unicodes
+-- to be checked: otf -> tfm -> tfmscaled
+--
+-- watch out: no negative depths and negative eights permitted in regular fonts
+
+--[[ldx--
+<p>Here we only implement a few helper functions.</p>
+--ldx]]--
+
+local tfm = fonts.tfm
+
+--[[ldx--
+<p>The next function encapsulates the standard <l n='tfm'/> loader as
+supplied by <l n='luatex'/>.</p>
+--ldx]]--
+
+-- auto complete font with missing composed characters
+
+table.insert(fonts.manipulators,"compose")
+
+function fonts.initializers.common.compose(tfmdata,value)
+ if value then
+ fonts.vf.aux.compose_characters(tfmdata)
+ end
+end
+
+-- tfm features, experimental
+
+tfm.features = tfm.features or { }
+tfm.features.list = tfm.features.list or { }
+tfm.features.default = tfm.features.default or { }
+
+function tfm.enhance(tfmdata,specification)
+ -- we don't really share tfm data because we always reload
+ -- but this is more in sycn with afm and such
+ local features = (specification.features and specification.features.normal ) or { }
+ tfmdata.shared = tfmdata.shared or { }
+ tfmdata.shared.features = features
+ -- tfmdata.shared.tfmdata = tfmdata -- circular
+ tfmdata.filename = specification.name
+ if not features.encoding then
+ local name, size = specification.name, specification.size
+ local encoding, filename = match(name,"^(.-)%-(.*)$") -- context: encoding-name.*
+ if filename and encoding and fonts.enc.known[encoding] then
+ features.encoding = encoding
+ end
+ end
+ tfm.set_features(tfmdata)
+end
+
+function tfm.set_features(tfmdata)
+ -- todo: no local functions
+ local shared = tfmdata.shared
+-- local tfmdata = shared.tfmdata
+ local features = shared.features
+ if features and next(features) then
+ local mode = tfmdata.mode or fonts.mode
+ local fi = fonts.initializers[mode]
+ if fi and fi.tfm then
+ local function initialize(list) -- using tex lig and kerning
+ if list then
+ for i=1,#list do
+ local f = list[i]
+ local value = features[f]
+ if value and fi.tfm[f] then -- brr
+ if tfm.trace_features then
+ logs.report("define font","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown')
+ end
+ fi.tfm[f](tfmdata,value)
+ mode = tfmdata.mode or fonts.mode
+ fi = fonts.initializers[mode]
+ end
+ end
+ end
+ end
+ initialize(fonts.triggers)
+ initialize(tfm.features.list)
+ initialize(fonts.manipulators)
+ end
+ local fm = fonts.methods[mode]
+ if fm and fm.tfm then
+ local function register(list) -- node manipulations
+ if list then
+ for i=1,#list do
+ local f = list[i]
+ if features[f] and fm.tfm[f] then -- brr
+ if not shared.processors then -- maybe also predefine
+ shared.processors = { fm.tfm[f] }
+ else
+ shared.processors[#shared.processors+1] = fm.tfm[f]
+ end
+ end
+ end
+ end
+ end
+ register(tfm.features.list)
+ end
+ end
+end
+
+function tfm.features.register(name,default)
+ tfm.features.list[#tfm.features.list+1] = name
+ tfm.features.default[name] = default
+end
+
+function tfm.reencode(tfmdata,encoding)
+ if encoding and fonts.enc.known[encoding] then
+ local data = fonts.enc.load(encoding)
+ if data then
+ local characters, original, vector = tfmdata.characters, { }, data.vector
+ tfmdata.encoding = encoding -- not needed
+ for k, v in next, characters do
+ v.name, v.index, original[k] = vector[k], k, v
+ end
+ for k,v in next, data.unicodes do
+ if k ~= v then
+ if trace_defining then
+ logs.report("define font","reencoding U+%04X to U+%04X",k,v)
+ end
+ characters[k] = original[v]
+ end
+ end
+ end
+ end
+end
+
+tfm.features.register('reencode')
+
+fonts.initializers.base.tfm.reencode = tfm.reencode
+fonts.initializers.node.tfm.reencode = tfm.reencode
+
+fonts.enc = fonts.enc or { }
+fonts.enc.remappings = fonts.enc.remappings or { }
+
+function tfm.remap(tfmdata,remapping)
+ local vector = remapping and fonts.enc.remappings[remapping]
+ if vector then
+ local characters, original = tfmdata.characters, { }
+ for k, v in next, characters do
+ original[k], characters[k] = v, nil
+ end
+ for k,v in next, vector do
+ if k ~= v then
+ if trace_defining then
+ logs.report("define font","remapping U+%04X to U+%04X",k,v)
+ end
+ local c = original[k]
+ characters[v] = c
+ c.index = k
+ end
+ end
+ tfmdata.encodingbytes = 2
+ tfmdata.format = 'type1'
+ end
+end
+
+tfm.features.register('remap')
+
+fonts.initializers.base.tfm.remap = tfm.remap
+fonts.initializers.node.tfm.remap = tfm.remap
+
+--~ obsolete
+--~
+--~ function tfm.enhance(tfmdata,specification)
+--~ local name, size = specification.name, specification.size
+--~ local encoding, filename = match(name,"^(.-)%-(.*)$") -- context: encoding-name.*
+--~ if filename and encoding and fonts.enc.known[encoding] then
+--~ local data = fonts.enc.load(encoding)
+--~ if data then
+--~ local characters = tfmdata.characters
+--~ tfmdata.encoding = encoding
+--~ local vector = data.vector
+--~ local original = { }
+--~ for k, v in next, characters do
+--~ v.name = vector[k]
+--~ v.index = k
+--~ original[k] = v
+--~ end
+--~ for k,v in next, data.unicodes do
+--~ if k ~= v then
+--~ if trace_defining then
+--~ logs.report("define font","mapping %s onto %s",k,v)
+--~ end
+--~ characters[k] = original[v]
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
diff --git a/Master/texmf-dist/tex/context/base/font-ext.lua b/Master/texmf-dist/tex/context/base/font-ext.lua
index 17c302c5325..05bdaf2fc3a 100644
--- a/Master/texmf-dist/tex/context/base/font-ext.lua
+++ b/Master/texmf-dist/tex/context/base/font-ext.lua
@@ -1,12 +1,20 @@
if not modules then modules = { } end modules ['font-ext'] = {
version = 1.001,
- comment = "companion to font-ini.tex and hand-ini.tex",
+ 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 utf = unicode.utf8
local next, type, byte = next, type, string.byte
+local gmatch, concat = string.gmatch, table.concat
+local utfchar = utf.char
+
+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)
+
+commands = commands or { }
--[[ldx--
<p>When we implement functions that deal with features, most of them
@@ -16,9 +24,11 @@ of neutral.</p>
fonts.triggers = fonts.triggers or { }
fonts.initializers = fonts.initializers or { }
+fonts.methods = fonts.methods or { }
fonts.initializers.common = fonts.initializers.common or { }
local initializers = fonts.initializers
+local methods = fonts.methods
--[[ldx--
<p>This feature will remove inter-digit kerns.</p>
@@ -81,116 +91,22 @@ function initializers.common.lineheight(tfmdata,value)
end
end
---[[ldx--
-<p>It does not make sense any more to support messed up encoding vectors
-so we stick to those that implement oldstyle and small caps. After all,
-we move on. We can extend the next function on demand. This features is
-only used with <l n='afm'/> files.</p>
---ldx]]--
+-- -- -- -- -- --
+-- shared
+-- -- -- -- -- --
---~ do
---~
---~ local smallcaps = lpeg.P(".sc") + lpeg.P(".smallcaps") + lpeg.P(".caps") + lpeg.P("small")
---~ local oldstyle = lpeg.P(".os") + lpeg.P(".oldstyle") + lpeg.P(".onum")
---~
---~ smallcaps = lpeg.Cs((1-smallcaps)^1) * smallcaps^1
---~ oldstyle = lpeg.Cs((1-oldstyle )^1) * oldstyle ^1
---~
---~ function initializers.common.encoding(tfmdata,value)
---~ if value then
---~ local afmdata = tfmdata.shared.afmdata
---~ if afmdata then
---~ local encodingfile = value .. '.enc'
---~ local encoding = fonts.enc.load(encodingfile)
---~ if encoding then
---~ local vector = encoding.vector
---~ local characters = tfmdata.characters
---~ local unicodes = afmdata.luatex.unicodes
---~ local function remap(pattern,name)
---~ local p = pattern:match(name)
---~ if p then
---~ local oldchr, newchr = unicodes[p], unicodes[name]
---~ if oldchr and newchr and type(oldchr) == "number" and type(newchr) == "number" then
---~ -- logs.report("encoding","%s (%s) -> %s (%s)",p,oldchr or -1,name,newchr or -1)
---~ characters[oldchr] = characters[newchr]
---~ end
---~ end
---~ return p
---~ end
---~ for _, name in next, vector do
---~ local ok = remap(smallcaps,name) or remap(oldstyle,name)
---~ end
---~ if fonts.map.data[tfmdata.name] then
---~ fonts.map.data[tfmdata.name].encoding = encodingfile
---~ end
---~ end
---~ end
---~ end
---~ end
---~
---~ -- when needed we can provide this as features in e.g. afm files
---~
---~ function initializers.common.remap(tfmdata,value,pattern) -- will go away
---~ if value then
---~ local afmdata = tfmdata.shared.afmdata
---~ if afmdata then
---~ local characters = tfmdata.characters
---~ local descriptions = tfmdata.descriptions
---~ local unicodes = afmdata.luatex.unicodes
---~ local done = false
---~ for u, _ in next, characters do
---~ local name = descriptions[u].name
---~ if name then
---~ local p = pattern:match(name)
---~ if p then
---~ local oldchr, newchr = unicodes[p], unicodes[name]
---~ if oldchr and newchr and type(oldchr) == "number" and type(newchr) == "number" then
---~ characters[oldchr] = characters[newchr]
---~ end
---~ end
---~ end
---~ end
---~ end
---~ end
---~ end
---~
---~ function initializers.common.oldstyle(tfmdata,value)
---~ initializers.common.remap(tfmdata,value,oldstyle)
---~ end
---~ function initializers.common.smallcaps(tfmdata,value)
---~ initializers.common.remap(tfmdata,value,smallcaps)
---~ end
---~
---~ function initializers.common.fakecaps(tfmdata,value)
---~ if value then
---~ -- todo: scale down
---~ local afmdata = tfmdata.shared.afmdata
---~ if afmdata then
---~ local characters = tfmdata.characters
---~ local descriptions = tfmdata.descriptions
---~ local unicodes = afmdata.luatex.unicodes
---~ for u, _ in next, characters do
---~ local name = descriptions[u].name
---~ if name then
---~ local p = lower(name)
---~ if p then
---~ local oldchr, newchr = unicodes[p], unicodes[name]
---~ if oldchr and newchr and type(oldchr) == "number" and type(newchr) == "number" then
---~ characters[oldchr] = characters[newchr]
---~ end
---~ end
---~ end
---~ end
---~ end
---~ end
---~ end
---~
---~ end
---~
---~ function initializers.common.install(format,feature) -- 'afm','lineheight'
---~ initializers.base[format][feature] = initializers.common[feature]
---~ initializers.node[format][feature] = initializers.common[feature]
---~ end
+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 class = g_where and g_where[value] or f_where.classes[value]
+ if class then
+ local class_vector = class.vector
+ local g_vectors = g_where and g_where.vectors
+ local vector = g_vectors and g_vectors[class_vector] or f_where.vectors[class_vector]
+ return class, vector
+ end
+end
-- -- -- -- -- --
-- expansion (hz)
@@ -228,21 +144,37 @@ vectors['default'] = {
[byte('2')] = 0.7, [byte('3')] = 0.7, [byte('6')] = 0.7, [byte('8')] = 0.7, [byte('9')] = 0.7,
}
+vectors['quality'] = vectors['default'] -- metatable ?
+
+--~ function table.locator(...)
+--~ local k = { ... }
+--~ return function(t)
+--~ for i=1,#k do
+--~ t = t[k[i]]
+--~ if not k then
+--~ return false
+--~ end
+--~ end
+--~ return t
+--~ end
+--~ end
+
+--~ local locate = table.locator { "goodies", "expansions" }
+
function initializers.common.expansion(tfmdata,value)
if value then
- local class = classes[value]
+ local class, vector = get_class_and_vector(tfmdata,value,"expansions")
if class then
- local vector = vectors[class.vector]
if vector then
- tfmdata.stretch = (class.stretch or 0) * 10
- tfmdata.shrink = (class.shrink or 0) * 10
- tfmdata.step = (class.step or 0) * 10
- tfmdata.auto_expand = true
- local factor = class.factor or 1
- local data = characters.data
+ local stretch, shrink, step, factor = class.stretch or 0, class.shrink or 0, class.step or 0, class.factor or 1
+ if trace_expansion then
+ logs.report("fonts","set expansion class %s, vector: %s, factor: %s, stretch: %s, shrink: %s, step: %s",value,class_vector,factor,stretch,shrink,step)
+ end
+ tfmdata.stretch, tfmdata.shrink, tfmdata.step, tfmdata.auto_expand = stretch * 10, shrink * 10, step * 10, true
+ local data = characters and characters.data
for i, chr in next, tfmdata.characters do
local v = vector[i]
- if not v then
+ 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
@@ -261,7 +193,11 @@ function initializers.common.expansion(tfmdata,value)
chr.expansion_factor = factor
end
end
+ elseif trace_expansion then
+ logs.report("fonts","unknown expansion vector '%s' in class '%s",class_vector,value)
end
+ elseif trace_expansion then
+ logs.report("fonts","unknown expansion class '%s'",value)
end
end
end
@@ -274,6 +210,8 @@ initializers.node.otf.expansion = initializers.common.expansion
initializers.base.afm.expansion = initializers.common.expansion
initializers.node.afm.expansion = initializers.common.expansion
+fonts.goodies.register("expansions", function(...) return fonts.goodies.report("expansions", trace_expansion, ...) end)
+
-- -- -- -- -- --
-- protrusion
-- -- -- -- -- --
@@ -288,7 +226,7 @@ local vectors = fonts.protrusions.vectors
-- the values need to be revisioned
-classes.preset = { factor = 1 }
+classes.preset = { factor = 1, left = 1, right = 1 }
function commands.setupfontprotrusion(class,settings)
aux.getparameters(classes,class,'preset',settings)
@@ -392,41 +330,156 @@ vectors['quality'] = table.merge( {},
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, descriptions = tfmdata.characters, tfmdata.descriptions
+ local otfdata = tfmdata.shared.otfdata
+ local singles = otfdata.shared.featuredata.gpos_single
+ local script, language = tfmdata.script, tfmdata.language
+ 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
+ if opbd ~= "right" then
+ local validlookups, lookuplist = fonts.otf.collect_lookups(otfdata,"lfbd",script,language)
+ if validlookups then
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local data = singles[lookup]
+ if data then
+ if trace_protrusion then
+ logs.report("fonts","set left protrusion using lfbd lookup '%s'",lookup)
+ end
+ for k, v in next, data do
+ -- local p = - v[3] / descriptions[k].width-- or 1 ~= 0 too but the same
+ local p = - (v[1] / 1000) * factor * left
+ characters[k].left_protruding = p
+ if trace_protrusion then
+ logs.report("opbd","lfbd -> %s -> 0x%05X (%s) -> %0.03f (%s)",lookup,k,utfchar(k),p,concat(v," "))
+ end
+ end
+ done = true
+ end
+ end
+ end
+ end
+ if opbd ~= "left" then
+ local validlookups, lookuplist = fonts.otf.collect_lookups(otfdata,"rtbd",script,language)
+ if validlookups then
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local data = singles[lookup]
+ if data then
+ if trace_protrusion then
+ logs.report("fonts","set right protrusion using rtbd lookup '%s'",lookup)
+ end
+ for k, v in next, data do
+ -- local p = v[3] / descriptions[k].width -- or 3
+ local p = (v[1] / 1000) * factor * right
+ characters[k].right_protruding = p
+ if trace_protrusion then
+ logs.report("opbd","rtbd -> %s -> 0x%05X (%s) -> %0.03f (%s)",lookup,k,utfchar(k),p,concat(v," "))
+ end
+ end
+ end
+ done = true
+ end
+ end
+ end
+ tfmdata.auto_protrude = done
+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.
+
function initializers.common.protrusion(tfmdata,value)
if value then
- local class = classes[value]
- if class then
- local vector = vectors[class.vector]
- if vector then
- local factor = class.factor or 1
- local data = characters.data
- local emwidth = tfmdata.parameters.quad
- tfmdata.auto_protrude = true
- for i, chr in next, tfmdata.characters do
- local v, pl, pr = vector[i], nil, nil
- if v then
- pl, pr = v[1], 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, vr = vector[s[1]], 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, pr = v[1], v[2]
+ 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
+ logs.report("fonts","set protrusion class %s, vector: %s, factor: %s, left: %s, right: %s",value,class_vector,factor,left,right)
+ end
+ local data = characters.data
+ local emwidth = tfmdata.parameters.quad
+ tfmdata.auto_protrude = true
+ for i, chr in next, tfmdata.characters do
+ local v, pl, pr = vector[i], nil, nil
+ if v then
+ pl, pr = v[1], 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, vr = vector[s[1]], 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, pr = v[1], v[2]
+ end
end
end
end
+ if pl and pl ~= 0 then
+ chr.left_protruding = left *pl*factor
+ end
+ if pr and pr ~= 0 then
+ chr.right_protruding = right*pr*factor
+ end
end
- if pl and pl ~= 0 then chr.left_protruding = pl*factor end
- if pr and pr ~= 0 then chr.right_protruding = pr*factor end
+ elseif trace_protrusion then
+ logs.report("fonts","unknown protrusion vector '%s' in class '%s",class_vector,value)
end
+ elseif trace_protrusion then
+ logs.report("fonts","unknown protrusion class '%s'",value)
end
end
end
@@ -440,6 +493,10 @@ initializers.node.otf.protrusion = initializers.common.protrusion
initializers.base.afm.protrusion = initializers.common.protrusion
initializers.node.afm.protrusion = initializers.common.protrusion
+fonts.goodies.register("protrusions", function(...) return fonts.goodies.report("protrusions", trace_protrusion, ...) end)
+
+-- -- --
+
function initializers.common.nostackmath(tfmdata,value)
tfmdata.ignore_stack_math = value
end
@@ -477,3 +534,90 @@ initializers.node.otf.itlc = initializers.common.itlc
initializers.base.afm.itlc = initializers.common.itlc
initializers.node.afm.itlc = initializers.common.itlc
+
+-- slanting
+
+table.insert(fonts.triggers,"slant")
+
+function initializers.common.slant(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 1 then
+ value = 1
+ elseif value < -1 then
+ value = -1
+ end
+ tfmdata.slant_factor = value
+end
+
+initializers.base.otf.slant = initializers.common.slant
+initializers.node.otf.slant = initializers.common.slant
+
+initializers.base.afm.slant = initializers.common.slant
+initializers.node.afm.slant = initializers.common.slant
+
+table.insert(fonts.triggers,"extend")
+
+function initializers.common.extend(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 10 then
+ value = 10
+ elseif value < -10 then
+ value = -10
+ end
+ tfmdata.extend_factor = value
+end
+
+initializers.base.otf.extend = initializers.common.extend
+initializers.node.otf.extend = initializers.common.extend
+
+initializers.base.afm.extend = initializers.common.extend
+initializers.node.afm.extend = initializers.common.extend
+
+-- historic stuff, move from font-ota
+
+local delete_node = nodes.delete
+local glyph = node.id("glyph")
+local fontdata = fonts.ids
+
+fonts.strippables = fonts.strippables or { -- just a placeholder
+ [0x200C] = true, -- zwnj
+ [0x200D] = true, -- zwj
+}
+
+local strippables = fonts.strippables
+
+local function processformatters(head,font)
+ local how = fontdata[font].shared.features.formatters
+ if how == nil or how == "strip" then -- nil when forced
+ local current, done = head, false
+ while current do
+ if current.id == glyph and current.subtype<256 and current.font == font then
+ local char = current.char
+ if strippables[char] then
+ head, current = delete_node(head,current)
+ done = true
+ else
+ current = current.next
+ end
+ else
+ current = current.next
+ end
+ end
+ return head, done
+ else
+ return head, false
+ end
+end
+
+methods.node.otf.formatters = processformatters
+methods.base.otf.formatters = processformatters
+
+fonts.otf.tables.features['formatters'] = 'Hide Formatting Characters'
+
+fonts.otf.features.register("formatters")
+
+table.insert(fonts.manipulators,"formatters") -- at end
diff --git a/Master/texmf-dist/tex/context/base/font-fbk.lua b/Master/texmf-dist/tex/context/base/font-fbk.lua
index 6c4f78a3c54..1ad1cc781a8 100644
--- a/Master/texmf-dist/tex/context/base/font-fbk.lua
+++ b/Master/texmf-dist/tex/context/base/font-fbk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-fbk'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/font-gds.lua b/Master/texmf-dist/tex/context/base/font-gds.lua
new file mode 100644
index 00000000000..e3db8c816f8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/font-gds.lua
@@ -0,0 +1,294 @@
+if not modules then modules = { } end modules ['font-gds'] = {
+ version = 1.000,
+ comment = "companion to font-gds.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 gmatch = string.gmatch
+
+local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+
+-- goodies=name,colorscheme=,featureset=
+--
+-- goodies=auto
+
+-- goodies
+
+fonts.goodies = fonts.goodies or { }
+fonts.goodies.data = fonts.goodies.data or { }
+fonts.goodies.list = fonts.goodies.list or { }
+
+local data = fonts.goodies.data
+local list = fonts.goodies.list
+
+function fonts.goodies.report(what,trace,goodies)
+ if trace_goodies or trace then
+ local whatever = goodies[what]
+ if whatever then
+ logs.report("fonts", "goodie '%s' found in '%s'",what,goodies.name)
+ end
+ end
+end
+
+local function getgoodies(filename) -- maybe a merge is better
+ local goodies = data[filename] -- we assume no suffix is given
+ if goodies ~= nil then
+ -- found or tagged unfound
+ elseif type(filename) == "string" then
+ local fullname = resolvers.find_file(file.addsuffix(filename,"lfg")) or "" -- prefered suffix
+ if fullname == "" then
+ fullname = resolvers.find_file(file.addsuffix(filename,"lua")) or "" -- fallback suffix
+ end
+ if fullname == "" then
+ logs.report("fonts", "goodie file '%s.lfg' is not found",filename)
+ data[filename] = false -- signal for not found
+ else
+ goodies = dofile(fullname) or false
+ if not goodies then
+ logs.report("fonts", "goodie file '%s' is invalid",fullname)
+ return nil
+ elseif trace_goodies then
+ logs.report("fonts", "goodie file '%s' is loaded",fullname)
+ end
+ goodies.name = goodies.name or "no name"
+ for name, fnc in next, list do
+ fnc(goodies)
+ end
+ goodies.initialized = true
+ data[filename] = goodies
+ end
+ end
+ return goodies
+end
+
+function fonts.goodies.register(name,fnc)
+ list[name] = fnc
+end
+
+fonts.goodies.get = getgoodies
+
+-- register goodies file
+
+local preset_context = fonts.define.specify.preset_context
+
+function fonts.initializers.common.goodies(tfmdata,value)
+ local goodies = tfmdata.goodies or { } -- future versions might store goodies in the cached instance
+ for filename in gmatch(value,"[^, ]+") do
+ -- we need to check for duplicates
+ local ok = getgoodies(filename)
+ if ok then
+ goodies[#goodies+1] = ok
+ end
+ end
+ tfmdata.goodies = goodies -- shared ?
+end
+
+-- featuresets
+
+local function flattened(t,tt)
+ -- first set value dominates
+ local tt = tt or { }
+ for i=1,#t do
+ local ti = t[i]
+ if type(ti) == "table" then
+ flattened(ti,tt)
+ elseif tt[ti] == nil then
+ tt[ti] = true
+ end
+ end
+ for k, v in next, t do
+ if type(k) ~= "number" then
+ if type(v) == "table" then
+ flattened(v,tt)
+ elseif tt[k] == nil then
+ tt[k] = v
+ end
+ end
+ end
+ return tt
+end
+
+fonts.flattened_features = flattened
+
+function fonts.goodies.prepare_features(goodies,name,set)
+ if set then
+ local ff = fonts.flattened_features(set)
+ local fullname = goodies.name .. "::" .. name
+ local n, s = preset_context(fullname,"",ff)
+ goodies.featuresets[name] = s -- set
+ if trace_goodies then
+ logs.report("fonts", "feature set '%s' gets number %s and name '%s'",name,n,fullname)
+ end
+ return n
+ end
+end
+
+local function initialize(goodies,tfmdata)
+ local featuresets = goodies.featuresets
+ local goodiesname = goodies.name
+ if featuresets then
+ if trace_goodies then
+ logs.report("fonts", "checking featuresets in '%s'",goodies.name)
+ end
+ for name, set in next, featuresets do
+ fonts.goodies.prepare_features(goodies,name,set)
+ end
+ end
+end
+
+fonts.goodies.register("featureset",initialize)
+
+function fonts.initializers.common.featureset(tfmdata,set)
+ local goodies = tfmdata.goodies -- shared ?
+ if goodies then
+ local features = tfmdata.shared.features
+ local what
+ for i=1,#goodies do
+ -- last one counts
+ local g = goodies[i]
+ what = (g.featuresets and g.featuresets[set]) or what
+ end
+ if what then
+ for feature, value in next, what do
+ if features[feature] == nil then
+ features[feature] = value
+ end
+ end
+ tfmdata.mode = features.mode or tfmdata.mode
+ end
+ end
+end
+
+-- colorschemes
+
+fonts.goodies.colorschemes = fonts.goodies.colorschemes or { }
+fonts.goodies.colorschemes.data = fonts.goodies.colorschemes.data or { }
+
+local colorschemes = fonts.goodies.colorschemes
+
+function fonts.initializers.common.colorscheme(tfmdata,scheme)
+ if type(scheme) == "string" then
+ local goodies = tfmdata.goodies
+ -- todo : check for already defined in shared
+ if goodies then
+ local what
+ for i=1,#goodies do
+ -- last one counts
+ local g = goodies[i]
+ what = (g.colorschemes and g.colorschemes[scheme]) or what
+ end
+ if what then
+ -- this is font bound but we can share them if needed
+ -- just as we could hash the conversions (per font)
+ local hash, reverse = tfmdata.luatex.unicodes, { }
+ for i=1,#what do
+ local w = what[i]
+ for j=1,#w do
+ local name = w[j]
+ local unicode = hash[name]
+ if unicode then
+ reverse[unicode] = i
+ end
+ end
+ end
+ tfmdata.colorscheme = reverse
+ return
+ end
+ end
+ end
+ tfmdata.colorscheme = false
+end
+
+local fontdata = fonts.ids
+local fcs = fonts.color.set
+local has_attribute = node.has_attribute
+local traverse_id = node.traverse_id
+local a_colorscheme = attributes.private('colorscheme')
+local glyph = node.id("glyph")
+
+function fonts.goodies.colorschemes.coloring(head)
+ local lastfont, lastscheme
+ for n in traverse_id(glyph,head) do
+ local a = has_attribute(n,a_colorscheme)
+ if a then
+ local f = n.font
+ if f ~= lastfont then
+ lastscheme, lastfont = fontdata[f].colorscheme, f
+ end
+ if lastscheme then
+ local sc = lastscheme[n.char]
+ if sc then
+ fcs(n,"colorscheme:"..a..":"..sc) -- slow
+ end
+ end
+ end
+ end
+end
+
+function fonts.goodies.colorschemes.enable()
+ tasks.appendaction("processors","fonts","fonts.goodies.colorschemes.coloring")
+ function fonts.goodies.colorschemes.enable() end
+end
+
+-- installation (collected to keep the overview)
+
+fonts.otf.tables.features['goodies'] = 'Goodies on top of built in features'
+fonts.otf.tables.features['featurset'] = 'Goodie Feature Set'
+fonts.otf.tables.features['colorscheme'] = 'Goodie Color Scheme'
+
+fonts.otf.features.register('goodies')
+fonts.otf.features.register('featureset')
+fonts.otf.features.register('colorscheme')
+
+table.insert(fonts.triggers, 1, "goodies")
+table.insert(fonts.triggers, 2, "featureset") -- insert after
+table.insert(fonts.triggers, "colorscheme")
+
+fonts.initializers.base.otf.goodies = fonts.initializers.common.goodies
+fonts.initializers.node.otf.goodies = fonts.initializers.common.goodies
+
+fonts.initializers.base.otf.featureset = fonts.initializers.common.featureset
+fonts.initializers.node.otf.featureset = fonts.initializers.common.featureset
+
+fonts.initializers.base.otf.colorscheme = fonts.initializers.common.colorscheme
+fonts.initializers.node.otf.colorscheme = fonts.initializers.common.colorscheme
+
+-- experiment, we have to load the definitions immediately as they precede
+-- the definition so they need to be initialized in the typescript
+
+local function initialize(goodies)
+ local mathgoodies = goodies.mathematics
+ local virtuals = mathgoodies and mathgoodies.virtuals
+ local mapfiles = mathgoodies and mathgoodies.mapfiles
+ local maplines = mathgoodies and mathgoodies.maplines
+ if virtuals then
+ for name, specification in next, virtuals do
+ mathematics.make_font(name,specification)
+ end
+ end
+ if mapfiles then
+ for i=1,#mapfiles do
+ fonts.map.loadfile(mapfiles[i]) -- todo: backend function
+ end
+ end
+ if maplines then
+ for i=1,#maplines do
+ fonts.map.loadline(maplines[i]) -- todo: backend function
+ end
+ end
+end
+
+fonts.goodies.register("mathematics", initialize)
+
+-- The following file (husayni.lfg) is the experimental setup that we used
+-- for Idris font. For the moment we don't store this in the cache and quite
+-- probably these files sit in one of the paths:
+--
+-- tex/context/fonts/goodies
+-- tex/fonts/goodies/context
+-- tex/fonts/data/foundry/collection
+--
+-- see lfg files in distribution
diff --git a/Master/texmf-dist/tex/context/base/font-gds.mkiv b/Master/texmf-dist/tex/context/base/font-gds.mkiv
new file mode 100644
index 00000000000..e36116283e0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/font-gds.mkiv
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=font-gds,
+%D version=2009.10.14,
+%D title=\CONTEXT\ Font Support,
+%D subtitle=Colorschemes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Font Support / Colorschemes}
+
+% \registerctxluafile{font-gds}{1.001}
+
+\unprotect
+
+\def\loadfontgoodies[#1]%
+ {\ctxlua{fonts.goodies.get("#1")}}
+
+
+% this will become colorgroups and move to font-col or so
+
+\definecolor[colorscheme:1:1][s=.75]
+\definecolor[colorscheme:1:2][r=.75]
+\definecolor[colorscheme:1:3][g=.75]
+\definecolor[colorscheme:1:4][b=.75]
+\definecolor[colorscheme:1:5][c=.75]
+\definecolor[colorscheme:1:6][m=.75]
+\definecolor[colorscheme:1:7][y=.75]
+
+\definecolor[colorscheme:2:7][s=.75]
+\definecolor[colorscheme:2:6][r=.75]
+\definecolor[colorscheme:2:5][g=.75]
+\definecolor[colorscheme:2:4][b=.75]
+\definecolor[colorscheme:2:3][c=.75]
+\definecolor[colorscheme:2:2][m=.75]
+\definecolor[colorscheme:2:1][y=.75]
+
+\definesystemattribute[colorscheme] \chardef\colorschemeattribute \dogetattributeid{colorscheme}
+
+\def\setfontcolorscheme
+ {\ctxlua{fonts.goodies.colorschemes.enable()}%
+ \xdef\setfontcolorscheme[##1]{\attribute\colorschemeattribute##1\relax}%
+ \setfontcolorscheme}
+
+\edef\resetfontcolorscheme{\attribute\colorschemeattribute\attributeunsetvalue}
+
+\protect \endinput
+
+% \definefontfeature[husayni-colored][goodies=husayni,colorscheme=default,featureset=default]
+%
+% \definedfont[husayni*husayni-colored at 36pt]
+%
+% \starttext \pardir TRT \textdir TRT
+%
+% \setfontcolorscheme[1]
+%
+% اَلْحَمْ‍دُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ
+% مَجْدِهٖ، بِلِسَانِ ٱلثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛
+% اَلَّذِيْ خَلَقَ ٱلْمَوْتَ وَٱلْحَيٰوةَ، وَٱلْخَيْرَ وَٱلشَّرَّ،
+% وَٱلنَّفْعَ وَٱلضَّرَّ، وَٱلسُّكُوْنَ وَٱلْحَرَكَةَ، وَٱلْأَرْوَاحَ
+% وَٱلْأَجْسَامَ، وَٱلذِّكْرَ وَٱلنِّسْيَانَ.
+%
+% \setfontcolorscheme[2]
+%
+% اَلْحَمْ‍دُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ
+% مَجْدِهٖ، بِلِسَانِ ٱلثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛
+% اَلَّذِيْ خَلَقَ ٱلْمَوْتَ وَٱلْحَيٰوةَ، وَٱلْخَيْرَ وَٱلشَّرَّ،
+% وَٱلنَّفْعَ وَٱلضَّرَّ، وَٱلسُّكُوْنَ وَٱلْحَرَكَةَ، وَٱلْأَرْوَاحَ
+% وَٱلْأَجْسَامَ، وَٱلذِّكْرَ وَٱلنِّسْيَانَ.
+%
+% \resetfontcolorscheme
+%
+% اَلْحَمْ‍دُ لِلّٰهِ حَمْدَ مُعْتَرِفٍ بِحَمْدِهٖ، مُغْتَرِفٌ مِنْ بِحَارِ
+% مَجْدِهٖ، بِلِسَانِ ٱلثَّنَاۤءِ شَاكِرًا، وَلِحُسْنِ اٰلاۤئِهٖ نَاشِرًا؛
+% اَلَّذِيْ خَلَقَ ٱلْمَوْتَ وَٱلْحَيٰوةَ، وَٱلْخَيْرَ وَٱلشَّرَّ،
+% وَٱلنَّفْعَ وَٱلضَّرَّ، وَٱلسُّكُوْنَ وَٱلْحَرَكَةَ، وَٱلْأَرْوَاحَ
+% وَٱلْأَجْسَامَ، وَٱلذِّكْرَ وَٱلنِّسْيَانَ.
+%
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/font-ini.lua b/Master/texmf-dist/tex/context/base/font-ini.lua
index 4005726a59a..e4514978175 100644
--- a/Master/texmf-dist/tex/context/base/font-ini.lua
+++ b/Master/texmf-dist/tex/context/base/font-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-ini'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -11,6 +11,8 @@ if not modules then modules = { } end modules ['font-ini'] = {
--ldx]]--
local utf = unicode.utf8
+local format, serialize = string.format, table.serialize
+local write_nl = texio.write_nl
if not fontloader then fontloader = fontforge end
@@ -20,7 +22,11 @@ fontloader.totable = fontloader.to_table
-- fix comes last
fonts = fonts or { }
-fonts.ids = fonts.ids or { } -- aka fontdata
+
+fonts.ids = fonts.ids or { } fonts.identifiers = fonts.ids -- aka fontdata
+fonts.chr = fonts.chr or { } fonts.characters = fonts.chr -- aka chardata
+fonts.qua = fonts.qua or { } fonts.quads = fonts.qua -- aka quaddata
+
fonts.tfm = fonts.tfm or { }
fonts.mode = 'base'
@@ -30,8 +36,11 @@ fonts.verbose = false -- more verbose cache tables
fonts.ids[0] = { -- nullfont
characters = { },
descriptions = { },
+ name = "nullfont",
}
+fonts.chr[0] = { }
+
fonts.methods = fonts.methods or {
base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
@@ -61,37 +70,26 @@ fonts.define.specify.synonyms = fonts.define.specify.synonyms or { }
-- tracing
-fonts.color = fonts.color or { }
+if not fonts.color then
-local attribute = attributes.private('color')
-local mapping = (attributes and attributes.list[attribute]) or { }
+ fonts.color = {
+ set = function() end,
+ reset = function() end,
+ }
-local set_attribute = node.set_attribute
-local unset_attribute = node.unset_attribute
-
-function fonts.color.set(n,c)
- local mc = mapping[c]
- if not mc then
- unset_attribute(n,attribute)
- else
- set_attribute(n,attribute,mc)
- end
-end
-function fonts.color.reset(n)
- unset_attribute(n,attribute)
end
--- this will change ...
-
-function fonts.show_char_data(n)
- local tfmdata = fonts.ids[font.current()]
- if tfmdata then
- if type(n) == "string" then
- n = utf.byte(n)
- end
- local chr = tfmdata.characters[n]
- if chr then
- texio.write_nl(table.serialize(chr,string.format("U_%04X",n)))
- end
+-- format identification
+
+fonts.formats = { }
+
+function fonts.fontformat(filename,default)
+ local extname = file.extname(filename)
+ local format = fonts.formats[extname]
+ if format then
+ return format
+ else
+ logs.report("fonts define","unable to detemine font format for '%s'",filename)
+ return default
end
end
diff --git a/Master/texmf-dist/tex/context/base/font-ini.mkii b/Master/texmf-dist/tex/context/base/font-ini.mkii
index f614a07cd09..89fbb5d0720 100644
--- a/Master/texmf-dist/tex/context/base/font-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/font-ini.mkii
@@ -3163,12 +3163,14 @@
\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
- \def\mkdodefinefontfeature##1{\edef\!!stringa{\ifx\!!stringa\empty\else\!!stringa,\fi##1}}%
- \processcommalist[#2]\mkdodefinefontfeature
+ \processcommalist[#2]\dododefinefontfeature
\setevalue{\??fa#1}{\ifx\!!stringa\empty\else\!!stringa,\fi#3}}}
\definefontfeature
@@ -3185,11 +3187,15 @@
\definefontfeature % no calt
[arabic]
- [mode=node,language=dflt,script=arab,
+ [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 The next auxilliary macro is an alternative to \type
%D {\fontname}.
@@ -3242,11 +3248,11 @@
%
% newer
-\def\os {\mathortext{\fam\purefamily {oldstyle}}{\symbolicfont {OldStyle}}}
-\def\frak{\mathortext{\fam\purefamily {fraktur}}{\symbolicfont {Fraktur}}}
-\def\goth{\mathortext{\fam\purefamily {gothic}}{\symbolicfont {Gothic}}}
-\def\cal {\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}}
-\def\bbd {\mathortext{\fam\purefamily {blackboard}}{\symbolicfont {Blackboard}}}
+\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]
@@ -3262,10 +3268,10 @@
\ifx\mathtext\undefined \let\mathtext\hbox \fi
-\def\fraktur #1{\mathortext\domathtext\donothing{\frak#1}}
-\def\gothic #1{\mathortext\domathtext\donothing{\goth#1}}
-\def\calligraphic#1{\mathortext\domathtext\donothing{\cal #1}}
-\def\blackboard #1{\mathortext\domathtext\donothing{\bbd#1}}
+\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
diff --git a/Master/texmf-dist/tex/context/base/font-ini.mkiv b/Master/texmf-dist/tex/context/base/font-ini.mkiv
index c39bdb8b79c..c7d515cca36 100644
--- a/Master/texmf-dist/tex/context/base/font-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/font-ini.mkiv
@@ -12,6 +12,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% runtime commands will move to modules
+
% simplification ... we no longer deal with specific mmtfa specifications
% todo: always fontclass, then less testing
@@ -59,6 +61,7 @@
\registerctxluafile{font-syn}{1.001}
\registerctxluafile{font-log}{1.001}
\registerctxluafile{font-tfm}{1.001}
+\registerctxluafile{font-enh}{1.001}
\registerctxluafile{font-afm}{1.001}
\registerctxluafile{font-cid}{1.001} % cid maps
\registerctxluafile{font-ott}{1.001} % otf tables
@@ -75,9 +78,11 @@
\registerctxluafile{font-ctx}{1.001}
\registerctxluafile{font-xtx}{1.001}
\registerctxluafile{font-fbk}{1.001}
+\registerctxluafile{font-gds}{1.001}
\registerctxluafile{font-ext}{1.001}
\registerctxluafile{font-pat}{1.001}
\registerctxluafile{font-chk}{1.001}
+\registerctxluafile{font-agl}{1.001}
\unprotect
@@ -166,7 +171,7 @@
\unexpanded\def\startfont
{\bgroup\definedfont}
-\def\stopfont
+\unexpanded\def\stopfont
{\egroup}
\def\doiffontcharelse#1#2%
@@ -480,7 +485,7 @@
\let\currentmathsize\empty
-\def\mathsizesuffix{\ifcase0\currentmathsize\or\mathtextsuffix\or\mathscriptscriptsuffix\or\mathscriptsuffix\fi}
+\def\mathsizesuffix{\ifcase0\currentmathsize\or\mathtextsuffix\or\mathscriptsuffix\or\mathscriptscriptsuffix\fi}
\def\dodosetmathfamily#1#2%
{\ifcsname\fontclass \fontbody\c!mm\fontfamily\fontsize\currentmathsize\endcsname \autofontsizefalse
@@ -531,6 +536,21 @@
\appendtoks
\ifcase\boldmathmode\or\dosetmathfamily\mbfam\c!mb\fi
\to \mathstrategies
+
+% \chardef\msfam\plustwo % math symbol
+%
+% \def\c!ms{ms}
+%
+% \unexpanded\def\ms{\ifmmode\fam\plustwo\else\setcurrentfontalternative\c!ms\fi}
+%
+% \chardef\symbolmathmode\zerocount
+%
+% \def\enablesymbolmath {\chardef\symbolmathmode\plusone }
+% \def\disablesymbolmath{\chardef\symbolmathmode\zerocount}
+%
+% \appendtoks
+% \ifcase\symbolmathmode\or\dosetmathfamily\msfam\c!ms\fi
+% \to \mathstrategies
%D All used styles, like rm, ss and tt, are saved in a comma
%D separated list. Appart from practical limitations one can
@@ -561,14 +581,38 @@
%D We could instead have used dirty grouping tricks, but this
%D one works too.
+% \enableexperiments[fonts.autorscale]
+%
+% \starttypescript[mscore]
+% \definetypeface [mscore] [rm] [serif] [mscoretimes] [default]
+% \definetypeface [mscore] [ss] [sans] [mscorearial] [default] [rscale=auto] % 0.860]
+% \definetypeface [mscore] [tt] [mono] [mscorecourier] [default] [rscale=auto] % 1.065]
+% \definetypeface [mscore] [mm] [math] [times] [default] [rscale=auto] % 1.020]
+% \stoptypescript
+%
+% \starttext
+% \setupbodyfont[mscore,12pt]
+% \startTEXpage
+% test \ss test \tt test
+% \stopTEXpage
+% \stoptext
+
\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\saverelativefontsize#1#2% #1=rm|ss|.. #2=waarde
+% {\setxvalue{\fontclass#1\s!rscale}{#2}}
+
+\def\checkrelativefontid
+ {\ifcsname\??tf\fontclass\s!rname\endcsname
+ \@EA\let\@EA\relativefontid\csname\??tf\fontclass\s!rname\endcsname
+ \else
+ \@EA\xdef\csname\??tf\fontclass\s!rname\endcsname{\the\lastfontid}%
+ \let\relativefontid\empty
+ \fi}
\def\checkrelativefontsize#1%
{\edef\relativefontsize
@@ -578,29 +622,13 @@
\csname\defaultfontclass#1\s!rscale\endcsname
\else
\defaultrelativefontsize
- \fi\fi}}
-
-% \letvalue{\s!default\s!rscale}\defaultrelativefontsize
-%
-% \def\checkrelativefontsize#1%
-% {\edef\relativefontsize
-% {\csname
-% \ifcsname\fontclass#1\s!rscale\endcsname
-% \fontclass#1%
-% \else\ifcsname\defaultfontclass#1\s!rscale\endcsname
-% \defaultfontclass#1%
-% \else
-% \s!default
-% \fi\fi
-% \s!rscale\endcsname}}
-
-%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}
+ \fi\fi}%
+ \ifx\relativefontsize\v!auto
+ \let\relativefontsize\plusone
+ \checkrelativefontid
+ \else
+ \let\relativefontid\minusone
+ \fi}
%D Scaling macros:
%D
@@ -645,7 +673,8 @@
\newcount\scaledfontmode
\newdimen\scaledfontsize
-\newtoks\everydefinefont
+\newtoks \everydefinefont
+\newcount\lastfontid
\def\currentfontbodysize
{\ifcsname\??ft\s!default\somefontsize\endcsname
@@ -654,6 +683,8 @@
\somefontsize
\fi}
+\let\relativefontid\empty
+
\def\lowleveldefinefont#1#2% #2 = cs
{%
\ctxlua{fonts.define.command_1("\luaescapestring{#1}")}% the escapestring catches at \somedimen
@@ -697,15 +728,16 @@
"\@@fontclassfallbacks",
"\@@fontfallbacks",
0\currentmathsize,
- \number\dimexpr\textface\relax
+ \number\dimexpr\textface\relax,
+ "\relativefontid" % experiment
)}%
\edef\somefontspec{at \somefontsize}% we need the resolved designsize (for fallbacks)
\expandafter\let\expandafter\lastrawfontcall\csname#2\endcsname
\the\everydefinefont}
\def\updatefontclassparameters
- {\edef\@@fontclassfeatures {\ifcsname\fontclass\s!features \endcsname\csname\fontclass\s!features \endcsname\fi}%
- \edef\@@fontclassfallbacks{\ifcsname\fontclass\s!fallbacks\endcsname\csname\fontclass\s!fallbacks\endcsname\fi}}
+ {\edef\@@fontclassfeatures {\ifcsname\fontclass\fontstyle\s!features \endcsname\csname\fontclass\fontstyle\s!features \endcsname\fi}%
+ \edef\@@fontclassfallbacks{\ifcsname\fontclass\fontstyle\s!fallbacks\endcsname\csname\fontclass\fontstyle\s!fallbacks\endcsname\fi}}
% resolve
@@ -762,6 +794,12 @@
\let\fontfile\s!unknown
+% \definefontfeature[slanted] [default][slant=.25]
+% \definefontfeature[stretched][default][stretch=2]
+%
+% \start \definedfont[SerifBold*slanted at 20pt] \ruledhbox{Test!} \stop
+% \start \definedfont[SerifBold*stretched at 20pt] \ruledhbox{Test!} \stop
+
% \definefontfeature[default] [liga=yes,texligatures=yes,texquotes=yes]
% \definefontfeature[default-caps][liga=yes,texligatures=yes,texquotes=yes,smcp=yes,script=latn]
%
@@ -878,7 +916,7 @@
% We could use an indirect method ... store in 'array' and refer to
% slot.
-\def\definefontsynonym[#1]#2[#3]%
+\unexpanded\def\definefontsynonym[#1]#2[#3]%
{\edef\@@fontname{#1}%
\edef\@@fontfile{#3}%
\ifx\fontclass\empty
@@ -945,19 +983,11 @@
\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater
-\def\setupfontsynonym
+\unexpanded\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\dosetupfontsynonym[#1][#2]% not yet supported, will do when needed
+ {}
\def\truefontname#1%
{\@EA\dotruefontname#1*\empty*\relax}
@@ -1026,7 +1056,7 @@
%
% \setupbodyfont[palatino]
-\def\startfontclass
+\unexpanded\def\startfontclass
{\dosingleempty\dostartfontclass}
\def\dostartfontclass[#1]%
@@ -1035,7 +1065,7 @@
{\let\fontclass\empty}
{\doifsomething{#1}{\def\fontclass{#1}}}}
-\def\stopfontclass
+\unexpanded\def\stopfontclass
{\popmacro\fontclass}
%D \macros
@@ -1065,14 +1095,14 @@
%D
%D The implementation looks as follows:
-\def\definefont
+\unexpanded\def\definefont
{\dotripleempty\dodefinefont}
\def\dodefinefont[#1][#2][#3]% [name][spec][1.6 | line=10pt | setup_id]
{\ifthirdargument
- \unexpanded\setvalue{#1}{\redodefinefont{#1}{#2}{#3}}%
+ \setuvalue{#1}{\redodefinefont{#1}{#2}{#3}}%
\else
- \unexpanded\setvalue{#1}{\dododefinefont{#1}{#2}}%
+ \setuvalue{#1}{\dododefinefont{#1}{#2}}%
\fi}
\def\redodefinefont#1#2#3%
@@ -1082,7 +1112,7 @@
{\setuplocalinterlinespace[#3]%
\setupspacing}} % needed ?
-\def\definefrozenfont
+\unexpanded\def\definefrozenfont
{\dotripleempty\dodefinefrozenfont}
\def\dodefinefrozenfont[#1][#2][#3]%
@@ -1109,7 +1139,6 @@
\let\localrelativefontsize\defaultrelativefontsize
\let\localabsolutefontsize\fontbody
\lowleveldefinefont{#2}\rawfontidentifier
-% \let\localrelativefontsize\defaultrelativefontsize % not needed
\csname\rawfontidentifier\endcsname
\autofontsizefalse
\setfontcharacteristics
@@ -1122,7 +1151,6 @@
\def\localrelativefontsize{#1}%
\def\localabsolutefontsize{#2}%
\lowleveldefinefont{#4}\newfontidentifier
-% \let\localrelativefontsize\defaultrelativefontsize % not needed
\fi
\csname\newfontidentifier\endcsname
\autofontsizefalse
@@ -1198,11 +1226,11 @@
\processcommacommand[\fontalternativelist]\dodocommand}%
\processcommacommand[\fontsizelist]\docommand}
-\def\definefontsize[#1]% sneller met toks
+\unexpanded\def\definefontsize[#1]% sneller met toks
{\addtocommalist{#1}\fontsizelist
\checkfontnamecombinations}
-\def\definefontalternative[#1]%
+\unexpanded\def\definefontalternative[#1]%
{\addtocommalist{#1}\fontalternativelist
\checkfontnamecombinations}
@@ -1292,7 +1320,11 @@
%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 to fool the multilingual interface. However, long ago
+%D we decided to stick to \s!text in definitions as it closely
+%D relates to the math model where text, script and scriptscript
+%D are used untranslated. Also, we are now english at the low
+%D level so it cannot go wrong anymore.
%D
%D When instead of a size the keyword \type{unknown} is
%D passed, fractions (relations) are used instead of fixed
@@ -1320,7 +1352,7 @@
\let\k!text \k!savedtext
\fi}
-\def\definebodyfontenvironment
+\unexpanded\def\definebodyfontenvironment
{\dotripleempty\dodefinebodyfontenvironment}
\def\dodefinebodyfontenvironment[#1][#2][#3]% class size settings
@@ -1348,12 +1380,9 @@
% we test for em as we assume it to be set
\else
\def\docommand##1%
-% fails: \def\checkbodyfontenvironment[#1]{! #1 ! \definebodyfontenvironment[\fontclass][#1][]} \setupbodyfont[8.5pt]
-% {\normalizebodyfontsize\csname\??ft\s!default##1\endcsname\dimexpr#1\relax\to\tempbodyfontsize
-% \letvalue{\??ft#2#1##1}\tempbodyfontsize}%
- {\scratchdimen\csname\??ft\s!default##1\endcsname\dimexpr#1\relax
- \normalizebodyfontsize\scratchdimen\to\tempbodyfontsize
- \letvalue{\??ft#2#1##1}\tempbodyfontsize}%
+ {\scratchdimen\csname\??ft\s!default##1\endcsname\dimexpr#1\relax
+ \normalizebodyfontsize\scratchdimen\to\tempbodyfontsize
+ \letvalue{\??ft#2#1##1}\tempbodyfontsize}%
\processcommacommand[\fontrelativesizelist]\docommand
\copyparameters
[\??ft#2#1][\??ft\s!default]
@@ -1369,7 +1398,10 @@
\else
% prevent loop (hence \empty)
\letvalue{\@size@#1}\empty
+ \pushmacro\fontclass % new per 26102009
+ \edef\fontclass{#2}% % new per 26102009
\defineunknownfont{#1}%
+ \popmacro\fontclass % new per 26102009
\fi\fi
% so far
\setvalue{\@size@#1}{\docompletefontswitch[#1]}}
@@ -1406,7 +1438,7 @@
% this one already catches both define/setup
-\def\setupbodyfontenvironment{\definebodyfontenvironment}
+\let\setupbodyfontenvironment\definebodyfontenvironment
%D Just a couple of interface macros:
@@ -1499,7 +1531,7 @@
%D user definitions like \type{\tfw} or \type{\bfq} for real
%D large alternatives.
-\def\definebodyfont
+\unexpanded\def\definebodyfont
{\doquadrupleempty\redefinebodyfont}
\def\redefinebodyfont[#1][#2][#3][#4]%
@@ -1580,30 +1612,30 @@
\def\dodefinebodyfontnopxx#1#2[#3#4#5=#6]% style body def
{\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5]
\@EA\let\csname*#2#1#3#4#5*\endcsname\undefined
- \normalprotected\@EA\edef\csname#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}}
+ \unexpanded\@EA\edef\csname#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}}
\def\dodefinebodyfontyesxx#1#2[#3#4#5=#6]% style body def
{\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5]
\fcglobal\@EA\let\csname*\fontclass#2#1#3#4#5*\endcsname\undefined
- \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}}
+ \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}}
\def\dodefinebodyfontnopmm#1#2[#3#4#5=#6]% style body def
{\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5]
\@EA\let\csname*#2#1#3#4#51*\endcsname\undefined
\@EA\let\csname*#2#1#3#4#52*\endcsname\undefined
\@EA\let\csname*#2#1#3#4#53*\endcsname\undefined
- \normalprotected\@EA\edef\csname#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}%
- \normalprotected\@EA\edef\csname#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}%
- \normalprotected\@EA\edef\csname#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}}
+ \unexpanded\@EA\edef\csname#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}%
+ \unexpanded\@EA\edef\csname#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}%
+ \unexpanded\@EA\edef\csname#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}}
\def\dodefinebodyfontyesmm#1#2[#3#4#5=#6]% style body def
{\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5]
\fcglobal\@EA\let\csname*\fontclass#2#1#3#4#51*\endcsname\undefined
\fcglobal\@EA\let\csname*\fontclass#2#1#3#4#52*\endcsname\undefined
\fcglobal\@EA\let\csname*\fontclass#2#1#3#4#53*\endcsname\undefined
- \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}%
- \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}%
- \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}}
+ \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}%
+ \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}%
+ \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}}
\def\checkbodyfont#1% tests for ttsl mmbf
{\edef\c!!mm{#1}%
@@ -1618,21 +1650,21 @@
\def\checkmathbodyfont#1#2#3% style alt size / gdef % #3 can be empty
{%\message{!m #1 #2 #3!}%
% #1 #2 #3 = signal
- %unexpanded\setgvalue {#2}{\setcurrentfontalternative {#2}}% \mr \mb
- \unexpanded\setgvalue {#1}{\setcurrentfontstyle {#1}}}% \mm
+ %setugvalue {#2}{\setcurrentfontalternative {#2}}% \mr \mb
+ \setugvalue {#1}{\setcurrentfontstyle {#1}}}% \mm
\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
+ \setugvalue {#1#3}{\setcurrentfontstylesize {#1}{#3}}% \rma
+ \setugvalue {#2#3}{\setcurrentfontalternativesize {#2}{#3}}% \sla
+ \setugvalue {#1#2#3}{\setcurrentfontstylealternativesize{#1}{#2}{#3}}% \rmsla
+ \setugvalue {#1}{\setcurrentfontstyle {#1}}% \rm
+ \setugvalue {#2}{\setcurrentfontalternative {#2}}% \sl
+ \setugvalue {#1\c!x}{\setcurrentfontxstylealternative {#1}}% \rmx
+ \setugvalue{#1\c!xx}{\setcurrentfontxxstylealternative {#1}}% \rmxx
+ \setugvalue {#2\c!x}{\setcurrentfontxalternative {#2}}% \slx
+ \setugvalue{#2\c!xx}{\setcurrentfontxxalternative {#2}}% \slxx
+ \setugvalue {#1#2}{\setcurrentfontstylealternative {#1}{#2}}}% \rmsl
\def\dodefinedefaultbodyfont[#1][#2][#3]% sizes styles identifier
{\def\dododefinedefaultbodyfont##1%
@@ -1673,7 +1705,7 @@
\defineunknownfont{\csname\??ft#1#2\endcsname}%
\fi}
-\def\defineunknownfont#1%
+\unexpanded\def\defineunknownfont#1%
{\let\c!savedtext\c!text
\let\c!text\s!text
\donefalse
@@ -1685,7 +1717,7 @@
[\fontstylelist]
{\dodefineunknownbodyfont{#1}}%
\ifdone
- \donefalse
+ \donefalse
\setvalue{\@size@#1}{\docompletefontswitch[#1]}%
\ifdefiningunknownfont \else
\definingunknownfonttrue
@@ -1702,23 +1734,6 @@
%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
@@ -1762,15 +1777,6 @@
\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
@@ -1787,34 +1793,24 @@
\chardef\fontdigits=2 % was 1
-\def\normalizebodyfontsize#1\to#2%
- {\@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\dimexpr#1+\ifcase\fontdigits.5\or.05\or.005\fi\points\relax000\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}}
-
-% not faster, just less tracing
-%
-% \def\setfontdigits#1%
-% {\chardef\fontdigits\ifnum#1>\plusthree\plusthree\else#1\fi\relax
-% \@EA\let\@EA\normalizedbfs\csname normalizedbfs\number\fontdigits\endcsname}
-%
% \def\normalizebodyfontsize#1\to#2%
-% {\@EA\@EA\@EA\normalizedbfs\@EA\WITHOUTPT\the\dimexpr#1+\ifcase\fontdigits.5\or.05\or.005\fi\points\relax000\to#2}
-%
-% \setvalue{normalizedbfs0}#1.#2\to #3{\edef#3{#1\s!pt}}
-% \setvalue{normalizedbfs1}#1.#2#3\to #4{\edef#4{#1\ifcase#2 \else.#2\fi\s!pt}}
-% \setvalue{normalizedbfs2}#1.#2#3#4\to #5{\edef#5{#1\ifcase#2#3 \else.#2\ifcase#3 \else#3\fi\fi\s!pt}}
-% \setvalue{normalizedbfs3}#1.#2#3#4#5\to#6{\edef#6{#1\ifcase#2#3#4 \else.#2\ifcase#4 \ifcase#3 \else#3\fi\else#3#4\fi\fi\s!pt}}
+% {\@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\dimexpr#1+\ifcase\fontdigits.5\or.05\or.005\fi\points\relax000\to#2}
%
-% \setfontdigits2
+% \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}}
+
+\def\normalizebodyfontsize#1\to#2%
+ {\edef#2{\ctxlua{fonts.nbfs(\number\dimexpr#1\relax,\number\fontdigits)}}}
+
+\def\thenormalizedbodyfontsize#1%
+ {\ctxlua{fonts.nbfs(\number\dimexpr#1\relax,\number\fontdigits)}}
\normalizebodyfontsize\bodyfontsize\to\normalizedglobalbodyfontsize
\normalizebodyfontsize\bodyfontsize\to\normalizedlocalbodyfontsize
@@ -2069,9 +2065,57 @@
\def\registerfontclass#1%
{\letgvalue{\@fontclass@#1}\v!yes} % global ?
+\edef\@no@fontclass@{\@fontclass@:?:}
+
\def\setcurrentfontclass#1%
{\ifcsname\@fontclass@#1\endcsname
\edef\fontclass{#1}%
+ \else\ifcsname\@no@fontclass@#1\endcsname
+ % already tried
+ \else\ifcase\currentgrouplevel
+ \trycurrentfontclass{#1}%
+ \fi\fi\fi}
+
+\def\savefontclassparameters#1#2#3#4% #1=rm|ss|.. rscale features fallbacks
+ {\setxvalue{\fontclass#1\s!rscale }{#2}%
+ \setxvalue{\fontclass#1\s!features }{#3}%
+ \setxvalue{\fontclass#1\s!fallbacks}{#4}}
+
+\settrue\autotypescripts
+
+% \def\trycurrentfontclass#1%
+% {\ifconditional\autotypescripts
+% \usetypescript[#1]%
+% \ifcsname\@fontclass@#1\endcsname
+% \edef\fontclass{#1}%
+% \else
+% \letvalue{\@no@fontclass@#1}\empty
+% \fi
+% \else
+% \letvalue{\@no@fontclass@#1}\empty
+% \fi}
+
+\def\trycurrentfontclass#1%
+ {\ifconditional\autotypescripts
+ % try to load typescript #1
+ \usetypescript[#1]%
+ \ifcsname\@fontclass@#1\endcsname
+ \edef\fontclass{#1}%
+ \else
+ % try to load type-#1.mkiv
+ \usetypescriptfile[\f!typeprefix#1]%
+ % try to load typescript #1
+ \usetypescript[#1]%
+ \ifcsname\@fontclass@#1\endcsname
+ \edef\fontclass{#1}%
+ \else
+ % todo: message
+ \letvalue{\@no@fontclass@#1}\empty
+ \fi
+ \fi
+ \else
+ % todo: message
+ \letvalue{\@no@fontclass@#1}\empty
\fi}
\let\defaultfontstyle \c!rm
@@ -2211,48 +2255,6 @@
\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
-% \autofontsizefalse
-% \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}
-
-% \def\synchronizefont % we can have dups i.e. no need to let fontstrategy
-% {\tryingfonttrue
-% \ifx\fontclass\empty\else
-% \global\let\fontstrategy\dofontclassstrategy
-% \applyfontstrategies
-% \fi
-% \iftryingfont
-% \global\let\fontstrategy\dofontstrategy
-% \applyfontstrategies
-% \fi
-% \autofontsizefalse
-% \ifskipfontcharacteristics
-% \setfontcharacteristics
-% \the\everyfontswitch
-% \fi}
-
\def\synchronizefont % we can have dups i.e. no need to let fontstrategy
{\tryingfonttrue
\ifx\fontclass\empty
@@ -2266,69 +2268,6 @@
\the\everyfontswitch
\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
-
-% \def\fontstrategiesa % --- --- --- --- % pt tt bf a
-% {\fontstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
-% \iftryingfont \fontstrategiesb \fi}
-% \def\fontstrategiesb % --- --- --- def % pt tt bf
-% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
-% \iftryingfont \fontstrategiesc \fi}
-% \def\fontstrategiesc % --- --- def --- % pt tt tf a
-% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
-% \iftryingfont \fontstrategiesd \fi}
-% \def\fontstrategiesd % --- --- def def % pt tt tf
-% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontstrategiese \fi}
-% \def\fontstrategiese % --- def def def % pt rm tf
-% {\fontstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontstrategiesf \fi}
-% \def\fontstrategiesf % def def def def % rm tf
-% {\fontstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
-
-% \fontstrategies {\fontstrategiesa}
-% \let\applyfontstrategies\fontstrategiesa
-
-% \def\fontclassstrategiesa % --- --- --- --- % pt tt bf a
-% {\dofontclassstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
-% \iftryingfont \fontclassstrategiesb \fi}
-% \def\fontclassstrategiesb % --- --- --- def % pt tt bf
-% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
-% \iftryingfont \fontclassstrategiesc \fi}
-% \def\fontclassstrategiesc % --- --- def --- % pt tt tf a
-% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
-% \iftryingfont \fontclassstrategiesd \fi}
-% \def\fontclassstrategiesd % --- --- def def % pt tt tf
-% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontclassstrategiese \fi}
-% \def\fontclassstrategiese % --- def def def % pt rm tf
-% {\dofontclassstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontclassstrategiesf \fi}
-% \def\fontclassstrategiesf % def def def def % rm tf
-% {\dofontclassstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
-
\def\fontclassstrategiesa % --- --- --- --- % pt tt bf a
{\ifcsname\fontclass\fontbody \fontstyle \fontalternative \fontsize\endcsname
\autofontsizefalse
@@ -2379,24 +2318,6 @@
% no class
-% \def\fontstrategiesa % --- --- --- --- % pt tt bf a
-% {\dofontstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
-% \iftryingfont \fontstrategiesb \fi}
-% \def\fontstrategiesb % --- --- --- def % pt tt bf
-% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
-% \iftryingfont \fontstrategiesc \fi}
-% \def\fontstrategiesc % --- --- def --- % pt tt tf a
-% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
-% \iftryingfont \fontstrategiesd \fi}
-% \def\fontstrategiesd % --- --- def def % pt tt tf
-% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontstrategiese \fi}
-% \def\fontstrategiese % --- def def def % pt rm tf
-% {\dofontstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-% \iftryingfont \fontstrategiesf \fi}
-% \def\fontstrategiesf % def def def def % rm tf
-% {\dofontstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
-
\def\fontstrategiesa % --- --- --- --- % pt tt bf a
{\ifcsname\fontbody \fontstyle \fontalternative \fontsize\endcsname
\autofontsizefalse
@@ -2562,7 +2483,7 @@
\setvalue{\@style@##1}{\csname#2\endcsname}}%
\processcommalist[#1]\docommand}
-\def\definefontstyle
+\unexpanded\def\definefontstyle
{\dodoubleargument\dodefinefontstyle}
\def\setfontstyle#1#2% #1:name (roman, romaan) #2:style (rm)
@@ -2570,29 +2491,6 @@
\checkfontnamecombinations
\setcurrentfontstyle\normalizedbodyfontsize}
-%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
@@ -2623,7 +2521,7 @@
%D and/or options defined in files, for example:
%D
%D \starttyping
-%D \setupbodyfont[cmr,ams,12pt,roman]
+%D \setupbodyfont[modern,12pt,roman]
%D \stoptyping
%D
%D This command affects the document as a whole: text, headers
@@ -2644,6 +2542,9 @@
\ifx\saveinterlinespace \undefined \let\saveinterlinespace \relax \fi
\ifx\restoreinterlinespace\undefined \let\restoreinterlinespace\relax \fi
+% \newtoks \everysetupbodyfont
+% \newtoks \everyswitchtobodyfont
+
\chardef\bodyfontsetstate=0
\definecomplexorsimple\setupbodyfont
@@ -2662,7 +2563,8 @@
\the\everybodyfont
\the\everyglobalbodyfont
\saveinterlinespace
- \fi}}
+ \fi
+ \the\everysetupbodyfont}}
\unexpanded\def\switchtobodyfont[#1]%
{\doifsomething{#1}
@@ -2671,7 +2573,8 @@
\else
\dosetfont0{#1}%
\fi
- \the\everybodyfont}} % indeed needed in case nothing is executed
+ \the\everybodyfont
+ \the\everyswitchtobodyfont}}
%D The following alternative is meant for math||to||text
%D switching and will be optimized.
@@ -2709,27 +2612,32 @@
%D Experimental:
-\def\definefontfeature
+\unexpanded\def\definefontfeature
{\dotripleargument\dodefinefontfeature}
\def\dodefinefontfeature[#1][#2][#3]%
- {\global\expandafter\chardef\csname\??fq=#1\endcsname
- \ctxlua{tex.write(fonts.define.specify.preset_context("#1","#2","#3"))}\relax}
+ {\global\expandafter\chardef\csname\??fq=#1\endcsname % beware () needed as we get two values returned
+ \ctxlua{tex.write((fonts.define.specify.preset_context("#1","#2","#3")))}\relax}
\definefontfeature
[default]
- [%mode=node,%
+ [%mode=node,
liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
\definefontfeature
[smallcaps]
- [%mode=node,%
- liga=yes,kern=yes,tlig=yes,trep=yes,smcp=yes] % texligatures=yes,texquotes=yes
+ [%mode=node,liga=yes,
+ smcp=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
\definefontfeature
[oldstyle]
- [%mode=node,%
- liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes
+ [%mode=node,
+ onum=yes,liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
+
+\definefontfeature % == default unless redefined
+ [ligatures]
+ [%mode=node,
+ liga=yes,kern=yes,tlig=yes,trep=yes]
\definefontfeature % can be used for type1 fonts
[complete]
@@ -2744,7 +2652,7 @@
\definefontfeature
[none]
- [mode=none,features=off]
+ [mode=none,features=no]
\definefontfeature
[virtualmath]
@@ -2764,11 +2672,12 @@
% \definefontfeature[mathscript] [math-script]
% \definefontfeature[mathscriptscript] [math-scriptscript]
-%D Also new:
+%D Also new, handy for manuals:
-% handy for manuals
+\unexpanded\def\fontchar#1{\ctxlua{fonts.char("#1")}}
-\def\otfchar#1{\ctxlua{fonts.otf.char("#1")}}
+\let\otfchar\fontchar % will disappear, for compatibility only
+\let\afmchar\fontchar % will disappear, for compatibility only
%D: We cannot yet inherit because no colors are predefined.
@@ -2818,10 +2727,10 @@
\def\setfontfeature #1{\edef\currentfeature{#1}\attribute\zerocount\featureattribute{#1}\relax}
\def\resetfontfeature#1{\let\currentfeature\empty\attribute\zerocount\zerocount} % initial value
-\def\addfontfeaturetoset #1{\ctxlua{fonts.withset("#1", 1)}}
-\def\subtractfontfeaturefromset #1{\ctxlua{fonts.withset("#1",-1)}}
-\def\addfontfeaturetofont #1{\ctxlua{fonts.withfnt("#1", 2)}}
-\def\subtractfontfeaturefromfont#1{\ctxlua{fonts.withfnt("#1",-2)}}
+\def\addfontfeaturetoset #1{\ctxlua{fonts.withset("#1", 1)}} % merge
+\def\subtractfontfeaturefromset #1{\ctxlua{fonts.withset("#1",-1)}} % merge
+\def\addfontfeaturetofont #1{\ctxlua{fonts.withfnt("#1", 2)}} % overload
+\def\subtractfontfeaturefromfont#1{\ctxlua{fonts.withfnt("#1",-2)}} % overload
\let\setff\setfontfeature
\let\addfs\addfontfeaturetoset
@@ -2832,13 +2741,7 @@
%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}
+\def\purefontname#1{\ctxlua{file.basename("\fontname#1"}} % will be function using id
%D \macros
%D {switchstyleonly}
@@ -2872,9 +2775,9 @@
[mode=node,onum=yes]
% \def\sc{\setfontfeature{smallcaps}}
-\def\os{\setfontfeature{just-os}}
+\unexpanded\def\os{\setfontfeature{just-os}}
-%D Code for swithcing to fraktur and script has also been
+%D Code for switching to fraktur and script has also been
%D changed. We now have an alphabet switcher.
\ifx\mathtext\undefined \let\mathtext\hbox \fi
@@ -2897,7 +2800,7 @@
{\def\docommand##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
\processcommalist[#1]\docommand}
-\def\definebodyfontswitch
+\unexpanded\def\definebodyfontswitch
{\dodoubleargument\dodefinebodyfontswitch}
%D \macros
@@ -2955,6 +2858,8 @@
\chardef\currentxfontsize\zerocount
\redoconvertfont
\tf
+ \the\everybodyfont % indeed needed
+ \the\everyglobalbodyfont % indeed needed
\saveinterlinespace}
\def\restoreglobalbodyfont % ook style etc
@@ -3036,15 +2941,15 @@
\def\dodefinealternativestyle[#1][#2][#3]%
{\def\docommand##1%
- {\ifcsname##1\endcsname\else\setvalue{##1}{\groupedcommand{#2}{}}\fi
+ {\ifcsname##1\endcsname\else\setuvalue{##1}{\groupedcommand{#2}{}}\fi
\setvalue{\@letter@ ##1}{#2}%
\setvalue{\@noletter@##1}{#3}}%
\processcommalist[#1]\docommand}
-\def\definealternativestyle
+\unexpanded\def\definealternativestyle
{\dotripleempty\dodefinealternativestyle}
-\def\definestyle{\definealternativestyle}
+\unexpanded\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.)
@@ -3169,19 +3074,6 @@
%D or even better:
-% \def\doemphasistypeface#1#2% slow
-% {\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\doemphasistypeface#1#2%
{\edef\emphasizedtypeface{\csname\??ft\fontclass\normalizedbodyfontsize\c!em\endcsname}%
\ifx\emphasizedtypeface\v!slanted
@@ -3248,7 +3140,7 @@
%D takes care of \type {\em \bf ...} sitiations.
\def\setemphasisboldface
- {\let\normalbf\bf
+ {\let\savedemphasisboldface\bf
\let\setemphasisboldface\relax
\unexpanded\def\bf
{%\relax
@@ -3258,9 +3150,9 @@
\else\ifx\fontalternative\c!sl
\bs
\else
- \normalbf
+ \savedemphasisboldface
\fi\fi
- \let\bf\normalbf}}
+ \let\bf\savedemphasisboldface}}
%D Donald's (adapted) macros take the next character into
%D account when placing italic correction. As a bonus we also
@@ -3274,18 +3166,6 @@
\expandafter\emphasislook
\fi}
-% \def\emphasislook
-% {\begingroup
-% \beginrobusttest
-% \futurelet\next\emphasistest}
-
-% \def\emphasistest
-% {\normalifcat\noexpand\next,%
-% \endrobusttest\expandafter\doemphasiscorrection
-% \normalelse
-% \endrobusttest\expandafter\dododoemphasiscorrection
-% \normalfi}
-
\def\emphasislook
{\begingroup
\futurelet\next\emphasistest}
@@ -3377,7 +3257,7 @@
%D some typing:
\def\setfont% geen \dosetfont mogelijk
- {\def\next{\nextfont\setupinterlinespace}%
+ {\def\next{\nextfont\setupinterlinespace}% hm, we need to use \setuplocalinterlinespace
\afterassignment\next\font\nextfont=}
%D One can call this macro as:
@@ -3404,7 +3284,7 @@
%D The implementation is rather straightforward in using
%D \type{\halign}.
-\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkiv}
%D \macros
%D {showfontstrip, testminimalbaseline, showminimalbaseline}
@@ -3415,9 +3295,9 @@
%D
%D \showfontstrip \blank \showminimalbaseline
-\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkiv}
%D \macros
%D {showkerning}
@@ -3426,7 +3306,7 @@
%D
%D \showkerning{Can you guess what kerning is?}
-\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkiv}
%D \macros
%D {showbodyfontenvironment}
@@ -3439,7 +3319,7 @@
%D
%D \showsetup{showbodyfontenvironment}
-\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkiv}
%D \macros
%D {showfont,showfontstyle,showligatures}
@@ -3455,11 +3335,11 @@
% to be internationalized
-\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkii}
-\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkii}
+\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkiv}
+\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkiv}
%D \macros
%D {getglyph, symbolicfont}
@@ -3863,56 +3743,23 @@
%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}
+%D This command is obsolete in \MKIV\ as we have features. It might
+%D come back using the local features handlers.
-\def\dodefinefontvariant[#1][#2][#3]%
- {\setvalue{\??fv#1#2}{#3}}
+\unexpanded\def\definefontvariant{\dotripleargument\dodefinefontvariant}
-\def\fontvariant#1#2{\executeifdefined{\??fv#1#2}\empty}
+\def\dodefinefontvariant[#1][#2][#3]{}
+\def\variant [#1]{}
-\def\dosetscaledfont
- {\checkrelativefontsize\fontstyle
- \scaledfontsize\currentfontscale\bodyfontsize
- \scaledfontsize\relativefontsize\scaledfontsize}
-
-\unexpanded\def\variant[#1]% slow
- {\dosetscaledfont
- \normalexpanded{\noexpand\definedfont[\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1} at \the\dimexpr\scaledfontsize\relax]}%
- \ignoreimplicitspaces}
-
-\ifx\Var\undefined \let\Var\variant \fi
+\ifdefined\Var\else \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]
-% \setupbodyfont [rm]
-
-%D Also needed is:
+%D can be called for by \type{\ss} and \type{\tt}. Loading
+%D takes place elsewhere.
+%D
+%D For tracing purposes we define:
\definefont[tinyfont][Mono at 1ex]
@@ -3922,19 +3769,19 @@
%
% \setupfonts[check=...]
-\def\checkcharactersinfont {\ctxlua{fonts.checkers.enabled=true}}
-\def\removemissingcharacters{\ctxlua{fonts.checkers.enabled=true fonts.checkers.delete=true}}
+\def\checkcharactersinfont {\ctxlua{fonts.checkers.enable()}}
+\def\removemissingcharacters{\ctxlua{fonts.checkers.enable(true)}}
%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]%
+\unexpanded\def\startstyle[#1]%
{\begingroup
\ifcsname#1\endcsname\csname#1\endcsname\else\definedfont[#1]\fi}
-\def\stopstyle
+\unexpanded\def\stopstyle
{\endgroup}
%D Still experimental (might even go away).
@@ -3949,21 +3796,19 @@
% {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test \mine \bf test}}
-\definesystemvariable{sx}
-
-\def\definestylecollection
+\unexpanded\def\definestylecollection
{\dosingleargument\dodefinestylecollection}
\def\dodefinestylecollection[#1]%
{\iffirstargument
- \unexpanded\setvalue{#1}{\styleinstance[#1]}%
+ \setuvalue{#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
+\unexpanded\def\definestyleinstance
{\doquadrupleargument\dodefinestyleinstance}
\def\dodefinestyleinstance[#1][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever]
@@ -4000,6 +3845,36 @@
% \fi\fi\fi\fi
% \endcsname}
+%D goodies:
+
+\def\showchardata#1{\ctxlua{fonts.show_char_data("#1")}}
+\def\showfontdata {\ctxlua{fonts.show_font_parameters()}}
+
+%D some low level helpers
+%D
+%D \starttyping
+%D \def\TestLookup#1%
+%D {\dolookupfontbyspec{#1}
+%D pattern: #1, found: \dolookupnoffound
+%D \blank
+%D \dorecurse {\dolookupnoffound} {%
+%D \recurselevel:~\dolookupgetkeyofindex{fontname}{\recurselevel}\quad
+%D }%
+%D \blank}
+%D
+%D \TestLookup{familyname=helveticaneue}
+%D \TestLookup{familyname=helveticaneue,weight=bold}
+%D \TestLookup{familyname=helveticaneue,weight=bold,style=italic}
+%D \stoptyping
+
+% we can also move the lookups to the fonts.namespace (of commands)
+
+\def\dolookupfontbyspec #1{\ctxlua{fonts.names.lookup("#1")}}
+\def\dolookupnoffound {\ctxlua{tex.write(fonts.names.noflookups())}}
+\def\dolookupgetkeyofindex#1#2{\ctxlua{tex.write(fonts.names.getlookupkey("#1",#2))}}
+\def\dolookupgetkey #1{\ctxlua{tex.write(fonts.names.getlookupkey("#1"))}}
+\def\cleanfontname #1{\ctxlua{fonts.cleanname("#1")}}
+
\protect \endinput
% \startluacode
diff --git a/Master/texmf-dist/tex/context/base/font-log.lua b/Master/texmf-dist/tex/context/base/font-log.lua
index af0b2552fb4..97cb4ff7c1a 100644
--- a/Master/texmf-dist/tex/context/base/font-log.lua
+++ b/Master/texmf-dist/tex/context/base/font-log.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-log'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -34,7 +34,7 @@ end
function fonts.logger.report(complete)
local t = { }
- for name, used in table.sortedpairs(fonts.used) do
+ for name, used in table.sortedhash(fonts.used) do
if complete then
t[#t+1] = used .. "->" .. file.basename(name)
else
diff --git a/Master/texmf-dist/tex/context/base/font-map.lua b/Master/texmf-dist/tex/context/base/font-map.lua
index c597d48552b..299508764a1 100644
--- a/Master/texmf-dist/tex/context/base/font-map.lua
+++ b/Master/texmf-dist/tex/context/base/font-map.lua
@@ -1,16 +1,20 @@
if not modules then modules = { } end modules ['font-map'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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 match, format, find, concat = string.match, string.format, string.find, table.concat
+local utf = unicode.utf8
+local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower
+local lpegmatch = lpeg.match
+local utfbyte = utf.byte
-local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
+local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
+local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end)
-local ctxcatcodes = tex.ctxcatcodes
+local ctxcatcodes = tex and tex.ctxcatcodes
--[[ldx--
<p>Eventually this code will disappear because map files are kind
@@ -18,116 +22,10 @@ of obsolete. Some code may move to runtime or auxiliary modules.</p>
<p>The name to unciode related code will stay of course.</p>
--ldx]]--
-fonts = fonts or { }
-fonts.map = fonts.map or { }
-fonts.map.data = fonts.map.data or { }
-fonts.map.encodings = fonts.map.encodings or { }
-fonts.map.done = fonts.map.done or { }
-fonts.map.loaded = fonts.map.loaded or { }
-fonts.map.direct = fonts.map.direct or { }
-fonts.map.line = fonts.map.line or { }
-
-function fonts.map.line.pdfmapline(tag,str)
- return "\\loadmapline[" .. tag .. "][" .. str .. "]"
-end
-
-function fonts.map.line.pdftex(e) -- so far no combination of slant and stretch
- if e.name and e.fontfile then
- local fullname = e.fullname or ""
- if e.slant and e.slant ~= 0 then
- if e.encoding then
- return fonts.map.line.pdfmapline("=",format('%s %s "%g SlantFont" <%s <%s',e.name,fullname,e.slant,e.encoding,e.fontfile))
- else
- return fonts.map.line.pdfmapline("=",format('%s %s "%g SlantFont" <%s',e.name,fullname,e.slant,e.fontfile))
- end
- elseif e.stretch and e.stretch ~= 1 and e.stretch ~= 0 then
- if e.encoding then
- return fonts.map.line.pdfmapline("=",format('%s %s "%g ExtendFont" <%s <%s',e.name,fullname,e.stretch,e.encoding,e.fontfile))
- else
- return fonts.map.line.pdfmapline("=",format('%s %s "%g ExtendFont" <%s',e.name,fullname,e.stretch,e.fontfile))
- end
- else
- if e.encoding then
- return fonts.map.line.pdfmapline("=",format('%s %s <%s <%s',e.name,fullname,e.encoding,e.fontfile))
- else
- return fonts.map.line.pdfmapline("=",format('%s %s <%s',e.name,fullname,e.fontfile))
- end
- end
- else
- return nil
- end
-end
-
-function fonts.map.flush(backend) -- will also erase the accumulated data
- local flushline = fonts.map.line[backend or "pdftex"] or fonts.map.line.pdftex
- for _, e in pairs(fonts.map.data) do
- tex.sprint(ctxcatcodes,flushline(e))
- end
- fonts.map.data = { }
-end
-
-fonts.map.line.dvips = fonts.map.line.pdftex
-fonts.map.line.dvipdfmx = function() end
-
-function fonts.map.convert_entries(filename)
- if not fonts.map.loaded[filename] then
- fonts.map.data, fonts.map.encodings = fonts.map.load_file(filename,fonts.map.data, fonts.map.encodings)
- fonts.map.loaded[filename] = true
- end
-end
-
-function fonts.map.load_file(filename, entries, encodings)
- entries = entries or { }
- encodings = encodings or { }
- local f = io.open(filename)
- if f then
- local data = f:read("*a")
- if data then
- for line in gmatch(data,"(.-)[\n\t]") do
- if find(line,"^[%#%%%s]") then
- -- print(line)
- else
- local stretch, slant, name, fullname, fontfile, encoding
- line = line:gsub('"(.+)"', function(s)
- stretch = find(s,'"([^"]+) ExtendFont"')
- slant = find(s,'"([^"]+) SlantFont"')
- return ""
- end)
- if not name then
- -- name fullname encoding fontfile
- name, fullname, encoding, fontfile = match(line,"^(%S+)%s+(%S*)[%s<]+(%S*)[%s<]+(%S*)%s*$")
- end
- if not name then
- -- name fullname (flag) fontfile encoding
- name, fullname, fontfile, encoding = match(line,"^(%S+)%s+(%S*)[%d%s<]+(%S*)[%s<]+(%S*)%s*$")
- end
- if not name then
- -- name fontfile
- name, fontfile = match(line,"^(%S+)%s+[%d%s<]+(%S*)%s*$")
- end
- if name then
- if encoding == "" then encoding = nil end
- entries[name] = {
- name = name, -- handy
- fullname = fullname,
- encoding = encoding,
- fontfile = fontfile,
- slant = tonumber(slant),
- stretch = tonumber(stretch)
- }
- encodings[name] = encoding
- elseif line ~= "" then
- -- print(line)
- end
- end
- end
- end
- f:close()
- end
- return entries, encodings
-end
+fonts = fonts or { }
+fonts.map = fonts.map or { }
-function fonts.map.load_lum_table(filename)
+local function load_lum_table(filename) -- will move to font goodies
local lumname = file.replacesuffix(file.basename(filename),"lum")
local lumfile = resolvers.find_file(lumname,"map") or ""
if lumfile ~= "" and lfs.isfile(lumfile) then
@@ -141,17 +39,19 @@ end
local hex = lpeg.R("AF","09")
local hexfour = (hex*hex*hex*hex) / function(s) return tonumber(s,16) end
-local dec = (lpeg.R("09")^1) / tonumber
+local hexsix = (hex^1) / function(s) return tonumber(s,16) end
+local dec = (lpeg.R("09")^1) / tonumber
local period = lpeg.P(".")
local unicode = lpeg.P("uni") * (hexfour * (period + lpeg.P(-1)) * lpeg.Cc(false) + lpeg.Ct(hexfour^1) * lpeg.Cc(true))
+local ucode = lpeg.P("u") * (hexsix * (period + lpeg.P(-1)) * lpeg.Cc(false) + lpeg.Ct(hexsix ^1) * lpeg.Cc(true))
local index = lpeg.P("index") * dec * lpeg.Cc(false)
-local parser = unicode + index
+local parser = unicode + ucode + index
local parsers = { }
-function fonts.map.make_name_parser(str)
+local function make_name_parser(str)
if not str or str == "" then
return parser
else
@@ -165,17 +65,20 @@ function fonts.map.make_name_parser(str)
end
--~ local parser = fonts.map.make_name_parser("Japan1")
+--~ local parser = fonts.map.make_name_parser()
--~ local function test(str)
---~ local b, a = parser:match(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("index1234")
--~ test("Japan1.123")
-function fonts.map.tounicode16(unicode)
+local function tounicode16(unicode)
if unicode < 0x10000 then
return format("%04X",unicode)
else
@@ -183,7 +86,7 @@ function fonts.map.tounicode16(unicode)
end
end
-function fonts.map.tounicode16sequence(unicodes)
+local function tounicode16sequence(unicodes)
local t = { }
for l=1,#unicodes do
local unicode = unicodes[l]
@@ -216,3 +119,252 @@ end
--~ return s
--~ end
+fonts.map.load_lum_table = load_lum_table
+fonts.map.make_name_parser = make_name_parser
+fonts.map.tounicode16 = tounicode16
+fonts.map.tounicode16sequence = tounicode16sequence
+
+local separator = lpeg.S("_.")
+local other = lpeg.C((1 - separator)^1)
+local ligsplitter = lpeg.Ct(other * (separator * other)^0)
+
+--~ print(table.serialize(lpegmatch(ligsplitter,"this")))
+--~ print(table.serialize(lpegmatch(ligsplitter,"this.that")))
+--~ print(table.serialize(lpegmatch(ligsplitter,"japan1.123")))
+--~ print(table.serialize(lpegmatch(ligsplitter,"such_so_more")))
+--~ print(table.serialize(lpegmatch(ligsplitter,"such_so_more.that")))
+
+fonts.map.add_to_unicode = function(data,filename)
+ local unicodes = data.luatex and data.luatex.unicodes
+ if not unicodes then
+ return
+ end
+ -- 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
+ -- the tounicode mapping is sparse and only needed for alternatives
+ local tounicode, originals, ns, nl, private, unknown = { }, { }, 0, 0, fonts.private, format("%04X",utfbyte("?"))
+ data.luatex.tounicode, data.luatex.originals = tounicode, originals
+ local lumunic, uparser, oparser
+ if false then -- will become an option
+ lumunic = load_lum_table(filename)
+ lumunic = lumunic and lumunic.tounicode
+ end
+ local cidinfo, cidnames, cidcodes = data.cidinfo
+ local usedmap = cidinfo and cidinfo.usedname
+ usedmap = usedmap and lower(usedmap)
+ usedmap = usedmap and fonts.cid.map[usedmap]
+ if usedmap then
+ oparser = usedmap and make_name_parser(cidinfo.ordering)
+ cidnames = usedmap.names
+ cidcodes = usedmap.unicodes
+ end
+ uparser = make_name_parser()
+ local aglmap = fonts.map and fonts.map.agl_to_unicode
+ for index, glyph in next, data.glyphs do
+ local name, unic = glyph.name, glyph.unicode or -1 -- play safe
+ if unic == -1 or unic >= private or (unic >= 0xE000 and unic <= 0xF8FF) or unic == 0xFFFE or unic == 0xFFFF then
+ local unicode = (lumunic and lumunic[name]) or (aglmap and aglmap[name])
+ if unicode then
+ originals[index], tounicode[index], ns = unicode, tounicode16(unicode), 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
+ originals[index], tounicode[index], ns = unicode, tounicode16(unicode), 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
+ originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1
+ end
+ end
+ if not unicode then
+ local foundcodes, multiple = lpegmatch(uparser,reference)
+ if foundcodes then
+ if multiple then
+ originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true
+ else
+ originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ -- a.whatever or a_b_c.whatever or a_b_c (no numbers)
+ if not unicode then
+ local split = lpegmatch(ligsplitter,name)
+ local nplit = (split and #split) or 0
+ if nplit == 0 then
+ -- skip
+ elseif nplit == 1 then
+ local base = split[1]
+ unicode = unicodes[base] or (aglmap and aglmap[base])
+ if unicode then
+ if type(unicode) == "table" then
+ unicode = unicode[1]
+ end
+ originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1
+ end
+ else
+ local t = { }
+ for l=1,nplit do
+ local base = split[l]
+ local u = unicodes[base] or (aglmap and aglmap[base])
+ if not u then
+ break
+ elseif type(u) == "table" then
+ t[#t+1] = u[1]
+ else
+ t[#t+1] = u
+ end
+ end
+ if #t > 0 then -- done then
+ originals[index], tounicode[index], nl, unicode = t, tounicode16sequence(t), nl + 1, true
+ end
+ end
+ end
+ -- last resort
+ if not unicode then
+ local foundcodes, multiple = lpegmatch(uparser,name)
+ if foundcodes then
+ if multiple then
+ originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true
+ else
+ originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes
+ end
+ end
+ end
+ if not unicode then
+ originals[index], tounicode[index] = 0xFFFD, "FFFD"
+ end
+ end
+ end
+ if trace_unimapping then
+ for index, glyph in table.sortedhash(data.glyphs) do
+ local toun, name, unic = tounicode[index], glyph.name, glyph.unicode or -1 -- play safe
+ if toun then
+ logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X, tounicode: %s",index,name,unic,toun)
+ else
+ logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X",index,name,unic)
+ end
+ end
+ end
+ if trace_loading and (ns > 0 or nl > 0) then
+ logs.report("load otf","enhance: %s tounicode entries added (%s ligatures)",nl+ns, ns)
+ end
+end
+
+-- the following is sort of obsolete
+--
+-- fonts.map.data = fonts.map.data or { }
+-- fonts.map.encodings = fonts.map.encodings or { }
+-- fonts.map.loaded = fonts.map.loaded or { }
+-- fonts.map.line = fonts.map.line or { }
+--
+-- function fonts.map.line.pdftex(e)
+-- if e.name and e.fontfile then
+-- local fullname = e.fullname or ""
+-- if e.slant and e.slant ~= 0 then
+-- if e.encoding then
+-- pdf.mapline(format('= %s %s "%g SlantFont" <%s <%s',e.name,fullname,e.slant,e.encoding,e.fontfile)))
+-- else
+-- pdf.mapline(format('= %s %s "%g SlantFont" <%s',e.name,fullname,e.slant,e.fontfile)))
+-- end
+-- elseif e.extend and e.extend ~= 1 and e.extend ~= 0 then
+-- if e.encoding then
+-- pdf.mapline(format('= %s %s "%g ExtendFont" <%s <%s',e.name,fullname,e.extend,e.encoding,e.fontfile)))
+-- else
+-- pdf.mapline(format('= %s %s "%g ExtendFont" <%s',e.name,fullname,e.extend,e.fontfile)))
+-- end
+-- else
+-- if e.encoding then
+-- pdf.mapline(format('= %s %s <%s <%s',e.name,fullname,e.encoding,e.fontfile)))
+-- else
+-- pdf.mapline(format('= %s %s <%s',e.name,fullname,e.fontfile)))
+-- end
+-- end
+-- else
+-- return nil
+-- end
+-- end
+--
+-- function fonts.map.flush(backend) -- will also erase the accumulated data
+-- local flushline = fonts.map.line[backend or "pdftex"] or fonts.map.line.pdftex
+-- for _, e in next, fonts.map.data do
+-- flushline(e)
+-- end
+-- fonts.map.data = { }
+-- end
+--
+-- fonts.map.line.dvips = fonts.map.line.pdftex
+-- fonts.map.line.dvipdfmx = function() end
+--
+-- function fonts.map.convert_entries(filename)
+-- if not fonts.map.loaded[filename] then
+-- fonts.map.data, fonts.map.encodings = fonts.map.load_file(filename,fonts.map.data, fonts.map.encodings)
+-- fonts.map.loaded[filename] = true
+-- end
+-- end
+--
+-- function fonts.map.load_file(filename, entries, encodings)
+-- entries = entries or { }
+-- encodings = encodings or { }
+-- local f = io.open(filename)
+-- if f then
+-- local data = f:read("*a")
+-- if data then
+-- for line in gmatch(data,"(.-)[\n\t]") do
+-- if find(line,"^[%#%%%s]") then
+-- -- print(line)
+-- else
+-- local extend, slant, name, fullname, fontfile, encoding
+-- line = gsub(line,'"(.+)"', function(s)
+-- extend = find(s,'"([^"]+) ExtendFont"')
+-- slant = find(s,'"([^"]+) SlantFont"')
+-- return ""
+-- end)
+-- if not name then
+-- -- name fullname encoding fontfile
+-- name, fullname, encoding, fontfile = match(line,"^(%S+)%s+(%S*)[%s<]+(%S*)[%s<]+(%S*)%s*$")
+-- end
+-- if not name then
+-- -- name fullname (flag) fontfile encoding
+-- name, fullname, fontfile, encoding = match(line,"^(%S+)%s+(%S*)[%d%s<]+(%S*)[%s<]+(%S*)%s*$")
+-- end
+-- if not name then
+-- -- name fontfile
+-- name, fontfile = match(line,"^(%S+)%s+[%d%s<]+(%S*)%s*$")
+-- end
+-- if name then
+-- if encoding == "" then encoding = nil end
+-- entries[name] = {
+-- name = name, -- handy
+-- fullname = fullname,
+-- encoding = encoding,
+-- fontfile = fontfile,
+-- slant = tonumber(slant),
+-- extend = tonumber(extend)
+-- }
+-- encodings[name] = encoding
+-- elseif line ~= "" then
+-- -- print(line)
+-- end
+-- end
+-- end
+-- end
+-- f:close()
+-- end
+-- return entries, encodings
+-- end
diff --git a/Master/texmf-dist/tex/context/base/font-mis.lua b/Master/texmf-dist/tex/context/base/font-mis.lua
index cc20b97119a..80a56332aca 100644
--- a/Master/texmf-dist/tex/context/base/font-mis.lua
+++ b/Master/texmf-dist/tex/context/base/font-mis.lua
@@ -6,12 +6,12 @@ if not modules then modules = { } end modules ['font-mis'] = {
license = "see context related readme files"
}
-local next, pairs, ipairs = next, pairs, ipairs
+local next = next
local lower, strip = string.lower, string.strip
fonts.otf = fonts.otf or { }
-fonts.otf.version = fonts.otf.version or 2.628
+fonts.otf.version = fonts.otf.version or 2.650
fonts.otf.pack = true
fonts.otf.cache = containers.define("fonts", "otf", fonts.otf.version, true)
@@ -33,9 +33,11 @@ function fonts.otf.loadcached(filename,format,sub)
end
end
+local featuregroups = { "gsub", "gpos" }
+
function fonts.get_features(name,t,script,language)
local t = lower(t or (name and file.extname(name)) or "")
- if t == "otf" or t == "ttf" or t == "ttc" then
+ if t == "otf" or t == "ttf" or t == "ttc" or t == "dfont" then
local filename = resolvers.find_file(name,t) or ""
if filename ~= "" then
local data = fonts.otf.loadcached(filename)
@@ -47,20 +49,28 @@ function fonts.get_features(name,t,script,language)
local data = fontloader.to_table(ff)
fontloader.close(ff)
local features = { }
- for k, what in pairs { "gsub", "gpos" } do
+ for k=1,#featuregroups do
+ local what = featuregroups[k]
local dw = data[what]
if dw then
local f = { }
features[what] = f
- for _, d in ipairs(dw) do
- if d.features then
- for _, df in ipairs(d.features) do
+ for i=1,#dw do
+ local d = dw[i]
+ local dfeatures = d.features
+ if dfeatures then
+ for i=1,#dfeatures do
+ local df = dfeatures[i]
local tag = strip(lower(df.tag))
local ft = f[tag] if not ft then ft = {} f[tag] = ft end
- for _, ds in ipairs(df.scripts) do
+ local dfscripts = df.scripts
+ for i=1,#dfscripts do
+ local ds = dfscripts[i]
local scri = strip(lower(ds.script))
local fts = ft[scri] if not fts then fts = {} ft[scri] = fts end
- for _, lang in ipairs(ds.langs) do
+ local dslangs = ds.langs
+ for i=1,#dslangs do
+ local lang = dslangs[i]
lang = strip(lower(lang))
if scri == script then
if lang == language then
diff --git a/Master/texmf-dist/tex/context/base/font-ota.lua b/Master/texmf-dist/tex/context/base/font-ota.lua
index 72e7414c8af..0b61e17d1e0 100644
--- a/Master/texmf-dist/tex/context/base/font-ota.lua
+++ b/Master/texmf-dist/tex/context/base/font-ota.lua
@@ -35,10 +35,6 @@ local penalty = node.id('penalty')
local set_attribute = node.set_attribute
local has_attribute = node.has_attribute
local traverse_id = node.traverse_id
-local delete_node = nodes.delete
-local replace_node = nodes.replace
-local insert_node_after = node.insert_after
-local insert_node_before = node.insert_before
local traverse_node_list = node.traverse
local fontdata = fonts.ids
@@ -54,7 +50,6 @@ local a_to_language = otf.a_to_language
-- font related value, but then we also need dynamic features which is
-- somewhat slower; and .. we need a chain of them
-
function fonts.initializers.node.otf.analyze(tfmdata,value,attr)
if attr and attr > 0 then
script, language = a_to_script[attr], a_to_language[attr]
@@ -131,7 +126,8 @@ local isol_fina = {
[0x06D3] = true, [0x06D5] = true, [0x06EE] = true, [0x06EF] = true,
[0x0759] = true, [0x075A] = true, [0x075B] = true, [0x076B] = true,
[0x076C] = true, [0x0771] = true, [0x0773] = true, [0x0774] = true,
- [0x0778] = true, [0x0779] = true,
+ [0x0778] = true, [0x0779] = true, [0xFEF5] = true, [0xFEF7] = true,
+ [0xFEF9] = true, [0xFEFB] = true,
}
local isol_fina_medi_init = {
@@ -192,8 +188,6 @@ function fonts.analyzers.methods.nocolor(head,font,attr)
return head, true
end
-otf.remove_joiners = false -- true -- for idris who want it as option
-
local function finish(first,last)
if last then
if first == last then
@@ -239,22 +233,10 @@ function fonts.analyzers.methods.arab(head,font,attr) -- maybe make a special ve
local tfmdata = fontdata[font]
local marks = tfmdata.marks
local first, last, current, done = nil, nil, head, false
- local joiners, nonjoiners
- local removejoiners = tfmdata.remove_joiners -- or otf.remove_joiners
- if removejoiners then
- joiners, nonjoiners = { }, { }
- end
while current do
if current.id == glyph and current.subtype<256 and current.font == font and not has_attribute(current,state) then
done = true
local char = current.char
- if removejoiners then
- if char == zwj then
- joiners[#joiners+1] = current
- elseif char == zwnj then
- nonjoiners[#nonjoiners+1] = current
- end
- end
if marks[char] then
set_attribute(current,state,5) -- mark
if trace_analyzing then fcs(current,"font:mark") end
@@ -300,21 +282,5 @@ function fonts.analyzers.methods.arab(head,font,attr) -- maybe make a special ve
current = current.next
end
first, last = finish(first,last)
- if removejoiners then
- for i=1,#joiners do
- head = delete_node(head,joiners[i])
- end
- for i=1,#nonjoiners do
- head = replace_node(head,nonjoiners[i],nodes.glue(0)) -- or maybe a kern
- end
- end
return head, done
end
-
-table.insert(fonts.manipulators,"joiners")
-
-function fonts.initializers.node.otf.joiners(tfmdata,value)
- if value == "strip" then
- tfmdata.remove_joiners = true
- end
-end
diff --git a/Master/texmf-dist/tex/context/base/font-otb.lua b/Master/texmf-dist/tex/context/base/font-otb.lua
index a4606d31951..a3d347737c8 100644
--- a/Master/texmf-dist/tex/context/base/font-otb.lua
+++ b/Master/texmf-dist/tex/context/base/font-otb.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-otb'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['font-otb'] = {
local concat = table.concat
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring = type, next, tonumber, tostring
+local lpegmatch = lpeg.match
local otf = fonts.otf
local tfm = fonts.tfm
@@ -69,7 +70,7 @@ local function resolve_ligatures(tfmdata,ligatures,kind)
for k,v in next, ligatures do
local lig = v[1]
if not done[lig] then
- local ligs = split_at_space:match(lig)
+ local ligs = lpegmatch(split_at_space,lig)
if #ligs == 2 then
local uc = v[2]
local c, f, s = characters[uc], ligs[1], ligs[2]
@@ -133,43 +134,12 @@ local function resolve_ligatures(tfmdata,ligatures,kind)
end
end
-local function collect_lookups(otfdata,kind,script,language)
- -- maybe store this in the font
- local sequences = otfdata.luatex.sequences
- if sequences then
- local featuremap, featurelist = { }, { }
- for s=1,#sequences do
- local sequence = sequences[s]
- local features = sequence.features
- features = features and features[kind]
- features = features and (features[script] or features[default] or features[wildcard])
- features = features and (features[language] or features[default] or features[wildcard])
- if features then
- local subtables = sequence.subtables
- if subtables then
- for s=1,#subtables do
- local ss = subtables[s]
- if not featuremap[s] then
- featuremap[ss] = true
- featurelist[#featurelist+1] = ss
- end
- end
- end
- end
- end
- if #featurelist > 0 then
- return featuremap, featurelist
- end
- end
- return nil, nil
-end
-
local splitter = lpeg.splitat(" ")
function prepare_base_substitutions(tfmdata,kind,value) -- we can share some code with the node features
if value then
local otfdata = tfmdata.shared.otfdata
- local validlookups, lookuplist = collect_lookups(otfdata,kind,tfmdata.script,tfmdata.language)
+ local validlookups, lookuplist = otf.collect_lookups(otfdata,kind,tfmdata.script,tfmdata.language)
if validlookups then
local ligatures = { }
local unicodes = tfmdata.unicodes -- names to unicodes
@@ -177,9 +147,84 @@ function prepare_base_substitutions(tfmdata,kind,value) -- we can share some cod
local characters = tfmdata.characters
local descriptions = tfmdata.descriptions
local changed = tfmdata.changed
+ --
+ local actions = {
+ substitution = function(p,lookup,k,glyph,unicode)
+ local pv = p[2] -- p.variant
+ if pv then
+ local upv = unicodes[pv]
+ if upv then
+ if type(upv) == "table" then
+ upv = upv[1]
+ end
+ if characters[upv] then
+ if trace_baseinit and trace_singles then
+ logs.report("define otf","%s: base substitution %s => %s",cref(kind,lookup),gref(descriptions,k),gref(descriptions,upv))
+ end
+ changed[k] = upv
+ end
+ end
+ end
+ end,
+ alternate = function(p,lookup,k,glyph,unicode)
+ local pc = p[2] -- p.components
+ if pc then
+ -- a bit optimized ugliness
+ if value == 1 then
+ pc = lpegmatch(splitter,pc)
+ elseif value == 2 then
+ local a, b = lpegmatch(splitter,pc)
+ pc = b or a
+ else
+ pc = { lpegmatch(splitter,pc) }
+ pc = pc[value] or pc[#pc]
+ end
+ if pc then
+ local upc = unicodes[pc]
+ if upc then
+ if type(upc) == "table" then
+ upc = upc[1]
+ end
+ if characters[upc] then
+ if trace_baseinit and trace_alternatives then
+ logs.report("define otf","%s: base alternate %s %s => %s",cref(kind,lookup),tostring(value),gref(descriptions,k),gref(descriptions,upc))
+ end
+ changed[k] = upc
+ end
+ end
+ end
+ end
+ end,
+ ligature = function(p,lookup,k,glyph,unicode)
+ local pc = p[2]
+ if pc then
+ if trace_baseinit and trace_ligatures then
+ local upc = { lpegmatch(splitter,pc) }
+ for i=1,#upc do upc[i] = unicodes[upc[i]] end
+ -- we assume that it's no table
+ logs.report("define otf","%s: base ligature %s => %s",cref(kind,lookup),gref(descriptions,upc),gref(descriptions,k))
+ end
+ ligatures[#ligatures+1] = { pc, k }
+ end
+ end,
+ }
+ --
for k,c in next, characters do
local glyph = descriptions[k]
- local lookups = glyph.lookups
+ local lookups = glyph.slookups
+ if lookups then
+ for l=1,#lookuplist do
+ local lookup = lookuplist[l]
+ local p = lookups[lookup]
+ if p then
+ local a = actions[p[1]]
+ if a then
+ a(p,lookup,k,glyph,unicode)
+ end
+ end
+ end
+ end
+ local lookups = glyph.mlookups
if lookups then
for l=1,#lookuplist do
local lookup = lookuplist[l]
@@ -187,62 +232,9 @@ function prepare_base_substitutions(tfmdata,kind,value) -- we can share some cod
if ps then
for i=1,#ps do
local p = ps[i]
- local t = p[1]
- if t == 'substitution' then
- local pv = p[2] -- p.variant
- if pv then
- local upv = unicodes[pv]
- if upv then
- if type(upv) == "table" then
- upv = upv[1]
- end
- if characters[upv] then
- if trace_baseinit and trace_singles then
- logs.report("define otf","%s: base substitution %s => %s",cref(kind,lookup),gref(descriptions,k),gref(descriptions,upv))
- end
- changed[k] = upv
- end
- end
- end
- elseif t == 'alternate' then
- local pc = p[2] -- p.components
- if pc then
- -- a bit optimized ugliness
- if value == 1 then
- pc = splitter:match(pc)
- elseif value == 2 then
- local a, b = splitter:match(pc)
- pc = b or a
- else
- pc = { splitter:match(pc) }
- pc = pc[value] or pc[#pc]
- end
- if pc then
- local upc = unicodes[pc]
- if upc then
- if type(upc) == "table" then
- upc = upc[1]
- end
- if characters[upc] then
- if trace_baseinit and trace_alternatives then
- logs.report("define otf","%s: base alternate %s => %s",cref(kind,lookup),gref(descriptions,k),gref(descriptions,upc))
- end
- changed[k] = upc
- end
- end
- end
- end
- elseif t == 'ligature' and not changed[k] then
- local pc = p[2]
- if pc then
- if trace_baseinit and trace_ligatures then
- local upc = { splitter:match(pc) }
- for i=1,#upc do upc[i] = unicodes[upc[i]] end
- -- we assume that it's no table
- logs.report("define otf","%s: base ligature %s => %s",cref(kind,lookup),gref(descriptions,upc),gref(descriptions,k))
- end
- ligatures[#ligatures+1] = { pc, k }
- end
+ local a = actions[p[1]]
+ if a then
+ a(p,lookup,k,glyph,unicode)
end
end
end
@@ -259,37 +251,46 @@ end
local function prepare_base_kerns(tfmdata,kind,value) -- todo what kind of kerns, currently all
if value then
local otfdata = tfmdata.shared.otfdata
- local validlookups, lookuplist = collect_lookups(otfdata,kind,tfmdata.script,tfmdata.language)
+ local validlookups, lookuplist = otf.collect_lookups(otfdata,kind,tfmdata.script,tfmdata.language)
if validlookups then
local unicodes = tfmdata.unicodes -- names to unicodes
local indices = tfmdata.indices
local characters = tfmdata.characters
local descriptions = tfmdata.descriptions
+ local sharedkerns = { }
for u, chr in next, characters do
local d = descriptions[u]
if d then
- local dk = d.mykerns
+ local dk = d.mykerns -- shared
if dk then
- local t, done = chr.kerns or { }, false
- for l=1,#lookuplist do
- local lookup = lookuplist[l]
- local kerns = dk[lookup]
- if kerns then
- for k, v in next, kerns do
- if v ~= 0 and not t[k] then -- maybe no 0 test here
- t[k], done = v, true
- if trace_baseinit and trace_kerns then
- logs.report("define otf","%s: base kern %s + %s => %s",cref(kind,lookup),gref(descriptions,u),gref(descriptions,k),v)
+ local s = sharedkerns[dk]
+ if s == false then
+ -- skip
+ elseif s then
+ chr.kerns = s
+ else
+ local t, done = chr.kerns or { }, false
+ for l=1,#lookuplist do
+ local lookup = lookuplist[l]
+ local kerns = dk[lookup]
+ if kerns then
+ for k, v in next, kerns do
+ if v ~= 0 and not t[k] then -- maybe no 0 test here
+ t[k], done = v, true
+ if trace_baseinit and trace_kerns then
+ logs.report("define otf","%s: base kern %s + %s => %s",cref(kind,lookup),gref(descriptions,u),gref(descriptions,k),v)
+ end
end
end
end
end
+ if done then
+ sharedkerns[dk] = t
+ chr.kerns = t -- no empty assignments
+ else
+ sharedkerns[dk] = false
+ end
end
- if done then
- chr.kerns = t -- no empty assignments
- end
- -- elseif d.kerns then
- -- logs.report("define otf","%s: invalid mykerns for %s",cref(kind),gref(descriptions,u))
end
end
end
@@ -304,12 +305,13 @@ end
-- to do complete mixed runs and not run featurewise (as we did before).
local supported_gsub = {
- 'liga','dlig','rlig','hlig',
- 'pnum','onum','tnum','lnum',
+ 'liga', 'dlig', 'rlig', 'hlig',
+ 'pnum', 'onum', 'tnum', 'lnum',
'zero',
- 'smcp','cpsp','c2sc','ornm','aalt',
- 'hwid','fwid',
- 'ssty', -- math
+ 'smcp', 'cpsp', 'c2sc', 'ornm', 'aalt',
+ 'hwid', 'fwid',
+ 'ssty', 'rtlm', -- math
+-- 'tlig', 'trep',
}
local supported_gpos = {
diff --git a/Master/texmf-dist/tex/context/base/font-otc.lua b/Master/texmf-dist/tex/context/base/font-otc.lua
index f75da39cdab..357d347b18c 100644
--- a/Master/texmf-dist/tex/context/base/font-otc.lua
+++ b/Master/texmf-dist/tex/context/base/font-otc.lua
@@ -9,8 +9,6 @@ if not modules then modules = { } end modules ['font-otc'] = {
local format, insert = string.format, table.insert
local type, next = type, next
-local ctxcatcodes = tex.ctxcatcodes
-
-- we assume that the other otf stuff is loaded already
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -21,6 +19,8 @@ local tfm = fonts.tfm
-- instead of "script = "DFLT", langs = { 'dflt' }" we now use wildcards (we used to
-- have always); some day we can write a "force always when true" trick for other
-- features as well
+--
+-- we could have a tnum variant as well
local extra_lists = {
tlig = {
@@ -211,28 +211,3 @@ fonts.initializers.node.otf.lineheight = fonts.initializers.common.lineheight
fonts.initializers.base.otf.compose = fonts.initializers.common.compose
fonts.initializers.node.otf.compose = fonts.initializers.common.compose
-
--- bonus function
-
-function otf.name_to_slot(name) -- todo: afm en tfm
- local tfmdata = fonts.ids[font.current()]
- if tfmdata and tfmdata.shared then
- local otfdata = tfmdata.shared.otfdata
- local unicode = otfdata.luatex.unicodes[name]
- if type(unicode) == "number" then
- return unicode
- else
- return unicode[1]
- end
- end
- return nil
-end
-
-function otf.char(n) -- todo: afm en tfm
- if type(n) == "string" then
- n = otf.name_to_slot(n)
- end
- if n then
- tex.sprint(ctxcatcodes,format("\\char%s ",n))
- end
-end
diff --git a/Master/texmf-dist/tex/context/base/font-otd.lua b/Master/texmf-dist/tex/context/base/font-otd.lua
index 78a82814654..41e8853316c 100644
--- a/Master/texmf-dist/tex/context/base/font-otd.lua
+++ b/Master/texmf-dist/tex/context/base/font-otd.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-otd'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/font-otf.lua b/Master/texmf-dist/tex/context/base/font-otf.lua
index e8867c53d37..9cecf21f055 100644
--- a/Master/texmf-dist/tex/context/base/font-otf.lua
+++ b/Master/texmf-dist/tex/context/base/font-otf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-otf'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -11,6 +11,8 @@ local utf = unicode.utf8
local concat, getn, utfbyte = table.concat, table.getn, utf.byte
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring = type, next, tonumber, tostring
+local abs = math.abs
+local lpegmatch = lpeg.match
local trace_private = false trackers.register("otf.private", function(v) trace_private = v end)
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -18,13 +20,10 @@ local trace_features = false trackers.register("otf.features", function(v
local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end)
local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end)
local trace_math = false trackers.register("otf.math", function(v) trace_math = v end)
-local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end)
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
--~ trackers.enable("otf.loading")
-local zwnj = 0x200C
-local zwj = 0x200D
-
--[[ldx--
<p>The fontforge table has organized lookups in a certain way. A first implementation
of this code was organized featurewise: information related to features was
@@ -82,13 +81,16 @@ otf.features.default = otf.features.default or { }
otf.enhancers = otf.enhancers or { }
otf.glists = { "gsub", "gpos" }
-otf.version = 2.628 -- beware: also sync font-mis.lua
+otf.version = 2.650 -- beware: also sync font-mis.lua
otf.pack = true -- beware: also sync font-mis.lua
otf.syncspace = true
otf.notdef = false
otf.cache = containers.define("fonts", "otf", otf.version, true)
otf.cleanup_aat = false -- only context
+local wildcard = "*"
+local default = "dflt"
+
--[[ldx--
<p>We start with a lot of tables and related functions.</p>
--ldx]]--
@@ -104,6 +106,7 @@ otf.tables.global_fields = table.tohash {
"names",
"unicodes",
"names",
+--~ "math",
"anchor_classes",
"kern_classes",
"gpos",
@@ -176,7 +179,7 @@ otf.tables.valid_fields = {
local function load_featurefile(ff,featurefile)
if featurefile then
- featurefile = resolvers.find_file(file.addsuffix(featurefile,'fea')) -- "FONTFEATURES"
+ featurefile = resolvers.find_file(file.addsuffix(featurefile,'fea'),'fea')
if featurefile and featurefile ~= "" then
if trace_loading then
logs.report("load otf", "featurefile: %s", featurefile)
@@ -190,7 +193,7 @@ function otf.enhance(name,data,filename,verbose)
local enhancer = otf.enhancers[name]
if enhancer then
if (verbose ~= nil and verbose) or trace_loading then
- logs.report("load otf","enhance: %s",name)
+ logs.report("load otf","enhance: %s (%s)",name,filename)
end
enhancer(data,filename)
end
@@ -202,8 +205,10 @@ local enhancers = {
"patch bugs",
"merge cid fonts", "prepare unicode", "cleanup ttf tables", "compact glyphs", "reverse coverage",
"cleanup aat", "enrich with features", "add some missing characters",
+ "reorganize mark classes",
"reorganize kerns", -- moved here
"flatten glyph lookups", "flatten anchor tables", "flatten feature tables",
+ "simplify glyph lookups", -- some saving
"prepare luatex tables",
"analyse features", "rehash features",
"analyse anchors", "analyse marks", "analyse unicodes", "analyse subtables",
@@ -211,6 +216,7 @@ local enhancers = {
"share widths",
"strip not needed data",
"migrate metadata",
+ "check math parameters",
}
function otf.load(filename,format,sub,featurefile)
@@ -227,7 +233,7 @@ function otf.load(filename,format,sub,featurefile)
local data = containers.read(otf.cache(), hash)
local size = lfs.attributes(filename,"size") or 0
if not data or data.verbose ~= fonts.verbose or data.size ~= size then
- logs.report("load otf","loading: %s",filename)
+ logs.report("load otf","loading: %s (hash: %s)",filename,hash)
local ff, messages
if sub then
ff, messages = fontloader.open(filename,sub)
@@ -235,9 +241,15 @@ function otf.load(filename,format,sub,featurefile)
ff, messages = fontloader.open(filename)
end
if trace_loading and messages and #messages > 0 then
- for m=1,#messages do
- logs.report("load otf","warning: %s",messages[m])
+ if type(messages) == "string" then
+ logs.report("load otf","warning: %s",messages)
+ else
+ for m=1,#messages do
+ logs.report("load otf","warning: %s",tostring(messages[m]))
+ end
end
+ else
+ logs.report("load otf","font loaded okay")
end
if ff then
load_featurefile(ff,featurefile)
@@ -248,6 +260,7 @@ function otf.load(filename,format,sub,featurefile)
logs.report("load otf","enhancing ...")
for e=1,#enhancers do
otf.enhance(enhancers[e],data,filename)
+ io.flush() -- we want instant messages
end
if otf.pack and not fonts.verbose then
otf.enhance("pack",data,filename)
@@ -267,6 +280,9 @@ function otf.load(filename,format,sub,featurefile)
end
end
if data then
+ if trace_defining then
+ logs.report("define font","loading from cache: %s",hash)
+ end
otf.enhance("unpack",data,filename,false) -- no message here
otf.add_dimensions(data)
if trace_sequences then
@@ -354,6 +370,29 @@ end
-- todo: normalize, design_size => designsize
+otf.enhancers["reorganize mark classes"] = function(data,filename)
+ if data.mark_classes then
+ local unicodes = data.luatex.unicodes
+ local reverse = { }
+ for name, class in next, data.mark_classes do
+ local t = { }
+ for s in gmatch(class,"[^ ]+") do
+ local us = unicodes[s]
+ if type(us) == "table" then
+ for u=1,#us do
+ t[us[u]] = true
+ end
+ else
+ t[us] = true
+ end
+ end
+ reverse[name] = t
+ end
+ data.luatex.markclasses = reverse
+ data.mark_classes = nil
+ end
+end
+
otf.enhancers["prepare luatex tables"] = function(data,filename)
data.luatex = data.luatex or { }
local luatex = data.luatex
@@ -465,140 +504,7 @@ otf.enhancers["analyse marks"] = function(data,filename)
end
end
-local separator = lpeg.S("_.")
-local other = lpeg.C((1 - separator)^1)
-local ligsplitter = lpeg.Ct(other * (separator * other)^0)
-
---~ print(table.serialize(ligsplitter:match("this")))
---~ print(table.serialize(ligsplitter:match("this.that")))
---~ print(table.serialize(ligsplitter:match("japan1.123")))
---~ print(table.serialize(ligsplitter:match("such_so_more")))
---~ print(table.serialize(ligsplitter:match("such_so_more.that")))
-
-otf.enhancers["analyse unicodes"] = function(data,filename)
- local tounicode16, tounicode16sequence = fonts.map.tounicode16, fonts.map.tounicode16sequence
- local unicodes = data.luatex.unicodes
- -- we need to move this code
- unicodes['space'] = unicodes['space'] or 32 -- handly later on
- unicodes['hyphen'] = unicodes['hyphen'] or 45 -- handly later on
- unicodes['zwj'] = unicodes['zwj'] or zwj -- handly later on
- unicodes['zwnj'] = unicodes['zwnj'] or zwnj -- handly later on
- -- the tounicode mapping is sparse and only needed for alternatives
- local tounicode, originals, ns, nl, private, unknown = { }, { }, 0, 0, fonts.private, format("%04X",utfbyte("?"))
- data.luatex.tounicode, data.luatex.originals = tounicode, originals
- local lumunic, uparser, oparser
- if false then -- will become an option
- lumunic = fonts.map.load_lum_table(filename)
- lumunic = lumunic and lumunic.tounicode
- end
- local cidinfo, cidnames, cidcodes = data.cidinfo
- local usedmap = cidinfo and cidinfo.usedname
- usedmap = usedmap and fonts.cid.map[usedmap]
- if usedmap then
- oparser = usedmap and fonts.map.make_name_parser(cidinfo.ordering)
- cidnames = usedmap.names
- cidcodes = usedmap.unicodes
- end
- uparser = fonts.map.make_name_parser()
- for index, glyph in next, data.glyphs do
- local name, unic = glyph.name, glyph.unicode or -1 -- play safe
- if unic == -1 or unic >= private or (unic >= 0xE000 and unic <= 0xF8FF) or unic == 0xFFFE or unic == 0xFFFF then
- local unicode = lumunic and lumunic[name]
- if unicode then
- originals[index], tounicode[index], ns = unicode, tounicode16(unicode), 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 = oparser:match(name)
- if foundindex then
- unicode = cidcodes[foundindex] -- name to number
- if not unicode then
- local reference = cidnames[foundindex] -- number to name
- if reference then
- local foundindex = oparser:match(reference)
- if foundindex then
- unicode = cidcodes[foundindex]
- if unicode then
- originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1
- end
- end
- if not unicode then
- local foundcodes, multiple = uparser:match(reference)
- if foundcodes then
- if multiple then
- originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true
- else
- originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes
- end
- end
- end
- end
- end
- end
- end
- -- a.whatever or a_b_c.whatever or a_b_c (no numbers)
- if not unicode then
- local split = ligsplitter:match(name)
- local nplit = (split and #split) or 0
- if nplit == 0 then
- -- skip
- elseif nplit == 1 then
- unicode = unicodes[split[1]]
- if unicode then
- if type(unicode) == "table" then
- unicode = unicode[1]
- end
- originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1
- end
- else
- local done = true
- for l=1,nplit do
- local u = unicodes[split[l]]
- if not u then
- done = false
- break
- elseif type(u) == "table" then
- split[l] = u[1]
- else
- split[l] = u
- end
- end
- if done then
- originals[index], tounicode[index], nl, unicode = split, tounicode16sequence(split), nl + 1, true
- end
- end
- end
- -- last resort
- if not unicode then
- local foundcodes, multiple = uparser:match(name)
- if foundcodes then
- if multiple then
- originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true
- else
- originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes
- end
- end
- end
- if not unicode then
- originals[index], tounicode[index] = 0xFFFD, "FFFD"
- end
- end
- end
- if trace_unimapping then
- for index, glyph in table.sortedpairs(data.glyphs) do
- local toun, name, unic = tounicode[index], glyph.name, glyph.unicode or -1 -- play safe
- if toun then
- logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X, tounicode: %s",index,name,unic,toun)
- else
- logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X",index,name,unic)
- end
- end
- end
- if trace_loading and (ns > 0 or nl > 0) then
- logs.report("load otf","enhance: %s tounicode entries added (%s ligatures)",nl+ns, ns)
- end
-end
+otf.enhancers["analyse unicodes"] = fonts.map.add_to_unicode
otf.enhancers["analyse subtables"] = function(data,filename)
data.luatex = data.luatex or { }
@@ -658,8 +564,11 @@ otf.enhancers["analyse subtables"] = function(data,filename)
(flags.ignorecombiningmarks and "mark") or false,
(flags.ignoreligatures and "ligature") or false,
(flags.ignorebaseglyphs and "base") or false,
- flags.r2l or false
+ flags.r2l or false,
}
+ if flags.mark_class then
+ gk.markclass = luatex.markclasses[flags.mark_class]
+ end
end
end
end
@@ -668,7 +577,10 @@ end
otf.enhancers["merge cid fonts"] = function(data,filename)
-- we can also move the names to data.luatex.names which might
-- save us some more memory (at the cost of harder tracing)
- if data.subfonts and table.is_empty(data.glyphs) then
+ if data.subfonts then
+ if data.glyphs and next(data.glyphs) then
+ logs.report("load otf","replacing existing glyph table due to subfonts")
+ end
local cidinfo = data.cidinfo
local verbose = fonts.verbose
if cidinfo.registry then
@@ -756,7 +668,7 @@ otf.enhancers["prepare unicode"] = function(data,filename)
end
end
end
- -- beware: the indeces table is used to initialize the tfm table
+ -- beware: the indices table is used to initialize the tfm table
for unicode, index in next, mapmap do
if not internals[index] then
local name = glyphs[index].name
@@ -952,6 +864,129 @@ end
-- kern: ttf has a table with kerns
+--~ otf.enhancers["reorganize kerns"] = function(data,filename)
+--~ local glyphs, mapmap, unicodes = data.glyphs, data.luatex.indices, data.luatex.unicodes
+--~ local mkdone = false
+--~ for index, glyph in next, data.glyphs do
+--~ if glyph.kerns then
+--~ local mykerns = { }
+--~ for k,v in next, glyph.kerns do
+--~ local vc, vo, vl = v.char, v.off, v.lookup
+--~ if vc and vo and vl then -- brrr, wrong! we miss the non unicode ones
+--~ local uvc = unicodes[vc]
+--~ if not uvc then
+--~ if trace_loading then
+--~ logs.report("load otf","problems with unicode %s of kern %s at glyph %s",vc,k,index)
+--~ end
+--~ else
+--~ if type(vl) ~= "table" then
+--~ vl = { vl }
+--~ end
+--~ for l=1,#vl do
+--~ local vll = vl[l]
+--~ local mkl = mykerns[vll]
+--~ if not mkl then
+--~ mkl = { }
+--~ mykerns[vll] = mkl
+--~ end
+--~ if type(uvc) == "table" then
+--~ for u=1,#uvc do
+--~ mkl[uvc[u]] = vo
+--~ end
+--~ else
+--~ mkl[uvc] = vo
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+--~ glyph.mykerns = mykerns
+--~ glyph.kerns = nil -- saves space and time
+--~ mkdone = true
+--~ end
+--~ end
+--~ if trace_loading and mkdone then
+--~ logs.report("load otf", "replacing 'kerns' tables by 'mykerns' tables")
+--~ end
+--~ if data.kerns then
+--~ if trace_loading then
+--~ logs.report("load otf", "removing global 'kern' table")
+--~ end
+--~ data.kerns = nil
+--~ end
+--~ local dgpos = data.gpos
+--~ if dgpos then
+--~ for gp=1,#dgpos do
+--~ local gpos = dgpos[gp]
+--~ local subtables = gpos.subtables
+--~ if subtables then
+--~ for s=1,#subtables do
+--~ local subtable = subtables[s]
+--~ local kernclass = subtable.kernclass -- name is inconsistent with anchor_classes
+--~ if kernclass then -- the next one is quite slow
+--~ for k=1,#kernclass do
+--~ local kcl = kernclass[k]
+--~ local firsts, seconds, offsets, lookups = kcl.firsts, kcl.seconds, kcl.offsets, kcl.lookup -- singular
+--~ if type(lookups) ~= "table" then
+--~ lookups = { lookups }
+--~ end
+--~ for l=1,#lookups do
+--~ local lookup = lookups[l]
+--~ -- weird, as maxfirst and maxseconds can have holes
+--~ local maxfirsts, maxseconds = getn(firsts), getn(seconds)
+--~ if trace_loading then
+--~ logs.report("load otf", "adding kernclass %s with %s times %s pairs",lookup, maxfirsts, maxseconds)
+--~ end
+--~ for fk, fv in next, firsts do
+--~ for first in gmatch(fv,"[^ ]+") do
+--~ local first_unicode = unicodes[first]
+--~ if type(first_unicode) == "number" then
+--~ first_unicode = { first_unicode }
+--~ end
+--~ for f=1,#first_unicode do
+--~ local glyph = glyphs[mapmap[first_unicode[f]]]
+--~ if glyph then
+--~ local mykerns = glyph.mykerns
+--~ if not mykerns then
+--~ mykerns = { } -- unicode indexed !
+--~ glyph.mykerns = mykerns
+--~ end
+--~ local lookupkerns = mykerns[lookup]
+--~ if not lookupkerns then
+--~ lookupkerns = { }
+--~ mykerns[lookup] = lookupkerns
+--~ end
+--~ for sk, sv in next, seconds do
+--~ local offset = offsets[(fk-1) * maxseconds + sk]
+--~ --~ local offset = offsets[sk] -- (fk-1) * maxseconds + sk]
+--~ for second in gmatch(sv,"[^ ]+") do
+--~ local second_unicode = unicodes[second]
+--~ if type(second_unicode) == "number" then
+--~ lookupkerns[second_unicode] = offset
+--~ else
+--~ for s=1,#second_unicode do
+--~ lookupkerns[second_unicode[s]] = offset
+--~ end
+--~ end
+--~ end
+--~ end
+--~ elseif trace_loading then
+--~ logs.report("load otf", "no glyph data for U+%04X", first_unicode[f])
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+--~ subtable.comment = "The kernclass table is merged into mykerns in the indexed glyph tables."
+--~ subtable.kernclass = { }
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+
otf.enhancers["reorganize kerns"] = function(data,filename)
local glyphs, mapmap, unicodes = data.glyphs, data.luatex.indices, data.luatex.unicodes
local mkdone = false
@@ -1004,6 +1039,9 @@ otf.enhancers["reorganize kerns"] = function(data,filename)
end
local dgpos = data.gpos
if dgpos then
+ local separator = lpeg.P(" ")
+ local other = ((1 - separator)^0) / unicodes
+ local splitter = lpeg.Ct(other * (separator * other)^0)
for gp=1,#dgpos do
local gpos = dgpos[gp]
local subtables = gpos.subtables
@@ -1011,54 +1049,75 @@ otf.enhancers["reorganize kerns"] = function(data,filename)
for s=1,#subtables do
local subtable = subtables[s]
local kernclass = subtable.kernclass -- name is inconsistent with anchor_classes
- if kernclass then
+ if kernclass then -- the next one is quite slow
for k=1,#kernclass do
local kcl = kernclass[k]
local firsts, seconds, offsets, lookups = kcl.firsts, kcl.seconds, kcl.offsets, kcl.lookup -- singular
if type(lookups) ~= "table" then
lookups = { lookups }
end
+ local split = { }
for l=1,#lookups do
local lookup = lookups[l]
+ -- weird, as maxfirst and maxseconds can have holes, first seems to be indexed, seconds starts at 2
local maxfirsts, maxseconds = getn(firsts), getn(seconds)
+ for _, s in next, firsts do
+ split[s] = split[s] or lpegmatch(splitter,s)
+ end
+ for _, s in next, seconds do
+ split[s] = split[s] or lpegmatch(splitter,s)
+ end
if trace_loading then
logs.report("load otf", "adding kernclass %s with %s times %s pairs",lookup, maxfirsts, maxseconds)
end
- for fk, fv in next, firsts do
- for first in gmatch(fv,"[^ ]+") do
- local first_unicode = unicodes[first]
- if type(first_unicode) == "number" then
- first_unicode = { first_unicode }
+ local function do_it(fk,first_unicode)
+ local glyph = glyphs[mapmap[first_unicode]]
+ if glyph then
+ local mykerns = glyph.mykerns
+ if not mykerns then
+ mykerns = { } -- unicode indexed !
+ glyph.mykerns = mykerns
end
- for f=1,#first_unicode do
- local glyph = glyphs[mapmap[first_unicode[f]]]
- if glyph then
- local mykerns = glyph.mykerns
- if not mykerns then
- mykerns = { } -- unicode indexed !
- glyph.mykerns = mykerns
- end
- local lookupkerns = mykerns[lookup]
- if not lookupkerns then
- lookupkerns = { }
- mykerns[lookup] = lookupkerns
- end
- for sk, sv in next, seconds do
- local offset = offsets[(fk-1) * maxseconds + sk]
- --~ local offset = offsets[sk] -- (fk-1) * maxseconds + sk]
- for second in gmatch(sv,"[^ ]+") do
- local second_unicode = unicodes[second]
- if type(second_unicode) == "number" then
- lookupkerns[second_unicode] = offset
- else
- for s=1,#second_unicode do
- lookupkerns[second_unicode[s]] = offset
- end
+ local lookupkerns = mykerns[lookup]
+ if not lookupkerns then
+ lookupkerns = { }
+ mykerns[lookup] = lookupkerns
+ end
+ local baseoffset = (fk-1) * maxseconds
+ for sk=2,maxseconds do
+ local sv = seconds[sk]
+ local offset = offsets[baseoffset + sk]
+ --~ local offset = offsets[sk] -- (fk-1) * maxseconds + sk]
+ local splt = split[sv]
+ if splt then
+ for i=1,#splt do
+ local second_unicode = splt[i]
+ if tonumber(second_unicode) then
+ lookupkerns[second_unicode] = offset
+ else
+ for s=1,#second_unicode do
+ lookupkerns[second_unicode[s]] = offset
end
end
end
- elseif trace_loading then
- logs.report("load otf", "no glyph data for U+%04X", first_unicode[f])
+ end
+ end
+ elseif trace_loading then
+ logs.report("load otf", "no glyph data for U+%04X", first_unicode)
+ end
+ end
+ for fk=1,#firsts do
+ local fv = firsts[fk]
+ local splt = split[fv]
+ if splt then
+ for i=1,#splt do
+ local first_unicode = splt[i]
+ if tonumber(first_unicode) then
+ do_it(fk,first_unicode)
+ else
+ for f=1,#first_unicode do
+ do_it(fk,first_unicode[f])
+ end
end
end
end
@@ -1132,10 +1191,31 @@ otf.enhancers["migrate metadata"] = function(data,filename)
metadata.charwidth = pfminfo and pfminfo.avgwidth
end
+local private_math_parameters = {
+ "FractionDelimiterSize",
+ "FractionDelimiterDisplayStyleSize",
+}
+
+otf.enhancers["check math parameters"] = function(data,filename)
+ local mathdata = data.metadata.math
+ if mathdata then
+ for m=1,#private_math_parameters do
+ local pmp = private_math_parameters[m]
+ if not mathdata[pmp] then
+ if trace_loading then
+ logs.report("load otf", "setting math parameter '%s' to 0", pmp)
+ end
+ mathdata[pmp] = 0
+ end
+ end
+ end
+end
+
otf.enhancers["flatten glyph lookups"] = function(data,filename)
for k, v in next, data.glyphs do
- if v.lookups then
- for kk, vv in next, v.lookups do
+ local lookups = v.lookups
+ if lookups then
+ for kk, vv in next, lookups do
for kkk=1,#vv do
local vvv = vv[kkk]
local s = vvv.specification
@@ -1185,6 +1265,31 @@ otf.enhancers["flatten glyph lookups"] = function(data,filename)
end
end
+otf.enhancers["simplify glyph lookups"] = function(data,filename)
+ for k, v in next, data.glyphs do
+ local lookups = v.lookups
+ if lookups then
+ local slookups, mlookups
+ for kk, vv in next, lookups do
+ if #vv == 1 then
+ if not slookups then
+ slookups = { }
+ v.slookups = slookups
+ end
+ slookups[kk] = vv[1]
+ else
+ if not mlookups then
+ mlookups = { }
+ v.mlookups = mlookups
+ end
+ mlookups[kk] = vv
+ end
+ end
+ v.lookups = nil
+ end
+ end
+end
+
otf.enhancers["flatten anchor tables"] = function(data,filename)
for k, v in next, data.glyphs do
if v.anchors then
@@ -1252,10 +1357,12 @@ function otf.features.register(name,default)
otf.features.default[name] = default
end
+-- for context this will become a task handler
+
function otf.set_features(tfmdata,features)
local processes = { }
- if not table.is_empty(features) then
- local lists = {
+ if features and next(features) then
+ local lists = { -- why local
fonts.triggers,
fonts.processors,
fonts.manipulators,
@@ -1292,7 +1399,7 @@ function otf.set_features(tfmdata,features)
end
end
end
- local fm = fonts.methods[mode]
+ local fm = fonts.methods[mode] -- todo: zonder node/mode otf/...
if fm then
local fmotf = fm.otf
if fmotf then
@@ -1329,14 +1436,14 @@ function otf.otf_to_tfm(specification)
--~ print(cache_id)
if not tfmdata then
local otfdata = otf.load(filename,format,sub,features and features.featurefile)
- if not table.is_empty(otfdata) then
+ if otfdata and next(otfdata) then
otfdata.shared = otfdata.shared or {
featuredata = { },
anchorhash = { },
initialized = false,
}
tfmdata = otf.copy_to_tfm(otfdata,cache_id)
- if not table.is_empty(tfmdata) then
+ if tfmdata and next(tfmdata) then
tfmdata.unique = tfmdata.unique or { }
tfmdata.shared = tfmdata.shared or { } -- combine
local shared = tfmdata.shared
@@ -1389,6 +1496,11 @@ end
-- we cannot share descriptions as virtual fonts might extend them (ok, we could
-- use a cache with a hash
+fonts.formats.dfont = "truetype"
+fonts.formats.ttc = "truetype"
+fonts.formats.ttf = "truetype"
+fonts.formats.otf = "opentype"
+
function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder the tma to unicode (nasty due to one->many)
if data then
local glyphs, pfminfo, metadata = data.glyphs or { }, data.pfminfo or { }, data.metadata or { }
@@ -1396,14 +1508,11 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
local unicodes = luatex.unicodes -- names to unicodes
local indices = luatex.indices
local characters, parameters, math_parameters, descriptions = { }, { }, { }, { }
- local tfm = {
- characters = characters,
- parameters = parameters,
- math_parameters = math_parameters,
- descriptions = descriptions,
- indices = indices,
- unicodes = unicodes,
- }
+ local designsize = metadata.designsize or metadata.design_size or 100
+ if designsize == 0 then
+ designsize = 100
+ end
+ local spaceunits = 500
-- indices maps from unicodes to indices
for u, i in next, indices do
characters[u] = { } -- we need this because for instance we add protruding info and loop over characters
@@ -1425,7 +1534,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
local variants = m.horiz_variants
if variants then
local c = char
- for n in variants:gmatch("[^ ]+") do
+ for n in gmatch(variants,"[^ ]+") do
local un = unicodes[n]
if un and u ~= un then
c.next = un
@@ -1437,7 +1546,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
local variants = m.vert_variants
if variants then
local c = char
- for n in variants:gmatch("[^ ]+") do
+ for n in gmatch(variants,"[^ ]+") do
local un = unicodes[n]
if un and u ~= un then
c.next = un
@@ -1445,6 +1554,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
end
end
c.vert_variants = m.vert_parts
+ c.vert_italic_correction = m.vert_italic_correction
end
end
local kerns = m.kerns
@@ -1455,64 +1565,49 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
end
end
-- end math
- local designsize = metadata.designsize or metadata.design_size or 100
- if designsize == 0 then
- designsize = 100
- end
- local spaceunits = 500
- tfm.units = metadata.units_per_em or 1000
- -- we need a runtime lookup because of running from cdrom or zip, brrr
- tfm.filename = resolvers.findbinfile(luatex.filename,"") or luatex.filename
- tfm.fullname = metadata.fontname or metadata.fullname
- tfm.psname = tfm.fullname
- tfm.encodingbytes = 2
- tfm.cidinfo = data.cidinfo
- tfm.cidinfo.registry = tfm.cidinfo.registry or ""
- tfm.type = "real"
- tfm.stretch = 0 -- stretch
- tfm.slant = 0 -- slant
- tfm.direction = 0
- tfm.boundarychar_label = 0
- tfm.boundarychar = 65536
- tfm.designsize = (designsize/10)*65536
- tfm.spacer = "500 units"
- local endash, emdash = 0x20, 0x2014 -- unicodes['space'], unicodes['emdash']
+ local endash, emdash, space = 0x20, 0x2014, "space" -- unicodes['space'], unicodes['emdash']
if metadata.isfixedpitch then
if descriptions[endash] then
- spaceunits, tfm.spacer = descriptions[endash].width, "space"
+ spaceunits, spacer = descriptions[endash].width, "space"
end
if not spaceunits and descriptions[emdash] then
- spaceunits, tfm.spacer = descriptions[emdash].width, "emdash"
+ spaceunits, spacer = descriptions[emdash].width, "emdash"
end
if not spaceunits and metadata.charwidth then
- spaceunits, tfm.spacer = metadata.charwidth, "charwidth"
+ spaceunits, spacer = metadata.charwidth, "charwidth"
end
else
if descriptions[endash] then
- spaceunits, tfm.spacer = descriptions[endash].width, "space"
+ spaceunits, spacer = descriptions[endash].width, "space"
end
if not spaceunits and descriptions[emdash] then
- spaceunits, tfm.spacer = descriptions[emdash].width/2, "emdash/2"
+ spaceunits, spacer = descriptions[emdash].width/2, "emdash/2"
end
if not spaceunits and metadata.charwidth then
- spaceunits, tfm.spacer = metadata.charwidth, "charwidth"
+ spaceunits, spacer = metadata.charwidth, "charwidth"
end
end
spaceunits = tonumber(spaceunits) or tfm.units/2 -- 500 -- brrr
+ -- we need a runtime lookup because of running from cdrom or zip, brrr (shouldn't we use the basename then?)
+ local filename = fonts.tfm.checked_filename(luatex)
+ local fontname = metadata.fontname
+ local fullname = metadata.fullname or fontname
+ local cidinfo = data.cidinfo
+ local units = metadata.units_per_em or 1000
+ --
+ cidinfo.registry = cidinfo and cidinfo.registry or "" -- weird here, fix upstream
+ --
parameters.slant = 0
- parameters.space = spaceunits -- 3.333 (cmr10)
- parameters.space_stretch = tfm.units/2 -- 500 -- 1.666 (cmr10)
- parameters.space_shrink = 1*tfm.units/3 -- 333 -- 1.111 (cmr10)
- parameters.x_height = 2*tfm.units/5 -- 400
- parameters.quad = tfm.units -- 1000
- if spaceunits < 2*tfm.units/5 then
+ parameters.space = spaceunits -- 3.333 (cmr10)
+ parameters.space_stretch = units/2 -- 500 -- 1.666 (cmr10)
+ parameters.space_shrink = 1*units/3 -- 333 -- 1.111 (cmr10)
+ parameters.x_height = 2*units/5 -- 400
+ parameters.quad = units -- 1000
+ if spaceunits < 2*units/5 then
-- todo: warning
end
local italicangle = metadata.italicangle
- tfm.ascender = math.abs(metadata.ascent or 0)
- tfm.descender = math.abs(metadata.descent or 0)
if italicangle then -- maybe also in afm _
- tfm.italicangle = italicangle
parameters.slant = parameters.slant - math.round(math.tan(italicangle*math.pi/180))
end
if metadata.isfixedpitch then
@@ -1534,8 +1629,34 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th
end
end
end
- -- [6]
- return tfm
+ --
+ return {
+ characters = characters,
+ parameters = parameters,
+ math_parameters = math_parameters,
+ descriptions = descriptions,
+ indices = indices,
+ unicodes = unicodes,
+ type = "real",
+ direction = 0,
+ boundarychar_label = 0,
+ boundarychar = 65536,
+ designsize = (designsize/10)*65536,
+ spacer = "500 units",
+ encodingbytes = 2,
+ filename = filename,
+ fontname = fontname,
+ fullname = fullname,
+ psname = fontname or fullname,
+ name = filename or fullname,
+ units = units,
+ format = fonts.fontformat(filename,"opentype"),
+ cidinfo = cidinfo,
+ ascender = abs(metadata.ascent or 0),
+ descender = abs(metadata.descent or 0),
+ spacer = spacer,
+ italicangle = italicangle,
+ }
else
return nil
end
@@ -1552,6 +1673,7 @@ function tfm.read_from_open_type(specification)
local s = specification.size
local m = otfdata.metadata.math
if m then
+ -- this will move to a function
local f = specification.features
if f then
local f = f.normal
@@ -1579,28 +1701,52 @@ function tfm.read_from_open_type(specification)
end
end
end
- tfmtable = tfm.scale(tfmtable,s)
- -- here we resolve the name; file can be relocated, so this info is not in the cache
- local filename = (otfdata and otfdata.luatex and otfdata.luatex.filename) or specification.filename
- if not filename then
- -- try to locate anyway and set otfdata.luatex.filename
- end
- if filename then
- tfmtable.encodingbytes = 2
- tfmtable.filename = resolvers.findbinfile(filename,"") or filename
- tfmtable.fullname = tfmtable.fullname or otfdata.metadata.fontname or otfdata.metadata.fullname
- local order = otfdata and otfdata.metadata.order2
- if order == 0 then
- tfmtable.format = 'opentype'
- elseif order == 1 then
- tfmtable.format = 'truetype'
- else
- tfmtable.format = specification.format
+ tfmtable = tfm.scale(tfmtable,s,specification.relativeid)
+ if tfm.fontname_mode == "specification" then
+ -- not to be used in context !
+ local specname = specification.specification
+ if specname then
+ tfmtable.name = specname
+ if trace_defining then
+ logs.report("define font","overloaded fontname: '%s'",specname)
+ end
end
- tfmtable.name = tfmtable.filename or tfmtable.fullname
end
fonts.logger.save(tfmtable,file.extname(specification.filename),specification)
end
--~ print(tfmtable.fullname)
return tfmtable
end
+
+-- helpers
+
+function otf.collect_lookups(otfdata,kind,script,language)
+ -- maybe store this in the font
+ local sequences = otfdata.luatex.sequences
+ if sequences then
+ local featuremap, featurelist = { }, { }
+ for s=1,#sequences do
+ local sequence = sequences[s]
+ local features = sequence.features
+ features = features and features[kind]
+ features = features and (features[script] or features[default] or features[wildcard])
+ features = features and (features[language] or features[default] or features[wildcard])
+ if features then
+ local subtables = sequence.subtables
+ if subtables then
+ for s=1,#subtables do
+ local ss = subtables[s]
+ if not featuremap[s] then
+ featuremap[ss] = true
+ featurelist[#featurelist+1] = ss
+ end
+ end
+ end
+ end
+ end
+ if #featurelist > 0 then
+ return featuremap, featurelist
+ end
+ end
+ return nil, nil
+end
diff --git a/Master/texmf-dist/tex/context/base/font-oti.lua b/Master/texmf-dist/tex/context/base/font-oti.lua
index cbac6d36a84..4cb27062623 100644
--- a/Master/texmf-dist/tex/context/base/font-oti.lua
+++ b/Master/texmf-dist/tex/context/base/font-oti.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-oti'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/font-otn.lua b/Master/texmf-dist/tex/context/base/font-otn.lua
index 3c11b84f1b4..d4f89adc6ec 100644
--- a/Master/texmf-dist/tex/context/base/font-otn.lua
+++ b/Master/texmf-dist/tex/context/base/font-otn.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-otn'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -10,6 +10,11 @@ if not modules then modules = { } end modules ['font-otn'] = {
-- much functionality could only be implemented thanks to the husayni font
-- of Idris Samawi Hamid to who we dedicate this module.
+-- I'm in the process of cleaning up the code (which happens in another
+-- file) so don't rely on things staying the same.
+
+-- some day when we can jit this, we can use more functions
+
-- we can use more lpegs when lpeg is extended with function args and so
-- resolving to unicode does not gain much
@@ -115,9 +120,10 @@ results in different tables.</p>
-- remark: the 'not implemented yet' variants will be done when we have fonts that use them
-- remark: we need to check what to do with discretionaries
-local concat = table.concat
+local concat, insert, remove = table.concat, table.insert, table.remove
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring = type, next, tonumber, tostring
+local lpegmatch = lpeg.match
local otf = fonts.otf
local tfm = fonts.tfm
@@ -136,6 +142,8 @@ local trace_bugs = false trackers.register("otf.bugs", function
local trace_details = false trackers.register("otf.details", function(v) trace_details = v end)
local trace_applied = false trackers.register("otf.applied", function(v) trace_applied = v end)
local trace_steps = false trackers.register("otf.steps", function(v) trace_steps = v end)
+local trace_skips = false trackers.register("otf.skips", function(v) trace_skips = v end)
+local trace_directions = false trackers.register("otf.directions", function(v) trace_directions = v end)
trackers.register("otf.verbose_chain", function(v) otf.setcontextchain(v and "verbose") end)
trackers.register("otf.normal_chain", function(v) otf.setcontextchain(v and "normal") end)
@@ -159,7 +167,7 @@ local zwj = 0x200D
local wildcard = "*"
local default = "dflt"
-local split_at_space = lpeg.Ct(lpeg.splitat(" ")) -- no trailing or multiple spaces anyway
+local split_at_space = lpeg.splitters[" "] or lpeg.Ct(lpeg.splitat(" ")) -- no trailing or multiple spaces anyway
local glyph = node.id('glyph')
local glue = node.id('glue')
@@ -301,16 +309,30 @@ end
local function toligature(kind,lookupname,start,stop,char,markflag,discfound) -- brr head
if start ~= stop then
+--~ if discfound then
+--~ local lignode = copy_node(start)
+--~ lignode.font = start.font
+--~ lignode.char = char
+--~ lignode.subtype = 2
+--~ start = node.do_ligature_n(start, stop, lignode)
+--~ if start.id == disc then
+--~ local prev = start.prev
+--~ start = start.next
+--~ end
if discfound then
+ -- print("start->stop",nodes.tosequence(start,stop))
local lignode = copy_node(start)
- lignode.font = start.font
- lignode.char = char
- lignode.subtype = 2
- start = node.do_ligature_n(start, stop, lignode)
- if start.id == disc then
- local prev = start.prev
- start = start.next
+ lignode.font, lignode.char, lignode.subtype = start.font, char, 2
+ local next, prev = stop.next, start.prev
+ stop.next = nil
+ lignode = node.do_ligature_n(start, stop, lignode)
+ prev.next = lignode
+ if next then
+ next.prev = lignode
end
+ lignode.next, lignode.prev = next, prev
+ start = lignode
+ -- print("start->end",nodes.tosequence(start))
else -- start is the ligature
local deletemarks = markflag ~= "mark"
local n = copy_node(start)
@@ -385,16 +407,19 @@ local function alternative_glyph(start,alternatives,kind,chainname,chainlookupna
value, choice = format("first, choice %s",1), alternatives[1]
elseif value == "last" then
value, choice = format("last, choice %s",n), alternatives[n]
- elseif type(value) ~= "number" then
- value, choice = "default, choice 1", alternatives[1]
- elseif value > n then
- value, choice = format("no %s variants, taking %s",value,n), alternatives[n]
- elseif value == 0 then
- value, choice = format("choice %s (no change)",value), start.char
- elseif value < 1 then
- value, choice = format("no %s variants, taking %s",value,1), alternatives[1]
else
- value, choice = format("choice %s",value), alternatives[value]
+ value = tonumber(value)
+ if type(value) ~= "number" then
+ value, choice = "default, choice 1", alternatives[1]
+ elseif value > n then
+ value, choice = format("no %s variants, taking %s",value,n), alternatives[n]
+ elseif value == 0 then
+ value, choice = format("choice %s (no change)",value), start.char
+ elseif value < 1 then
+ value, choice = format("no %s variants, taking %s",value,1), alternatives[1]
+ else
+ value, choice = format("choice %s",value), alternatives[value]
+ end
end
if not choice then
logwarning("%s: no variant %s for %s",cref(kind,chainname,chainlookupname,lookupname),value,gref(start.char))
@@ -436,7 +461,8 @@ end
function handlers.gsub_ligature(start,kind,lookupname,ligature,sequence) --or maybe pass lookup ref
local s, stop, discfound = start.next, nil, false
- if marks[start.char] then
+ local startchar = start.char
+ if marks[startchar] then
while s do
local id = s.id
if id == glyph and s.subtype<256 then
@@ -459,7 +485,7 @@ function handlers.gsub_ligature(start,kind,lookupname,ligature,sequence) --or ma
end
if stop and ligature[2] then
if trace_ligatures then
- local startchar, stopchar = start.char, stop.char
+ local stopchar = stop.char
start = markstoligature(kind,lookupname,start,stop,ligature[2])
logprocess("%s: replacing %s upto %s by ligature %s",pref(kind,lookupname),gref(startchar),gref(stopchar),gref(start.char))
else
@@ -498,7 +524,7 @@ function handlers.gsub_ligature(start,kind,lookupname,ligature,sequence) --or ma
end
if stop and ligature[2] then
if trace_ligatures then
- local startchar, stopchar = start.char, stop.char
+ local stopchar = stop.char
start = toligature(kind,lookupname,start,stop,ligature[2],skipmark,discfound)
logprocess("%s: replacing %s upto %s by ligature %s",pref(kind,lookupname),gref(startchar),gref(stopchar),gref(start.char))
else
@@ -724,7 +750,7 @@ function handlers.gpos_cursive(start,kind,lookupname,exitanchors,sequence) -- to
if exit then
local dx, dy, bound = set_cursive(start,nxt,tfmdata.factor,rlmode,exit,entry,characters[startchar],characters[nextchar])
if trace_cursive then
- logprocess("%s: moving %s to %s cursive (%s,%s) using anchor %s and bound %s",pref(kind,lookupname),gref(startchar),gref(nextchar),dx,dy,anchor,bound)
+ logprocess("%s: moving %s to %s cursive (%s,%s) using anchor %s and bound %s in rlmode %s",pref(kind,lookupname),gref(startchar),gref(nextchar),dx,dy,anchor,bound,rlmode)
end
done = true
break
@@ -752,9 +778,9 @@ end
function handlers.gpos_single(start,kind,lookupname,kerns,sequence)
local startchar = start.char
- local dx, dy = set_pair(start,tfmdata.factor,rlmode,kerns,characters[startchar])
+ local dx, dy, w, h = set_pair(start,tfmdata.factor,rlmode,sequence.flags[4],kerns,characters[startchar])
if trace_kerns then
- logprocess("%s: shifting single %s by (%s,%s)",pref(kind,lookupname),gref(startchar),dx,dy)
+ logprocess("%s: shifting single %s by (%s,%s) and correction (%s,%s)",pref(kind,lookupname),gref(startchar),dx,dy,w,h)
end
return start, false
end
@@ -783,14 +809,14 @@ local krn = kerns[nextchar]
local a, b = krn[3], krn[4]
if a and #a > 0 then
local startchar = start.char
- local x, y, w, h = set_pair(start,factor,rlmode,a,characters[startchar])
+ local x, y, w, h = set_pair(start,factor,rlmode,sequence.flags[4],a,characters[startchar])
if trace_kerns then
logprocess("%s: shifting first of pair %s and %s by (%s,%s) and correction (%s,%s)",pref(kind,lookupname),gref(startchar),gref(nextchar),x,y,w,h)
end
end
if b and #b > 0 then
local startchar = start.char
- local x, y, w, h = set_pair(snext,factor,rlmode,b,characters[nextchar])
+ local x, y, w, h = set_pair(snext,factor,rlmode,sequence.flags[4],b,characters[nextchar])
if trace_kerns then
logprocess("%s: shifting second of pair %s and %s by (%s,%s) and correction (%s,%s)",pref(kind,lookupname),gref(startchar),gref(nextchar),x,y,w,h)
end
@@ -1376,7 +1402,7 @@ function chainprocs.gpos_cursive(start,stop,kind,chainname,currentcontext,cache,
if exit then
local dx, dy, bound = set_cursive(start,nxt,tfmdata.factor,rlmode,exit,entry,characters[startchar],characters[nextchar])
if trace_cursive then
- logprocess("%s: moving %s to %s cursive (%s,%s) using anchor %s and bound %s",pref(kind,lookupname),gref(startchar),gref(nextchar),dx,dy,anchor,bound)
+ logprocess("%s: moving %s to %s cursive (%s,%s) using anchor %s and bound %s in rlmode %s",pref(kind,lookupname),gref(startchar),gref(nextchar),dx,dy,anchor,bound,rlmode)
end
done = true
break
@@ -1404,7 +1430,7 @@ function chainprocs.gpos_cursive(start,stop,kind,chainname,currentcontext,cache,
return start, false
end
-function chainprocs.gpos_single(start,stop,kind,chainname,currentcontext,cache,currentlookup,chainlookupname)
+function chainprocs.gpos_single(start,stop,kind,chainname,currentcontext,cache,currentlookup,chainlookupname,chainindex,sequence)
-- untested
local startchar = start.char
local subtables = currentlookup.subtables
@@ -1413,9 +1439,9 @@ function chainprocs.gpos_single(start,stop,kind,chainname,currentcontext,cache,c
if kerns then
kerns = kerns[startchar]
if kerns then
- local dx, dy = set_pair(start,tfmdata.factor,rlmode,kerns,characters[startchar])
+ local dx, dy, w, h = set_pair(start,tfmdata.factor,rlmode,sequence.flags[4],kerns,characters[startchar])
if trace_kerns then
- logprocess("%s: shifting single %s by (%s,%s)",cref(kind,chainname,chainlookupname),gref(startchar),dx,dy)
+ logprocess("%s: shifting single %s by (%s,%s) and correction (%s,%s)",cref(kind,chainname,chainlookupname),gref(startchar),dx,dy,w,h)
end
end
end
@@ -1424,7 +1450,7 @@ end
-- when machines become faster i will make a shared function
-function chainprocs.gpos_pair(start,stop,kind,chainname,currentcontext,cache,currentlookup,chainlookupname)
+function chainprocs.gpos_pair(start,stop,kind,chainname,currentcontext,cache,currentlookup,chainlookupname,chainindex,sequence)
-- logwarning("%s: gpos_pair not yet supported",cref(kind,chainname,chainlookupname))
local snext = start.next
if snext then
@@ -1439,12 +1465,11 @@ function chainprocs.gpos_pair(start,stop,kind,chainname,currentcontext,cache,cur
local factor = tfmdata.factor
while snext and snext.id == glyph and snext.subtype<256 and snext.font == currentfont do
local nextchar = snext.char
-local krn = kerns[nextchar]
+ local krn = kerns[nextchar]
if not krn and marks[nextchar] then
prev = snext
snext = snext.next
else
---~ local krn = kerns[nextchar]
if not krn then
-- skip
elseif type(krn) == "table" then
@@ -1452,14 +1477,14 @@ local krn = kerns[nextchar]
local a, b = krn[3], krn[4]
if a and #a > 0 then
local startchar = start.char
- local x, y, w, h = set_pair(start,factor,rlmode,a,characters[startchar])
+ local x, y, w, h = set_pair(start,factor,rlmode,sequence.flags[4],a,characters[startchar])
if trace_kerns then
logprocess("%s: shifting first of pair %s and %s by (%s,%s) and correction (%s,%s)",cref(kind,chainname,chainlookupname),gref(startchar),gref(nextchar),x,y,w,h)
end
end
if b and #b > 0 then
local startchar = start.char
- local x, y, w, h = set_pair(snext,factor,rlmode,b,characters[nextchar])
+ local x, y, w, h = set_pair(snext,factor,rlmode,sequence.flags[4],b,characters[nextchar])
if trace_kerns then
logprocess("%s: shifting second of pair %s and %s by (%s,%s) and correction (%s,%s)",cref(kind,chainname,chainlookupname),gref(startchar),gref(nextchar),x,y,w,h)
end
@@ -1503,19 +1528,30 @@ end
-- we don't need to pass the currentcontext, saves a bit
-- make a slow variant then can be activated but with more tracing
+local function show_skip(kind,chainname,char,ck,class)
+ if ck[9] then
+ logwarning("%s: skipping char %s (%s) in rule %s, lookuptype %s (%s=>%s)",cref(kind,chainname),gref(char),class,ck[1],ck[2],ck[9],ck[10])
+ else
+ logwarning("%s: skipping char %s (%s) in rule %s, lookuptype %s",cref(kind,chainname),gref(char),class,ck[1],ck[2])
+ end
+end
+
local function normal_handle_contextchain(start,kind,chainname,contexts,sequence,cache)
-- local rule, lookuptype, sequence, f, l, lookups = ck[1], ck[2] ,ck[3], ck[4], ck[5], ck[6]
local flags, done = sequence.flags, false
local skipmark, skipligature, skipbase = flags[1], flags[2], flags[3]
local someskip = skipmark or skipligature or skipbase -- could be stored in flags for a fast test (hm, flags could be false !)
+ local markclass = sequence.markclass -- todo, first we need a proper test
+ local skipped = false
for k=1,#contexts do
local match, current, last = true, start, start
local ck = contexts[k]
- local sequence = ck[3]
- local s = #sequence
+ local seq = ck[3]
+ local s = #seq
+ -- f..l = mid string
if s == 1 then
-- never happens
- match = current.id == glyph and current.subtype<256 and current.font == currentfont and sequence[1][current.char]
+ match = current.id == glyph and current.subtype<256 and current.font == currentfont and seq[1][current.char]
else
-- todo: better space check (maybe check for glue)
local f, l = ck[4], ck[5]
@@ -1529,7 +1565,7 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
-- we cannot optimize for n=2 because there can be disc nodes
-- if not someskip and n == l then
-- -- n=2 and no skips then faster loop
- -- match = last and last.id == glyph and last.subtype<256 and last.font == currentfont and sequence[n][last.char]
+ -- match = last and last.id == glyph and last.subtype<256 and last.font == currentfont and seq[n][last.char]
-- else
while n <= l do
if last then
@@ -1540,11 +1576,13 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
local ccd = descriptions[char]
if ccd then
local class = ccd.class
- if class == skipmark or class == skipligature or class == skipbase then
---~ if someskip and class == skipmark or class == skipligature or class == skipbase then
- -- skip 'm
+ if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then
+ skipped = true
+ if trace_skips then
+ show_skip(kind,chainname,char,ck,class)
+ end
last = last.next
- elseif sequence[n][char] then
+ elseif seq[n][char] then
if n < l then
last = last.next
end
@@ -1570,6 +1608,7 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
-- end
end
if match and f > 1 then
+ -- before
local prev = start.prev
if prev then
local n = f-1
@@ -1582,10 +1621,12 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
local ccd = descriptions[char]
if ccd then
local class = ccd.class
- if class == skipmark or class == skipligature or class == skipbase then
---~ if someskip and class == skipmark or class == skipligature or class == skipbase then
- -- skip 'm
- elseif sequence[n][char] then
+ if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then
+ skipped = true
+ if trace_skips then
+ show_skip(kind,chainname,char,ck,class)
+ end
+ elseif seq[n][char] then
n = n -1
else
match = false break
@@ -1598,32 +1639,33 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
end
elseif id == disc then
-- skip 'm
- elseif sequence[n][32] then
+ elseif seq[n][32] then
n = n -1
else
match = false break
end
prev = prev.prev
- elseif sequence[n][32] then
+ elseif seq[n][32] then
n = n -1
else
match = false break
end
end
elseif f == 2 then
- match = sequence[1][32]
+ match = seq[1][32]
else
for n=f-1,1 do
- if not sequence[n][32] then
+ if not seq[n][32] then
match = false break
end
end
end
end
if match and s > l then
+ -- after
local current = last.next
if current then
- -- removed optimiziation for s-l == 1, we have to deal with marks anyway
+ -- removed optimization for s-l == 1, we have to deal with marks anyway
local n = l + 1
while n <= s do
if current then
@@ -1634,10 +1676,12 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
local ccd = descriptions[char]
if ccd then
local class = ccd.class
- if class == skipmark or class == skipligature or class == skipbase then
---~ if someskip and class == skipmark or class == skipligature or class == skipbase then
- -- skip 'm
- elseif sequence[n][char] then
+ if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then
+ skipped = true
+ if trace_skips then
+ show_skip(kind,chainname,char,ck,class)
+ end
+ elseif seq[n][char] then
n = n + 1
else
match = false break
@@ -1650,23 +1694,23 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
end
elseif id == disc then
-- skip 'm
- elseif sequence[n][32] then -- brrr
+ elseif seq[n][32] then -- brrr
n = n + 1
else
match = false break
end
current = current.next
- elseif sequence[n][32] then
+ elseif seq[n][32] then
n = n + 1
else
match = false break
end
end
elseif s-l == 1 then
- match = sequence[s][32]
+ match = seq[s][32]
else
for n=l+1,s do
- if not sequence[n][32] then
+ if not seq[n][32] then
match = false break
end
end
@@ -1676,7 +1720,7 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
if match then
-- ck == currentcontext
if trace_contexts then
- local rule, lookuptype, sequence, f, l = ck[1], ck[2] ,ck[3], ck[4], ck[5]
+ local rule, lookuptype, f, l = ck[1], ck[2], ck[4], ck[5]
local char = start.char
if ck[9] then
logwarning("%s: rule %s matches at char %s for (%s,%s,%s) chars, lookuptype %s (%s=>%s)",cref(kind,chainname),rule,gref(char),f-1,l-f+1,s-l,lookuptype,ck[9],ck[10])
@@ -1693,39 +1737,79 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence
local chainlookup = lookuptable[chainlookupname]
local cp = chainprocs[chainlookup.type]
if cp then
- start, done = cp(start,last,kind,chainname,ck,cache,chainlookup,chainlookupname)
+ start, done = cp(start,last,kind,chainname,ck,cache,chainlookup,chainlookupname,nil,sequence)
else
logprocess("%s: %s is not yet supported",cref(kind,chainname,chainlookupname),chainlookup.type)
end
else
-- actually this needs a more complex treatment for which we will use chainmores
+--~ local i = 1
+--~ repeat
+--~ local chainlookupname = chainlookups[i]
+--~ local chainlookup = lookuptable[chainlookupname]
+--~ local cp = chainmores[chainlookup.type]
+--~ if cp then
+--~ local ok, n
+--~ start, ok, n = cp(start,last,kind,chainname,ck,cache,chainlookup,chainlookupname,i,sequence)
+--~ -- messy since last can be changed !
+--~ if ok then
+--~ done = true
+--~ start = start.next
+--~ if n then
+--~ -- skip next one(s) if ligature
+--~ i = i + n - 1
+--~ end
+--~ end
+--~ else
+--~ logprocess("%s: multiple subchains for %s are not yet supported",cref(kind,chainname,chainlookupname),chainlookup.type)
+--~ end
+--~ i = i + 1
+--~ until i > nofchainlookups
+
local i = 1
repeat
+if skipped then
+ while true do
+ local char = start.char
+ local ccd = descriptions[char]
+ if ccd then
+ local class = ccd.class
+ if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then
+ start = start.next
+ else
+ break
+ end
+ else
+ break
+ end
+ end
+end
local chainlookupname = chainlookups[i]
local chainlookup = lookuptable[chainlookupname]
local cp = chainmores[chainlookup.type]
if cp then
local ok, n
- start, ok, n = cp(start,last,kind,chainname,ck,cache,chainlookup,chainlookupname,i)
+ start, ok, n = cp(start,last,kind,chainname,ck,cache,chainlookup,chainlookupname,i,sequence)
-- messy since last can be changed !
if ok then
done = true
- start = start.next
- if n then
- -- skip next one(s) if ligature
- i = i + n - 1
- end
+ -- skip next one(s) if ligature
+ i = i + (n or 1)
+ else
+ i = i + 1
end
else
logprocess("%s: multiple subchains for %s are not yet supported",cref(kind,chainname,chainlookupname),chainlookup.type)
+ i = i + 1
end
- i = i + 1
+ start = start.next
until i > nofchainlookups
+
end
else
local replacements = ck[7]
if replacements then
- start, done = chainprocs.reversesub(start,last,kind,chainname,ck,cache,replacements)
+ start, done = chainprocs.reversesub(start,last,kind,chainname,ck,cache,replacements) -- sequence
else
done = true -- can be meant to be skipped
if trace_contexts then
@@ -1797,6 +1881,8 @@ end
local resolved = { } -- we only resolve a font,script,language pair once
+-- todo: pass all these 'locals' in a table
+
function fonts.methods.node.otf.features(head,font,attr)
if trace_steps then
checkstep(head)
@@ -1840,6 +1926,7 @@ function fonts.methods.node.otf.features(head,font,attr)
local ra = rl [attr] if ra == nil then ra = { } rl [attr] = ra end -- attr can be false
-- sequences always > 1 so no need for optimization
for s=1,#sequences do
+ local pardir, txtdir = 0, { }
local success = false
local sequence = sequences[s]
local r = ra[s] -- cache
@@ -1865,12 +1952,10 @@ function fonts.methods.node.otf.features(head,font,attr)
-- only first attribute match check, so we assume simple fina's
-- default can become a font feature itself
if l[language] then
---~ valid, what = true, language
valid, what = s_e or a_e, language
-- elseif l[default] then
-- valid, what = true, default
elseif l[wildcard] then
---~ valid, what = true, wildcard
valid, what = s_e or a_e, wildcard
end
if valid then
@@ -1905,12 +1990,12 @@ function fonts.methods.node.otf.features(head,font,attr)
local handler = handlers[typ]
local thecache = featuredata[typ] or { }
-- we need to get rid of this slide !
- start = find_node_tail(head) -- slow (we can store tail because there's always a skip at the end): todo
+ local start = find_node_tail(head) -- slow (we can store tail because there's always a skip at the end): todo
while start do
local id = start.id
if id == glyph then
---~ if start.subtype<256 and start.font == font and (not attr or has_attribute(start,0,attr)) then
- if start.subtype<256 and start.font == font and has_attribute(start,0,attr) then
+ if start.subtype<256 and start.font == font and (not attr or has_attribute(start,0,attr)) then
+--~ if start.subtype<256 and start.font == font and has_attribute(start,0,attr) then
for i=1,#subtables do
local lookupname = subtables[i]
local lookupcache = thecache[lookupname]
@@ -1938,8 +2023,8 @@ function fonts.methods.node.otf.features(head,font,attr)
local handler = handlers[typ]
local ns = #subtables
local thecache = featuredata[typ] or { }
- start = head -- local ?
- rlmode = 0
+ local start = head -- local ?
+ rlmode = 0 -- to be checked ?
if ns == 1 then
local lookupname = subtables[1]
local lookupcache = thecache[lookupname]
@@ -1949,8 +2034,8 @@ function fonts.methods.node.otf.features(head,font,attr)
while start do
local id = start.id
if id == glyph then
---~ if start.font == font and start.subtype<256 and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
- if start.font == font and start.subtype<256 and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
+--~ if start.font == font and start.subtype<256 and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
+ if start.font == font and start.subtype<256 and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
local lookupmatch = lookupcache[start.char]
if lookupmatch then
-- sequence kan weg
@@ -1983,21 +2068,35 @@ function fonts.methods.node.otf.features(head,font,attr)
local subtype = start.subtype
if subtype == 7 then
local dir = start.dir
- if dir == "+TRT" then
+ if dir == "+TRT" or dir == "+TLT" then
+ insert(txtdir,dir)
+ elseif dir == "-TRT" or dir == "-TLT" then
+ remove(txtdir)
+ end
+ local d = txtdir[#txtdir]
+ if d == "+TRT" then
rlmode = -1
- elseif dir == "+TLT" then
+ elseif d == "+TLT" then
rlmode = 1
else
- rlmode = 0
+ rlmode = pardir
+ end
+ if trace_directions then
+ logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
elseif subtype == 6 then
local dir = start.dir
if dir == "TRT" then
- rlmode = -1
+ pardir = -1
elseif dir == "TLT" then
- rlmode = 1
+ pardir = 1
else
- rlmode = 0
+ pardir = 0
+ end
+ rlmode = pardir
+ --~ txtdir = { }
+ if trace_directions then
+ logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
end
start = start.next
@@ -2005,14 +2104,13 @@ function fonts.methods.node.otf.features(head,font,attr)
start = start.next
end
end
-
end
else
while start do
local id = start.id
if id == glyph then
---~ if start.subtype<256 and start.font == font and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
- if start.subtype<256 and start.font == font and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
+ if start.subtype<256 and start.font == font and (not attr or has_attribute(start,0,attr)) and (not attribute or has_attribute(start,state,attribute)) then
+--~ if start.subtype<256 and start.font == font and has_attribute(start,0,attr) and (not attribute or has_attribute(start,state,attribute)) then
for i=1,ns do
local lookupname = subtables[i]
local lookupcache = thecache[lookupname]
@@ -2052,23 +2150,38 @@ function fonts.methods.node.otf.features(head,font,attr)
-- end
elseif id == whatsit then
local subtype = start.subtype
+ local subtype = start.subtype
if subtype == 7 then
local dir = start.dir
- if dir == "+TRT" then
+ if dir == "+TRT" or dir == "+TLT" then
+ insert(txtdir,dir)
+ elseif dir == "-TRT" or dir == "-TLT" then
+ remove(txtdir)
+ end
+ local d = txtdir[#txtdir]
+ if d == "+TRT" then
rlmode = -1
- elseif dir == "+TLT" then
+ elseif d == "+TLT" then
rlmode = 1
else
- rlmode = 0
+ rlmode = pardir
+ end
+ if trace_directions then
+ logs.report("fonts","directions after textdir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
elseif subtype == 6 then
local dir = start.dir
if dir == "TRT" then
- rlmode = -1
+ pardir = -1
elseif dir == "TLT" then
- rlmode = 1
+ pardir = 1
else
- rlmode = 0
+ pardir = 0
+ end
+ rlmode = pardir
+ --~ txtdir = { }
+ if trace_directions then
+ logs.report("fonts","directions after pardir %s: pardir=%s, txtdir=%s:%s, rlmode=%s",dir,pardir,#txtdir,txtdir[#txtdir] or "unset",rlmode)
end
end
start = start.next
@@ -2096,11 +2209,11 @@ otf.features.prepare = { }
-- document)
local function split(replacement,original,cache,unicodes)
- -- we can cache this too, but not the same
+ -- we can cache this too, but not the same (although unicode is a unique enough hash)
local o, t, n = { }, { }, 0
for s in gmatch(original,"[^ ]+") do
local us = unicodes[s]
- if type(us) == "number" then
+ if type(us) == "number" then -- tonumber(us)
o[#o+1] = us
else
o[#o+1] = us[1]
@@ -2109,7 +2222,7 @@ local function split(replacement,original,cache,unicodes)
for s in gmatch(replacement,"[^ ]+") do
n = n + 1
local us = unicodes[s]
- if type(us) == "number" then
+ if type(us) == "number" then -- tonumber(us)
t[o[n]] = us
else
t[o[n]] = us[1]
@@ -2166,142 +2279,153 @@ local function prepare_lookups(tfmdata)
-- we can change the otf table after loading but then we need to adapt base mode
-- as well (no big deal)
--
- for unicode, glyph in next, descriptions do
- local lookups = glyph.lookups
- if lookups then
- for lookup, whatever in next, lookups do
- for i=1,#whatever do -- normaly one
- local p = whatever[i]
- local what = p[1]
- if what == 'substitution' then
- local old, new = unicode, unicodes[p[2]]
- if type(new) == "table" then
- new = new[1]
- end
- local s = single[lookup]
- if not s then s = { } single[lookup] = s end
- s[old] = new
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: substitution %s => %s",lookup,old,new)
---~ end
- break
- elseif what == 'multiple' then
- local old, new = unicode, { }
- local m = multiple[lookup]
- if not m then m = { } multiple[lookup] = m end
- m[old] = new
- for pc in gmatch(p[2],"[^ ]+") do
- local upc = unicodes[pc]
- if type(upc) == "number" then
- new[#new+1] = upc
- else
- new[#new+1] = upc[1]
- end
- end
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: multiple %s => %s",lookup,old,concat(new," "))
---~ end
+ local action = {
+ substitution = function(p,lookup,k,glyph,unicode)
+ local old, new = unicode, unicodes[p[2]]
+ if type(new) == "table" then
+ new = new[1]
+ end
+ local s = single[lookup]
+ if not s then s = { } single[lookup] = s end
+ s[old] = new
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: substitution %s => %s",lookup,old,new)
+ --~ end
+ end,
+ multiple = function (p,lookup,k,glyph,unicode)
+ local old, new = unicode, { }
+ local m = multiple[lookup]
+ if not m then m = { } multiple[lookup] = m end
+ m[old] = new
+ for pc in gmatch(p[2],"[^ ]+") do
+ local upc = unicodes[pc]
+ if type(upc) == "number" then
+ new[#new+1] = upc
+ else
+ new[#new+1] = upc[1]
+ end
+ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: multiple %s => %s",lookup,old,concat(new," "))
+ --~ end
+ end,
+ alternate = function(p,lookup,k,glyph,unicode)
+ local old, new = unicode, { }
+ local a = alternate[lookup]
+ if not a then a = { } alternate[lookup] = a end
+ a[old] = new
+ for pc in gmatch(p[2],"[^ ]+") do
+ local upc = unicodes[pc]
+ if type(upc) == "number" then
+ new[#new+1] = upc
+ else
+ new[#new+1] = upc[1]
+ end
+ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: alternate %s => %s",lookup,old,concat(new,"|"))
+ --~ end
+ end,
+ ligature = function (p,lookup,k,glyph,unicode)
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: ligature %s => %s",lookup,p[2],glyph.name)
+ --~ end
+ local first = true
+ local t = ligature[lookup]
+ if not t then t = { } ligature[lookup] = t end
+ for s in gmatch(p[2],"[^ ]+") do
+ if first then
+ local u = unicodes[s]
+ if not u then
+ logs.report("define otf","lookup %s: ligature %s => %s ignored due to invalid unicode",lookup,p[2],glyph.name)
break
- elseif what == 'alternate' then
- local old, new = unicode, { }
- local a = alternate[lookup]
- if not a then a = { } alternate[lookup] = a end
- a[old] = new
- for pc in gmatch(p[2],"[^ ]+") do
- local upc = unicodes[pc]
- if type(upc) == "number" then
- new[#new+1] = upc
- else
- new[#new+1] = upc[1]
- end
+ elseif type(u) == "number" then
+ if not t[u] then
+ t[u] = { { } }
end
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: alternate %s => %s",lookup,old,concat(new,"|"))
---~ end
- break
- elseif what == "ligature" then
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: ligature %s => %s",lookup,p[2],glyph.name)
---~ end
- local first = true
- local t = ligature[lookup]
- if not t then t = { } ligature[lookup] = t end
- for s in gmatch(p[2],"[^ ]+") do
- if first then
- local u = unicodes[s]
- if not u then
- logs.report("define otf","lookup %s: ligature %s => %s ignored due to invalid unicode",lookup,p[2],glyph.name)
- break
- elseif type(u) == "number" then
- if not t[u] then
- t[u] = { { } }
- end
- t = t[u]
- else
- local tt = t
- local tu
- for i=1,#u do
- local u = u[i]
- if i==1 then
- if not t[u] then
- t[u] = { { } }
- end
- tu = t[u]
- t = tu
- else
- if not t[u] then
- tt[u] = tu
- end
- end
- end
+ t = t[u]
+ else
+ local tt = t
+ local tu
+ for i=1,#u do
+ local u = u[i]
+ if i==1 then
+ if not t[u] then
+ t[u] = { { } }
end
- first = false
+ tu = t[u]
+ t = tu
else
- s = unicodes[s]
- local t1 = t[1]
- if not t1[s] then
- t1[s] = { { } }
+ if not t[u] then
+ tt[u] = tu
end
- t = t1[s]
end
end
- t[2] = unicode
- elseif what == 'position' then
- -- not used
- local s = position[lookup]
- if not s then s = { } position[lookup] = s end
- s[unicode] = p[2] -- direct pointer to kern spec
- elseif what == 'pair' then
- local s = pair[lookup]
- if not s then s = { } pair[lookup] = s end
- local others = s[unicode]
- if not others then others = { } s[unicode] = others end
- -- todo: fast check for space
- local two = p[2]
- local upc = unicodes[two]
- if not upc then
- for pc in gmatch(two,"[^ ]+") do
- local upc = unicodes[pc]
- if type(upc) == "number" then
- others[upc] = p -- direct pointer to main table
- else
- for i=1,#upc do
- others[upc[i]] = p -- direct pointer to main table
- end
- end
- end
- elseif type(upc) == "number" then
- others[upc] = p -- direct pointer to main table
- else
- for i=1,#upc do
- others[upc[i]] = p -- direct pointer to main table
- end
+ end
+ first = false
+ else
+ s = unicodes[s]
+ local t1 = t[1]
+ if not t1[s] then
+ t1[s] = { { } }
+ end
+ t = t1[s]
+ end
+ end
+ t[2] = unicode
+ end,
+ position = function(p,lookup,k,glyph,unicode)
+ -- not used
+ local s = position[lookup]
+ if not s then s = { } position[lookup] = s end
+ s[unicode] = p[2] -- direct pointer to kern spec
+ end,
+ pair = function(p,lookup,k,glyph,unicode)
+ local s = pair[lookup]
+ if not s then s = { } pair[lookup] = s end
+ local others = s[unicode]
+ if not others then others = { } s[unicode] = others end
+ -- todo: fast check for space
+ local two = p[2]
+ local upc = unicodes[two]
+ if not upc then
+ for pc in gmatch(two,"[^ ]+") do
+ local upc = unicodes[pc]
+ if type(upc) == "number" then
+ others[upc] = p -- direct pointer to main table
+ else
+ for i=1,#upc do
+ others[upc[i]] = p -- direct pointer to main table
end
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: pair for U+%04X",lookup,unicode)
---~ end
end
end
+ elseif type(upc) == "number" then
+ others[upc] = p -- direct pointer to main table
+ else
+ for i=1,#upc do
+ others[upc[i]] = p -- direct pointer to main table
+ end
+ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: pair for U+%04X",lookup,unicode)
+ --~ end
+ end,
+ }
+ --
+ for unicode, glyph in next, descriptions do
+ local lookups = glyph.slookups
+ if lookups then
+ for lookup, p in next, lookups do
+ action[p[1]](p,lookup,k,glyph,unicode)
+ end
+ end
+ local lookups = glyph.mlookups
+ if lookups then
+ for lookup, whatever in next, lookups do
+ for i=1,#whatever do -- normaly one
+ local p = whatever[i]
+ action[p[1]](p,lookup,k,glyph,unicode)
+ end
end
end
local list = glyph.mykerns
@@ -2310,9 +2434,9 @@ local function prepare_lookups(tfmdata)
local k = kerns[lookup]
if not k then k = { } kerns[lookup] = k end
k[unicode] = krn -- ref to glyph, saves lookup
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: kern for U+%04X",lookup,unicode)
---~ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: kern for U+%04X",lookup,unicode)
+ --~ end
end
end
local oanchor = glyph.anchors
@@ -2326,9 +2450,9 @@ local function prepare_lookups(tfmdata)
local f = mark[lookup]
if not f then f = { } mark[lookup] = f end
f[unicode] = anchors -- ref to glyph, saves lookup
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: mark anchor %s for U+%04X",lookup,name,unicode)
---~ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: mark anchor %s for U+%04X",lookup,name,unicode)
+ --~ end
end
end
end
@@ -2340,9 +2464,9 @@ local function prepare_lookups(tfmdata)
local f = cursive[lookup]
if not f then f = { } cursive[lookup] = f end
f[unicode] = anchors -- ref to glyph, saves lookup
---~ if trace_lookups then
---~ logs.report("define otf","lookup %s: exit anchor %s for U+%04X",lookup,name,unicode)
---~ end
+ --~ if trace_lookups then
+ --~ logs.report("define otf","lookup %s: exit anchor %s for U+%04X",lookup,name,unicode)
+ --~ end
end
end
end
@@ -2456,6 +2580,46 @@ function prepare_contextchains(tfmdata)
end
end
end
+ elseif fmt == "glyphs" then
+ if lookuptype ~= "chainsub" and lookuptype ~= "chainpos" then
+ logs.report("otf process","unsupported coverage %s for %s",lookuptype,lookupname)
+ else
+ local contexts = contextchain[lookupname]
+ if not contexts then
+ contexts = { }
+ contextchain[lookupname] = contexts
+ end
+ local t = { }
+ for nofrules=1,#rules do
+ -- nearly the same as coverage so we could as well rename it
+ local rule = rules[nofrules]
+ local glyphs = rule.glyphs
+ if glyphs and glyphs.names then
+ local fore, back, names, sequence = glyphs.fore, glyphs.back, glyphs.names, { }
+ if fore and fore ~= "" then
+ fore = lpegmatch(split_at_space,fore)
+ uncover(fore,sequence,cache,unicodes)
+ end
+ local start = #sequence + 1
+ names = lpegmatch(split_at_space,names)
+ uncover(names,sequence,cache,unicodes)
+ local stop = #sequence
+ if back and back ~= "" then
+ back = lpegmatch(split_at_space,back)
+ uncover(back,sequence,cache,unicodes)
+ end
+ if sequence[1] then
+ t[#t+1] = { nofrules, lookuptype, sequence, start, stop, rule.lookups }
+ for unic, _ in next, sequence[start] do
+ local cu = contexts[unic]
+ if not cu then
+ contexts[unic] = t
+ end
+ end
+ end
+ end
+ end
+ end
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/font-otp.lua b/Master/texmf-dist/tex/context/base/font-otp.lua
index 3cdc8073720..a80c515ad6e 100644
--- a/Master/texmf-dist/tex/context/base/font-otp.lua
+++ b/Master/texmf-dist/tex/context/base/font-otp.lua
@@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['font-otp'] = {
-- todo: pack math (but not that much to share)
-local next = next
+local next, type, tostring = next, type, tostring
+local sort, concat = table.sort, table.concat
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
@@ -19,6 +20,19 @@ fonts.otf.glists = fonts.otf.glists or { "gsub", "gpos" }
local criterium, threshold, tabstr = 1, 0, table.serialize
+local function tabstr(t) -- hashed from core-uti / experiment
+ local s = { }
+ for k, v in next, t do
+ if type(v) == "table" then
+ s[#s+1] = k.."={"..tabstr(v).."}"
+ else
+ s[#s+1] = k.."="..tostring(v)
+ end
+ end
+ sort(s)
+ return concat(s,",")
+end
+
function fonts.otf.enhancers.pack(data)
if data then
local h, t, c = { }, { }, { }
@@ -98,7 +112,13 @@ function fonts.otf.enhancers.pack(data)
local pack = (pass == 1 and pack_1) or pack_2
for k, v in next, data.glyphs do
v.boundingbox = pack(v.boundingbox)
- local l = v.lookups
+ local l = v.slookups
+ if l then
+ for k,v in next, l do
+ l[k] = pack(v)
+ end
+ end
+ local l = v.mlookups
if l then
for k,v in next, l do
for kk=1,#v do
@@ -156,15 +176,21 @@ function fonts.otf.enhancers.pack(data)
end
local c = vv.coverage
if c then
- c.before = c.before and pack(c.before )
- c.after = c.after and pack(c.after )
- c.current = c.current and pack(c.current)
+ local cc = c.before if cc then c.before = pack(cc) end
+ local cc = c.after if cc then c.after = pack(cc) end
+ local cc = c.current if cc then c.current = pack(cc) end
end
local c = vv.reversecoverage
if c then
- c.before = c.before and pack(c.before )
- c.after = c.after and pack(c.after )
- c.current = c.current and pack(c.current)
+ local cc = c.before if cc then c.before = pack(cc) end
+ local cc = c.after if cc then c.after = pack(cc) end
+ local cc = c.current if cc then c.current = pack(cc) end
+ end
+ -- no need to pack vv.glyphs
+ local c = vv.glyphs
+ if c then
+ if c.fore == "" then c.fore = nil end
+ if c.back == "" then c.back = nil end
end
end
end
@@ -250,7 +276,7 @@ function fonts.otf.enhancers.pack(data)
if a then
v.anchors = pack(a)
end
- local l = v.lookups
+ local l = v.mlookups
if l then
for k,v in next, l do
for kk=1,#v do
@@ -277,54 +303,101 @@ function fonts.otf.enhancers.unpack(data)
if data then
local t = data.tables
if t then
+ local unpacked = { }
for k, v in next, data.glyphs do
local tv = t[v.boundingbox] if tv then v.boundingbox = tv end
- local l = v.lookups
+ local l = v.slookups
+ if l then
+ for k,v in next, l do
+ local tv = t[v] if tv then l[k] = tv end
+ end
+ end
+ local l = v.mlookups
if l then
for k,v in next, l do
for i=1,#v do
- local tv = t[v[i]] if tv then v[i] = tv end
local vi = v[i]
- local what = vi[1]
- if what == "pair" then
- local tv = t[vi[3]] if tv then vi[3] = tv end
- local tv = t[vi[4]] if tv then vi[4] = tv end
- elseif what == "position" then
- local tv = t[vi[2]] if tv then vi[2] = tv end
+ local tv = t[vi]
+ if tv then
+ v[i] = tv
+ if unpacked[tv] then
+ vi = false
+ else
+ unpacked[tv], vi = true, tv
+ end
+ end
+ if vi then
+ local what = vi[1]
+ if what == "pair" then
+ local tv = t[vi[3]] if tv then vi[3] = tv end
+ local tv = t[vi[4]] if tv then vi[4] = tv end
+ elseif what == "position" then
+ local tv = t[vi[2]] if tv then vi[2] = tv end
+ end
end
end
end
end
local m = v.mykerns
if m then
- local tv = t[m] if tv then m = tv v.mykerns = m end -- secondary optimization
- for k,v in next, m do
- local tv = t[v] if tv then m[k] = tv end
+ local tm = t[m]
+ if tm then
+ v.mykerns = tm
+ if unpacked[tm] then
+ m = false
+ else
+ unpacked[tm], m = true, tm
+ end
+ end
+ if m then
+ for k,v in next, m do
+ local tv = t[v] if tv then m[k] = tv end
+ end
end
end
local m = v.math
if m then
local mk = m.kerns
if mk then
- local tv = t[mk] if tv then mk = tv m.kerns = mk end -- secondary optimization
- for k,v in next, mk do
- local tv = t[v] if tv then mk[k] = tv end
+ local tm = t[mk]
+ if tm then
+ m.kerns = tm
+ if unpacked[tm] then
+ mk = false
+ else
+ unpacked[tm], mk = true, tm
+ end
+ end
+ if mk then
+ for k,v in next, mk do
+ local tv = t[v] if tv then mk[k] = tv end
+ end
end
end
end
local a = v.anchors
if a then
- local tv = t[a] if tv then a = tv v.anchors = a end -- secondary optimization
- for k,v in next, a do
- if k == "baselig" then
- for kk, vv in next, v do
- for kkk=1,#vv do
- local tv = t[vv[kkk]] if tv then vv[kkk] = tv end
- end
- end
+ local ta = t[a]
+ if ta then
+ v.anchors = ta
+ if not unpacked[ta] then
+ unpacked[ta], a = true, ta
else
- for kk, vv in next, v do
- local tv = t[vv] if tv then v[kk] = tv end
+ a = false
+ end
+ end
+ if a then
+ for k,v in next, a do
+ if k == "baselig" then
+ for kk, vv in next, v do
+ for kkk=1,#vv do
+ local tv = t[vv[kkk]] if tv then vv[kkk] = tv end
+ end
+ end
+ else
+ for kk, vv in next, v do
+ local tv = t[vv] if tv then v[kk] = tv end
+ end
end
end
end
@@ -351,6 +424,7 @@ function fonts.otf.enhancers.unpack(data)
cc = c.after if cc then local tv = t[cc] if tv then c.after = tv end end
cc = c.current if cc then local tv = t[cc] if tv then c.current = tv end end
end
+ -- no need to unpack vv.glyphs
end
end
end
@@ -382,9 +456,19 @@ function fonts.otf.enhancers.unpack(data)
end
local features = fdata.features
if features then
- local tv = t[features] if tv then fdata.features = tv features = tv end -- secondary pack
- for script, sdata in next, features do
- local tv = t[sdata] if tv then features[script] = tv end
+ local tv = t[features]
+ if tv then
+ fdata.features = tv
+ if not unpacked[tv] then
+ unpacked[tv], features = true, tv
+ else
+ features = false
+ end
+ end
+ if features then
+ for script, sdata in next, features do
+ local tv = t[sdata] if tv then features[script] = tv end
+ end
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/font-ott.lua b/Master/texmf-dist/tex/context/base/font-ott.lua
index 47c2e0e9fe0..2be1bf06c00 100644
--- a/Master/texmf-dist/tex/context/base/font-ott.lua
+++ b/Master/texmf-dist/tex/context/base/font-ott.lua
@@ -87,7 +87,7 @@ otf.tables.scripts = {
['ugar'] = 'Ugaritic Cuneiform',
['xpeo'] = 'Old Persian Cuneiform',
['xsux'] = 'Sumero-Akkadian Cuneiform',
- ['yi' ] = 'Yi'
+ ['yi' ] = 'Yi',
}
otf.tables.languages = {
@@ -569,6 +569,7 @@ otf.tables.features = {
['rphf'] = 'Reph Form',
['rtbd'] = 'Right Bounds',
['rtla'] = 'Right-To-Left Alternates',
+ ['rtlm'] = 'Right To Left Math', -- math
['ruby'] = 'Ruby Notation Forms',
['salt'] = 'Stylistic Alternates',
['sinf'] = 'Scientific Inferiors',
@@ -671,16 +672,24 @@ local to_scripts = otf.tables.to_scripts
local to_languages = otf.tables.to_languages
local to_features = otf.tables.to_features
-for k, v in pairs(to_features) do
+for k, v in next, to_features do
local stripped = gsub(k,"%-"," ")
to_features[stripped] = v
local stripped = gsub(k,"[^a-zA-Z0-9]","")
to_features[stripped] = v
end
-for k, v in pairs(to_features) do
+for k, v in next, to_features do
to_features[lower(k)] = v
end
+otf.meanings.checkers = {
+ rand = function(v)
+ return v and "random"
+ end
+}
+
+local checkers = otf.meanings.checkers
+
function otf.meanings.normalize(features)
local h = { }
for k,v in next, features do
@@ -709,7 +718,9 @@ function otf.meanings.normalize(features)
v = b
end
end
- h[to_features[k] or k] = v
+ k = to_features[k] or k
+ local c = checkers[k]
+ h[k] = c and c(v) or v
end
end
return h
diff --git a/Master/texmf-dist/tex/context/base/font-pat.lua b/Master/texmf-dist/tex/context/base/font-pat.lua
index ae91700a90e..6aba4d47e3d 100644
--- a/Master/texmf-dist/tex/context/base/font-pat.lua
+++ b/Master/texmf-dist/tex/context/base/font-pat.lua
@@ -1,15 +1,17 @@
if not modules then modules = { } end modules ['font-pat'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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 match, lower = string.match, string.lower
+local match, lower, find = string.match, string.lower, string.find
local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end)
+-- this will become a per font patch file
+--
-- older versions of latin modern didn't have the designsize set
-- so for them we get it from the name
@@ -92,3 +94,33 @@ local function patch(data,filename)
end
patches["palatino.*arabic"] = patch
+
+local function patch_domh(data,filename,threshold)
+ local m = data.math
+ if m then
+ local d = m.DisplayOperatorMinHeight or 0
+ if d < threshold then
+ if trace_loading then
+ logs.report("load otf","patching DisplayOperatorMinHeight(%s -> %s)",d,threshold)
+ end
+ m.DisplayOperatorMinHeight = threshold
+ end
+ end
+ if tex.luatexversion < 48 then
+ for _, g in next, data.glyphs do
+ local name = g.name
+ if find(name,"^integral$") or find(name,"^integral%.vsize") then
+ local width, italic = g.width or 0, g.italic_correction or 0
+ local newwidth = width - italic
+ if trace_loading then
+ logs.report("load otf","patching width of %s: %s (width) - %s (italic) = %s",name,width,italic,newwidth)
+ end
+ g.width = newwidth
+ end
+ end
+ end
+end
+
+patches["cambria"] = function(data,filename) patch_domh(data,filename,2800) end
+patches["cambmath"] = function(data,filename) patch_domh(data,filename,2800) end
+patches["asana"] = function(data,filename) patch_domh(data,filename,1350) end
diff --git a/Master/texmf-dist/tex/context/base/font-run.mkiv b/Master/texmf-dist/tex/context/base/font-run.mkiv
index 4cc098e2ce1..aad6bebe88e 100644
--- a/Master/texmf-dist/tex/context/base/font-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/font-run.mkiv
@@ -108,10 +108,32 @@
\gdef\doshowfont[#1][#2]%
{\bgroup
- \boxrulewidth=.1pt
- \setupcolors[\c!state=\v!local]%
\iffirstargument
\definefont[\s!dummy][#1]\dummy
+ \fi
+ \doifelsenothing{#2}
+ {\dodoshowfont{#1}{0}}
+ {\doifelse{#2}\v!all
+ {\dostepwiserecurse{0}{255}{1}
+ {\donefalse
+ \let\charplane\recurselevel
+ \dostepwiserecurse{0}{255}{1}
+ {\iffontchar\font\numexpr\charplane*256+\recurselevel\relax
+ \donetrue
+ \exitloop
+ \fi}%
+ \ifdone
+ \dodoshowfont{#1}\charplane
+ \fi}}
+ {\processcommalist[#2]{\dodoshowfont{#1}}}}%
+ \egroup}
+
+\gdef\dodoshowfont#1#2%
+ {\bgroup
+ \edef\charplane{\number#2}%
+ \boxrulewidth=.1pt
+ \iffirstargument
+% \definefont[\s!dummy][#1]\dummy
\else\ifdim2.5em>.05\hsize \tx
\ifdim2.5em>.05\hsize \txx
\fi\fi\fi
@@ -131,7 +153,7 @@
\@EA\scratchcounter\string"\hexnumber\row\hexnumber\col\relax
\edef\rowcol{\the\scratchcounter}%
\iffontchar\font\scratchcounter
- \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}%
+ \setbox\scratchbox\ruledhbox{\black\char\numexpr\charplane*256+\scratchcounter\relax}%
\ifdim\wd\scratchbox>\zeropoint
\donetrue \else \donefalse
\fi
@@ -159,11 +181,8 @@
{\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
+ \tinyfont
+ \hfill\number\rowcol
\vfill
\octnumber\rowcol\hfill\lchexnumbers\rowcol
\par
@@ -177,14 +196,7 @@
% 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 }}}}%
+ \edef\theshowfontspecs{name: {\noexpand\black\fontname\font}\quad plane: \charplane\enspace"\hexnumber\charplane}%
\tf % also sets em
\hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs}
\egroup
@@ -227,7 +239,6 @@
\@@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|}]
diff --git a/Master/texmf-dist/tex/context/base/font-syn.lua b/Master/texmf-dist/tex/context/base/font-syn.lua
index 828808ec59d..5ad92e0022d 100644
--- a/Master/texmf-dist/tex/context/base/font-syn.lua
+++ b/Master/texmf-dist/tex/context/base/font-syn.lua
@@ -1,15 +1,24 @@
if not modules then modules = { } end modules ['font-syn'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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 next = next
+-- todo: subs in lookups requests
+
+local utf = unicode.utf8
+local next, tonumber = next, tonumber
local gsub, lower, match, find, lower, upper = string.gsub, string.lower, string.match, string.find, string.lower, string.upper
+local find, gmatch = string.find, string.gmatch
+local concat, sort, format = table.concat, table.sort, string.format
+local lpegmatch = lpeg.match
+local utfgsub, utflower = utf.gsub, utf.lower
+local unpack = unpack or table.unpack
-local trace_names = false trackers.register("fonts.names", function(v) trace_names = v end)
+local trace_names = false trackers.register("fonts.names", function(v) trace_names = v end)
+local trace_warnings = false trackers.register("fonts.warnings", function(v) trace_warnings = v end)
--[[ldx--
<p>This module implements a name to filename resolver. Names are resolved
@@ -29,7 +38,7 @@ fonts.names.data = fonts.names.data or { }
local names = fonts.names
local filters = fonts.names.filters
-names.version = 1.08 -- when adapting this, also changed font-dum.lua
+names.version = 1.103
names.basename = "names"
names.saved = false
names.loaded = false
@@ -39,6 +48,103 @@ names.autoreload = toboolean(os.env['MTX.FONTS.AUTOLOAD'] or os.env['MTX_FONTS_A
names.cache = containers.define("fonts","data",names.version,true)
--[[ldx--
+<p>A few helpers.</p>
+--ldx]]--
+
+local P, C, Cc, Cs, Carg = lpeg.P, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg
+
+-- what to do with 'thin'
+
+local weights = Cs ( -- not extra
+ P("demibold")
+ + P("semibold")
+ + P("mediumbold")
+ + P("ultrabold")
+ + P("extrabold")
+ + P("ultralight")
+ + P("bold")
+ + P("demi")
+ + P("semi")
+ + P("light")
+ + P("medium")
+ + P("heavy")
+ + P("ultra")
+ + P("black")
+ + P("bol") -- / "bold"
+ + P("regular") / "normal"
+)
+
+local styles = Cs (
+ P("reverseoblique") / "reverseitalic"
+ + P("regular") / "normal"
+ + P("italic")
+ + P("oblique") / "italic"
+ + P("slanted")
+ + P("roman") / "normal"
+ + P("ital") / "italic"
+ + P("ita") / "italic"
+)
+
+local widths = Cs(
+ P("condensed")
+ + P("thin")
+ + P("expanded")
+ + P("cond") / "condensed"
+ + P("normal")
+ + P("book") / "normal"
+)
+
+local variants = Cs( -- fax casual
+ P("smallcaps")
+ + P("oldstyle")
+ + P("caps") / "smallcaps"
+)
+
+local any = P(1)
+
+local analysed_table
+
+local analyser = Cs (
+ (
+ weights / function(s) analysed_table[1] = s return "" end
+ + styles / function(s) analysed_table[2] = s return "" end
+ + widths / function(s) analysed_table[3] = s return "" end
+ + variants / function(s) analysed_table[4] = s return "" end
+ + any
+ )^0
+)
+
+local splitter = lpeg.splitat("-")
+
+function names.splitspec(askedname)
+ local name, weight, style, width, variant = lpegmatch(splitter,askedname)
+ weight = weight and lpegmatch(weights, weight) or weight
+ style = style and lpegmatch(styles, style) or style
+ width = width and lpegmatch(widths, width) or width
+ variant = variant and lpegmatch(variants,variant) or variant
+ if trace_names then
+ logs.report("fonts","requested name '%s' split in name '%s', weight '%s', style '%s', width '%s' and variant '%s'",
+ askedname,name or '',weight or '',style or '',width or '',variant or '')
+ end
+ if not weight or not weight or not width or not variant then
+ weight, style, width, variant = weight or "normal", style or "normal", width or "normal", variant or "normal"
+ if trace_names then
+ logs.report("fonts","request '%s' normalized to '%s-%s-%s-%s-%s'",
+ askedname,name,weight,style,width,variant)
+ end
+ end
+ return name or askedname, weight, style, width, variant
+end
+
+local function analysespec(somename)
+ if somename then
+ analysed_table = { }
+ local name = lpegmatch(analyser,somename)
+ return name, analysed_table[1], analysed_table[2], analysed_table[3], analysed_table[4]
+ end
+end
+
+--[[ldx--
<p>It would make sense to implement the filters in the related modules,
but to keep the overview, we define them here.</p>
--ldx]]--
@@ -48,6 +154,20 @@ filters.ttf = fontloader.info
filters.ttc = fontloader.info
filters.dfont = fontloader.info
+function fontloader.fullinfo(...)
+ local ff = fontloader.open(...)
+ if ff then
+ local d = ff and fontloader.to_table(ff)
+ d.glyphs, d.subfonts, d.gpos, d.gsub, d.lookups = nil, nil, nil, nil, nil
+ fontloader.close(ff)
+ return d
+ else
+ return nil, "error in loading font"
+ end
+end
+
+filters.otf = fontloader.fullinfo
+
function filters.afm(name)
-- we could parse the afm file as well, and then report an error but
-- it's not worth the trouble
@@ -87,14 +207,7 @@ for combination with the weight of a font.</p>
filters.list = {
"otf", "ttf", "ttc", "dfont", "afm",
-}
-
-filters.fixes = {
- { "reg$", "regular", },
- { "ita$", "italic", },
- { "ital$", "italic", },
- { "cond$", "condensed", },
- { "book$", "", },
+--~ "ttc", "otf", "ttf", "dfont", "afm",
}
names.xml_configuration_file = "fonts.conf" -- a bit weird format, bonus feature
@@ -132,7 +245,7 @@ function names.getpaths(trace)
end
end
if name ~= "" and lfs.isfile(name) then
- if trace then
+ if trace_names then
logs.report("fontnames","loading fontconfig file: %s",name)
end
local xmldata = xml.load(name)
@@ -145,17 +258,17 @@ function names.getpaths(trace)
end
end
if lfs.isfile(incname) then
- if trace then
+ if trace_names then
logs.report("fontnames","merging included fontconfig file: %s",incname)
end
return io.loaddata(incname)
- elseif trace then
+ elseif trace_names then
logs.report("fontnames","ignoring included fontconfig file: %s",incname)
end
end)
-- end of untested mess
local fontdirs = xml.collect_texts(xmldata,"dir",true)
- if trace then
+ if trace_names then
logs.report("fontnames","%s dirs found in fontconfig",#fontdirs)
end
collect(fontdirs)
@@ -168,55 +281,332 @@ function names.getpaths(trace)
return result
end
-function names.cleanname(name)
+local function cleanname(name)
return (gsub(lower(name),"[^%a%d]",""))
+ -- once we can load files with utf names, we can play with the following:
+ -- return (utfgsub(utfgsub(lower(str),"[^%a%A%d]",""),"%s",""))
end
-function names.identify(verbose) -- lsr is for kpse
- names.data = {
- version = names.version,
- mapping = { },
- -- sorted = { },
- fallback_mapping = { },
- -- fallback_sorted = { },
+names.cleanname = cleanname
+
+local function check_names(result)
+ local names = result.names
+ if names then
+ for i=1,#names do
+ local name = names[i]
+ if name.lang == "English (US)" then
+ return name.names
+ end
+ end
+ end
+end
+
+local function walk_tree(pathlist,suffix,identify)
+ if pathlist then
+ for i=1,#pathlist do
+ local path = pathlist[i]
+ path = resolvers.clean_path(path .. "/")
+ path = gsub(path,"/+","/")
+ local pattern = path .. "**." .. suffix -- ** forces recurse
+ logs.report("fontnames", "globbing path %s",pattern)
+ local t = dir.glob(pattern)
+ sort(t,sorter)
+ for j=1,#t do
+ local completename = t[j]
+ identify(completename,file.basename(completename),suffix,completename)
+ end
+ end
+ end
+end
+
+local function check_name(data,result,filename,suffix,subfont)
+ -- shortcuts
+ local specifications = data.specifications
+ local families = data.families
+ -- prepare
+ local names = check_names(result)
+ -- fetch
+ local familyname = (names and names.preffamilyname) or result.familyname
+ local fullname = (names and names.fullname) or result.fullname
+ local fontname = result.fontname
+ local subfamily = (names and names.subfamily)
+ local modifiers = (names and names.prefmodifiers)
+ local weight = (names and names.weight) or result.weight
+ local italicangle = tonumber(result.italicangle)
+ local subfont = subfont or nil
+ local rawname = fullname or fontname or familyname
+ -- normalize
+ familyname = familyname and cleanname(familyname)
+ fullname = fullname and cleanname(fullname)
+ fontname = fontname and cleanname(fontname)
+ subfamily = subfamily and cleanname(subfamily)
+ modifiers = modifiers and cleanname(modifiers)
+ weight = weight and cleanname(weight)
+ italicangle = (italicangle == 0) and nil
+ -- analyse
+ local a_name, a_weight, a_style, a_width, a_variant = analysespec(fullname or fontname or familyname)
+ -- check
+ local width = a_width
+ local variant = a_variant
+ local style = modifiers and gsub(modifiers,"[^%a]","")
+ if not style and italicangle then
+ style = "italic"
+ end
+ if not variant or variant == "" then
+ variant = "normal"
+ end
+ if not weight or weight == "" then
+ weight = a_weight
+ end
+ if not style or style == "" then
+ style = a_style
+ end
+ if not familyname then
+ familyname = a_name
+ end
+ fontname = fontname or fullname or familyname or file.basename(filename)
+ fullname = fullname or fontname
+ familyname = familyname or fontname
+ specifications[#specifications + 1] = {
+ filename = filename,
+ format = lower(suffix),
+ subfont = subfont,
+ rawname = rawname,
+ familyname = familyname,
+ fullname = fullname,
+ fontname = fontname,
+ subfamily = subfamily,
+ modifiers = modifiers,
+ weight = weight,
+ style = style,
+ width = width,
+ variant = variant,
+ minsize = result.design_range_bottom or 0,
+ maxsize = result.design_range_top or 0,
+ designsize = result.design_size or 0,
}
- local done, mapping, fallback_mapping, nofread, nofok = { }, names.data.mapping, names.data.fallback_mapping, 0, 0
- local cleanname = names.cleanname
- local function check(result, filename, suffix, is_sub)
- local fontname = result.fullname
- if fontname then
- local n = cleanname(result.fullname)
- if not mapping[n] then
- mapping[n], nofok = { lower(suffix), fontname, filename, is_sub }, nofok + 1
+end
+
+local function cleanupkeywords()
+ local data = names.data
+ local specifications = names.data.specifications
+ if specifications then
+ local weights, styles, widths, variants = { }, { }, { }, { }
+ for i=1,#specifications do
+ local s = specifications[i]
+ -- fix (sofar styles are taken from the name, and widths from the specification)
+ local _, b_weight, b_style, b_width, b_variant = analysespec(s.weight)
+ local _, c_weight, c_style, c_width, c_variant = analysespec(s.style)
+ local _, d_weight, d_style, d_width, d_variant = analysespec(s.width)
+ local _, e_weight, e_style, e_width, e_variant = analysespec(s.variant)
+ local _, f_weight, f_style, f_width, f_variant = analysespec(s.fullname or "")
+ local weight = b_weight or c_weight or d_weight or e_weight or f_weight or "normal"
+ local style = b_style or c_style or d_style or e_style or f_style or "normal"
+ local width = b_width or c_width or d_width or e_width or f_width or "normal"
+ local variant = b_variant or c_variant or d_variant or e_variant or f_variant or "normal"
+ if not weight or weight == "" then weight = "normal" end
+ if not style or style == "" then style = "normal" end
+ if not width or width == "" then width = "normal" end
+ if not variant or variant == "" then variant = "normal" end
+ weights [weight ] = (weights [weight ] or 0) + 1
+ styles [style ] = (styles [style ] or 0) + 1
+ widths [width ] = (widths [width ] or 0) + 1
+ variants[variant] = (variants[variant] or 0) + 1
+ if weight ~= s.weight then
+ s.fontweight = s.weight
+ end
+ s.weight, s.style, s.width, s.variant = weight, style, width, variant
+ end
+ local stats = data.statistics
+ stats.used_weights, stats.used_styles, stats.used_widths, stats.used_variants = weights, styles, widths, variants
+ end
+end
+
+local function collectstatistics()
+ local data = names.data
+ local specifications = data.specifications
+ if specifications then
+ local weights, styles, widths, variants = { }, { }, { }, { }
+ for i=1,#specifications do
+ local s = specifications[i]
+ local weight, style, width, variant = s.weight, s.style, s.width, s.variant
+ if weight then weights [weight ] = (weights [weight ] or 0) + 1 end
+ if style then styles [style ] = (styles [style ] or 0) + 1 end
+ if width then widths [width ] = (widths [width ] or 0) + 1 end
+ if variant then variants[variant] = (variants[variant] or 0) + 1 end
+ end
+ local stats = data.statistics
+ stats.weights, stats.styles, stats.widths, stats.variants, stats.fonts = weights, styles, widths, variants, #specifications
+ end
+end
+
+local function collecthashes()
+ local data = names.data
+ local mappings = data.mappings
+ local fallbacks = data.fallbacks
+ local specifications = data.specifications
+ local nofmappings, noffallbacks = 0, 0
+ if specifications then
+ -- maybe multiple passes
+ for index=1,#specifications do
+ local s = specifications[index]
+ local format, fullname, fontname, familyname, weight, subfamily = s.format, s.fullname, s.fontname, s.familyname, s.weight, s.subfamily
+ local mf, ff = mappings[format], fallbacks[format]
+ if fullname and not mf[fullname] then
+ mf[fullname], nofmappings = index, nofmappings + 1
+ end
+ if fontname and not mf[fontname] then
+ mf[fontname], nofmappings = index, nofmappings + 1
+ end
+ if familyname and weight then
+ local madename = familyname .. weight
+ if not mf[madename] and not ff[madename] then
+ ff[madename], noffallbacks = index, noffallbacks + 1
+ end
+ end
+ if familyname and subfamily then
+ local extraname = familyname .. subfamily
+ if not mf[extraname] and not ff[extraname] then
+ ff[extraname], noffallbacks = index, noffallbacks + 1
+ end
+ end
+ if familyname then
+ if not mf[familyname] and not ff[familyname] then
+ ff[familyname], noffallbacks = index, noffallbacks + 1
+ end
+ end
+ end
+ end
+ return nofmappings, noffallbacks
+end
+
+local function collectfamilies()
+ local data = names.data
+ local specifications = data.specifications
+ local families = data.families
+ for index=1,#specifications do
+ local familyname = specifications[index].familyname
+ local family = families[familyname]
+ if not family then
+ families[familyname] = { index }
+ else
+ family[#family+1] = index
+ end
+ end
+end
+
+local function checkduplicate(where) -- fails on "Romantik" but that's a border case anyway
+ local data = names.data
+ local mapping = data[where]
+ local specifications, loaded = data.specifications, { }
+ if specifications and mapping then
+ for _, m in next, mapping do
+ for k, v in next, m do
+ local s = specifications[v]
+ local hash = format("%s-%s-%s-%s-%s",s.familyname,s.weight or "*",s.style or "*",s.width or "*",s.variant or "*")
+ local h = loaded[hash]
+ if h then
+ local ok = true
+ local fn = s.filename
+ for i=1,#h do
+ local hn = s.filename
+ if h[i] == fn then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ h[#h+1] = fn
+ end
+ else
+ loaded[hash] = { s.filename }
+ end
+ end
+ end
+ end
+ local n = 0
+ for k, v in table.sortedhash(loaded) do
+ local nv = #v
+ if nv > 1 then
+ if trace_warnings then
+ logs.report("fontnames", "double lookup: %s => %s",k,concat(v," | "))
+ end
+ n = n + nv
+ end
+ end
+ logs.report("fontnames", "%s double lookups in %s",n,where)
+end
+
+local function checkduplicates()
+ checkduplicate("mappings")
+ checkduplicate("fallbacks")
+end
+
+local sorter = function(a,b)
+ return a > b -- to be checked
+end
+
+local function sorthashes()
+ local data, list = names.data, filters.list
+ local mappings, fallbacks, sorted_mappings, sorted_fallbacks = data.mappings, data.fallbacks, { }, { }
+ data.sorted_mappings, data.sorted_fallbacks = sorted_mappings, sorted_fallbacks
+ for i=1,#list do
+ local l = list[i]
+ sorted_mappings[l], sorted_fallbacks[l] = table.keys(mappings[l]), table.keys(fallbacks[l])
+ sort(sorted_mappings[l],sorter)
+ sort(sorted_fallbacks[l],sorter)
+ end
+ data.sorted_families = table.keys(data.families)
+ sort(data.sorted_families,sorter)
+end
+
+local function unpackreferences()
+ local data = names.data
+ local specifications = data.specifications
+ if specifications then
+ for k, v in next, data.families do
+ for i=1,#v do
+ v[i] = specifications[v[i]]
end
end
- if result.fontname then
- fontname = fontname or result.fontname
- local n = cleanname(result.fontname)
- if not mapping[n] then
- mapping[n], nofok = { lower(suffix), fontname, filename, is_sub }, nofok + 1
+ local mappings = data.mappings
+ if mappings then
+ for _, m in next, mappings do
+ for k, v in next, m do
+ m[k] = specifications[v]
+ end
end
end
- if result.familyname and result.weight and result.italicangle == 0 then
- local madename = result.familyname .. " " .. result.weight
- fontname = fontname or madename
- local n = cleanname(fontname)
- if not mapping[n] and not fallback_mapping[n] then
- fallback_mapping[n], nofok = { lower(suffix), fontname, filename, is_sub }, nofok + 1
+ local fallbacks = data.fallbacks
+ if fallbacks then
+ for _, f in next, fallbacks do
+ for k, v in next, f do
+ f[k] = specifications[v]
+ end
end
end
end
- local trace = verbose or trace_names
- local skip_paths = filters.paths
- local skip_names = filters.names
+end
+
+local function analysefiles()
+ local data = names.data
+ local done, totalnofread, totalnofskipped = { }, 0, 0
+ local skip_paths, skip_names = filters.paths, filters.names
local function identify(completename,name,suffix,storedname)
- if not done[name] and io.exists(completename) then
+ local basename = file.basename(completename)
+ local basepath = file.dirname(completename)
+ if done[name] then
+ -- already done (avoid otf afm clash)
+ elseif not io.exists(completename) then
+ -- weird error
+ elseif not file.is_qualified_path(completename) and resolvers.find_file(completename,suffix) == "" then
+ -- not locateble by backend anyway
+ else
nofread = nofread + 1
if #skip_paths > 0 then
- local path = file.dirname(completename)
for i=1,#skip_paths do
- if find(path,skip_paths[i]) then
- if trace then
+ if find(basepath,skip_paths[i]) then
+ if trace_names then
logs.report("fontnames","rejecting path of %s font %s",suffix,completename)
logs.push()
end
@@ -225,11 +615,10 @@ function names.identify(verbose) -- lsr is for kpse
end
end
if #skip_names > 0 then
- local base = file.basename(completename)
for i=1,#skip_paths do
- if find(base,skip_names[i]) then
+ if find(basename,skip_names[i]) then
done[name] = true
- if trace then
+ if trace_names then
logs.report("fontnames","rejecting name of %s font %s",suffix,completename)
logs.push()
end
@@ -242,55 +631,52 @@ function names.identify(verbose) -- lsr is for kpse
logs.push()
end
local result, message = filters[lower(suffix)](completename)
- if trace then
+ if trace_names then
logs.pop()
end
if result then
if not result[1] then
- check(result,storedname,suffix,false) -- was name
+ local ok = check_name(data,result,storedname,suffix)
+ if not ok then
+ nofskipped = nofskipped + 1
+ end
else
for r=1,#result do
- check(result[r],storedname,suffix,true) -- was name
+ local ok = check_name(data,result[r],storedname,suffix,r-1) -- subfonts start at zero
+ if not ok then
+ nofskipped = nofskipped + 1
+ end
end
end
- if message and message ~= "" then
+ if trace_warnings and message and message ~= "" then
logs.report("fontnames","warning when identifying %s font %s: %s",suffix,completename,message)
end
- else
+ elseif trace_warnings then
logs.report("fontnames","error when identifying %s font %s: %s",suffix,completename,message or "unknown")
end
done[name] = true
end
end
- local totalread, totalok = 0, 0
local function traverse(what, method)
- for n, suffix in ipairs(filters.list) do
- nofread, nofok = 0, 0
+ local list = filters.list
+ for n=1,#list do
+ local suffix = list[n]
local t = os.gettimeofday() -- use elapser
+ nofread, nofskipped = 0, 0
suffix = lower(suffix)
logs.report("fontnames", "identifying %s font files with suffix %s",what,suffix)
method(suffix)
suffix = upper(suffix)
logs.report("fontnames", "identifying %s font files with suffix %s",what,suffix)
method(suffix)
- logs.report("fontnames", "%s %s files identified, %s hash entries added, runtime %0.3f seconds",nofread,what,nofok,os.gettimeofday()-t)
- totalread, totalok = totalread + nofread, totalok + nofok
- end
- end
- local function walk_tree(pathlist,suffix)
- if pathlist then
- for _, path in ipairs(pathlist) do
- path = resolvers.clean_path(path .. "/")
- path = gsub(path,"/+","/")
- local pattern = path .. "**." .. suffix -- ** forces recurse
- logs.report("fontnames", "globbing path %s",pattern)
- local t = dir.glob(pattern)
- for _, completename in pairs(t) do -- ipairs
- identify(completename,file.basename(completename),suffix,completename)
- end
- end
+ totalnofread, totalnofskipped = totalnofread + nofread, totalnofskipped + nofskipped
+ local elapsed = os.gettimeofday() - t
+ logs.report("fontnames", "%s %s files identified, %s hash entries added, runtime %0.3f seconds",nofread,what,nofread-nofskipped,elapsed)
end
end
+ if not trace_warnings then
+ logs.report("fontnames", "warnings are disabled (tracker 'fonts.warnings')")
+ end
traverse("tree", function(suffix) -- TEXTREE only
resolvers.with_files(".*%." .. suffix .. "$", function(method,root,path,name)
if method == "file" then
@@ -304,39 +690,67 @@ function names.identify(verbose) -- lsr is for kpse
-- using the vars is to clumsy so we just stick to a full scan instead
traverse("lsr", function(suffix) -- all trees
local pathlist = resolvers.split_path(resolvers.show_path("ls-R") or "")
- walk_tree(pathlist,suffix)
+ walk_tree(pathlist,suffix,identify)
end)
else
traverse("system", function(suffix) -- OSFONTDIR cum suis
- walk_tree(names.getpaths(trace),suffix)
+ walk_tree(names.getpaths(trace),suffix,identify)
end)
end
- local t = { }
- for _, f in ipairs(filters.fixes) do
- local expression, replacement = f[1], f[2]
- for k,v in next, mapping do
- local fix, pos = gsub(k,expression,replacement)
- if pos > 0 and not mapping[fix] then
- t[fix] = v
+ data.statistics.readfiles, data.statistics.skippedfiles = totalnofread, totalnofskipped
+end
+
+local function rejectclashes() -- just to be sure, so no explicit afm will be found then
+ local specifications, used, okay = names.data.specifications, { }, { }
+ for i=1,#specifications do
+ local s = specifications[i]
+ local f = s.fontname
+ if f then
+ local fnd, fnm = used[f], s.filename
+ if fnd then
+ if trace_warnings then
+ logs.report("fontnames", "fontname '%s' clashes, rejecting '%s' in favor of '%s'",f,fnm,fnd)
+ end
+ else
+ used[f], okay[#okay+1] = fnm, s
end
+ else
+ okay[#okay+1] = s
end
end
- local n = 0
- for k,v in next, t do
- mapping[k] = v
- n = n + 1
+ local d = #specifications - #okay
+ if d > 0 then
+ logs.report("fontnames", "%s files rejected due to clashes",d)
end
- local rejected = 0
- for k, v in next, mapping do
- local kind, filename = v[1], v[3]
- if not file.is_qualified_path(filename) and resolvers.find_file(filename,kind) == "" then
- mapping[k] = nil
- rejected = rejected + 1
- end
- end
- if n > 0 then
- logs.report("fontnames", "%s files read, %s normal and %s extra entries added, %s rejected, %s valid",totalread,totalok,n,rejected,totalok+n-rejected)
+ names.data.specifications = okay
+end
+
+local function resetdata()
+ local mappings, fallbacks = { }, { }
+ for _, k in next, filters.list do
+ mappings[k], fallbacks[k] = { }, { }
end
+ names.data = {
+ version = names.version,
+ mappings = mappings,
+ fallbacks = fallbacks,
+ specifications = { },
+ families = { },
+ statistics = { },
+ data_state = resolvers.data_state(),
+ }
+end
+
+function names.identify()
+ resetdata()
+ analysefiles()
+ rejectclashes()
+ collectfamilies()
+ collectstatistics()
+ cleanupkeywords()
+ collecthashes()
+ checkduplicates()
+ -- sorthashes() -- will be resorted when saved
end
function names.is_permitted(name)
@@ -359,49 +773,85 @@ function names.load(reload,verbose)
logs.report("font table", "unable to access database cache")
end
names.saved = true
- else
- names.data = names.read_data(names.basename)
- if not names.saved then
- if table.is_empty(names.data) or table.is_empty(names.data.mapping) then
- names.load(true)
- end
- names.saved = true
+ end
+ local data = names.read_data(names.basename)
+ names.data = data
+ if not names.saved then
+ if not data or not next(data) or not data.specifications or not next(data.specifications) then
+ names.load(true)
end
+ names.saved = true
end
- local data = names.data
- if data then
- data.sorted = table.sortedkeys(data.mapping or { }) or { }
- data.fallback_sorted = table.sortedkeys(data.fallback_mapping or { }) or { }
- else
+ if not data then
logs.report("font table", "accessing the data table failed")
+ else
+ unpackreferences()
+ sorthashes()
end
names.loaded = true
end
end
-function names.list(pattern,reload)
+local function list_them(mapping,sorted,pattern,t,all)
+ if mapping[pattern] then
+ t[pattern] = mapping[pattern]
+ else
+ for k=1,#sorted do
+ local v = sorted[k]
+ if not t[v] and find(v,pattern) then
+ t[v] = mapping[v]
+ if not all then
+ return
+ end
+ end
+ end
+ end
+end
+
+function names.list(pattern,reload,all) -- here?
names.load(reload)
if names.loaded then
local t = { }
- local function list_them(mapping,sorted)
- if mapping[pattern] then
- t[pattern] = mapping[pattern]
- else
- for k,v in ipairs(sorted) do
- if find(v,pattern) then
- t[v] = mapping[v]
- end
+ local data = names.data
+ if data then
+ local list = filters.list
+ local mappings, sorted_mappings = data.mappings, data.sorted_mappings
+ local fallbacks, sorted_fallbacks = data.fallbacks, data.sorted_fallbacks
+ for i=1,#list do
+ local format = list[i]
+ list_them(mappings[format],sorted_mappings[format],pattern,t,all)
+ if next(t) and not all then
+ return t
+ end
+ list_them(fallbacks[format],sorted_fallbacks[format],pattern,t,all)
+ if next(t) and not all then
+ return t
end
end
end
+ return t
+ end
+end
+
+local reloaded = false
+
+local function is_reloaded()
+ if not reloaded then
local data = names.data
- if data then
- list_them(data.mapping,data.sorted)
- list_them(data.fallback_mapping,data.fallback_sorted)
+ if names.autoreload then
+ local c_status = table.serialize(resolvers.data_state())
+ local f_status = table.serialize(data.data_state)
+ if c_status == f_status then
+ -- logs.report("fonts","font database matches configuration and file hashes")
+ return
+ else
+ logs.report("fonts","font database does not match configuration and file hashes")
+ end
end
- return t
- else
- return nil
+ names.loaded = false
+ reloaded = true
+ io.flush()
+ names.load(true)
end
end
@@ -411,74 +861,449 @@ here is for testing purposes only (it deals with names prefixed by an
encoding name).</p>
--ldx]]--
-local function found_indeed(mapping,sorted,name)
- local mn = mapping[name]
- if mn then
- return mn[2], mn[3], mn[4]
+local function fuzzy(mapping,sorted,name,sub)
+ local condensed = gsub(name,"[^%a%d]","")
+ for k=1,#sorted do
+ local v = sorted[k]
+ if find(v,condensed) then
+ return mapping[v], v
+ end
end
- if names.be_clever then -- this will become obsolete
- local encoding, tag = match(name,"^(.-)[%-%:](.+)$")
- local mt = mapping[tag]
- if tag and fonts.enc.is_known(encoding) and mt then
- return mt[1], encoding .. "-" .. mt[3], mt[4]
+end
+
+-- we could cache a lookup .. maybe some day ... (only when auto loaded!)
+
+local function foundname(name,sub) -- sub is not used currently
+ local data = names.data
+ local mappings, sorted_mappings = data.mappings, data.sorted_mappings
+ local fallbacks, sorted_fallbacks = data.fallbacks, data.sorted_fallbacks
+ local list = filters.list
+ -- dilemma: we lookup in the order otf ttf ttc ... afm but now an otf fallback
+ -- can come after an afm match ... well, one should provide nice names anyway
+ -- and having two lists is not an option
+ for i=1,#list do
+ local l = list[i]
+ local found = mappings[l][name]
+ if found then
+ if trace_names then
+ logs.report("fonts","resolved via direct name match: '%s'",name)
+ end
+ return found
end
end
- -- name, type, file
- for k,v in next, mapping do
- if find(k,name) then
- return v[2], v[3], v[4]
+ for i=1,#list do
+ local l = list[i]
+ local found, fname = fuzzy(mappings[l],sorted_mappings[l],name,sub)
+ if found then
+ if trace_names then
+ logs.report("fonts","resolved via fuzzy name match: '%s' => '%s'",name,fname)
+ end
+ return found
end
end
- local condensed = gsub(name,"[^%a%d]","")
- local mc = mapping[condensed]
- if mc then
- return mc[2], mc[3], mc[4]
+ for i=1,#list do
+ local l = list[i]
+ local found = fallbacks[l][name]
+ if found then
+ if trace_names then
+ logs.report("fonts","resolved via direct fallback match: '%s'",name)
+ end
+ return found
+ end
end
- for k=1,#sorted do
- local v = sorted[k]
- if find(v,condensed) then
- v = mapping[v]
- return v[2], v[3], v[4]
+ for i=1,#list do
+ local l = list[i]
+ local found, fname = fuzzy(sorted_mappings[l],sorted_fallbacks[l],name,sub)
+ if found then
+ if trace_names then
+ logs.report("fonts","resolved via fuzzy fallback match: '%s' => '%s'",name,fname)
+ end
+ return found
end
end
- return nil, nil, nil
end
-local function found(name)
- if name and name ~= "" and names.data then
- name = names.cleanname(name)
- local data = names.data
- local fontname, filename, is_sub = found_indeed(data.mapping, data.sorted, name)
- if not fontname or not filename then
- fontname, filename, is_sub = found_indeed(data.fallback_mapping, data.fallback_sorted, name)
+function names.resolvedspecification(askedname,sub)
+ if askedname and askedname ~= "" and names.enabled then
+ askedname = cleanname(askedname)
+ names.load()
+ local found = foundname(askedname,sub)
+ if not found and is_reloaded() then
+ found = foundname(askedname,sub)
+ end
+ return found
+ end
+end
+
+function names.resolve(askedname,sub)
+ local found = names.resolvedspecification(askedname,sub)
+ if found then
+ return found.filename, found.subfont and found.rawname
+ end
+end
+
+-- specified search
+
+local function s_collect_weight_style_width_variant(found,done,all,weight,style,width,variant,family)
+ if family then
+ for i=1,#family do
+ local f = family[i]
+ if f and weight == f.weight and style == f.style and width == f.width and variant == f.variant then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_weight_style_width_variant(found,done,all,weight,style,width,variant,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and weight == f.weight and style == f.style and width == f.width and variant == f.variant and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_weight_style_width(found,done,all,weight,style,width,family)
+ if family then
+ for i=1,#family do
+ local f = family[i]
+ if f and weight == f.weight and style == f.style and width == f.width then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_weight_style_width(found,done,all,weight,style,width,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and weight == f.weight and style == f.style and width == f.width and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_weight_style(found,done,all,weight,style,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f and weight == f.weight and style == f.style then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_weight_style(found,done,all,weight,style,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and weight == f.weight and style == f.style and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_style_width(found,done,all,style,width,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f and style == f.style and width == f.width then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_style_width(found,done,all,style,width,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and style == f.style and width == f.width and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_weight(found,done,all,weight,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f and weight == f.weight then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_weight(found,done,all,weight,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and weight == f.weight and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_style(found,done,all,style,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f and style == f.style then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_style(found,done,all,style,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and style == f.style and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect_width(found,done,all,width,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f and width == f.width then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+local function m_collect_width(found,done,all,width,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and width == f.width and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function s_collect(found,done,all,family)
+ if family then
+ for i=1,#family do local f = family[i]
+ if f then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
end
- return fontname, filename, is_sub
+ end
+end
+local function m_collect(found,done,all,families,sorted,strictname)
+ for i=1,#sorted do
+ local k = sorted[i]
+ local family = families[k]
+ for i=1,#family do
+ local f = family[i]
+ if not done[f] and find(f.fontname,strictname) then
+ found[#found+1], done[f] = f, true
+ if not all then return end
+ end
+ end
+ end
+end
+
+local function collect(stage,found,done,name,weight,style,width,variant,all)
+ local data = names.data
+ local families, sorted = data.families, data.sorted_families
+ strictname = "^".. name -- to be checked
+ local family = families[name]
+ if trace_names then
+ logs.report("fonts","resolving name '%s', weight '%s', style '%s', width '%s', variant '%s'",
+ name or "?",tostring(weight),tostring(style),tostring(width),tostring(variant))
+ end
+ --~ print(name,table.serialize(family))
+ if weight and weight ~= "" then
+ if style and style ~= "" then
+ if width and width ~= "" then
+ if variant and variant ~= "" then
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', weight '%s', style '%s', width '%s', variant '%s'",stage,name,weight,style,width,variant)
+ end
+ s_collect_weight_style_width_variant(found,done,all,weight,style,width,variant,family)
+ m_collect_weight_style_width_variant(found,done,all,weight,style,width,variant,families,sorted,strictname)
+ else
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', weight '%s', style '%s', width '%s'",stage,name,weight,style,width)
+ end
+ s_collect_weight_style_width(found,done,all,weight,style,width,family)
+ m_collect_weight_style_width(found,done,all,weight,style,width,families,sorted,strictname)
+ end
+ else
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', weight '%s', style '%s'",stage,name,weight,style)
+ end
+ s_collect_weight_style(found,done,all,weight,style,family)
+ m_collect_weight_style(found,done,all,weight,style,families,sorted,strictname)
+ end
+ else
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', weight '%s'",stage,name,weight)
+ end
+ s_collect_weight(found,done,all,weight,family)
+ m_collect_weight(found,done,all,weight,families,sorted,strictname)
+ end
+ elseif style and style ~= "" then
+ if width and width ~= "" then
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', style '%s', width '%s'",stage,name,style,width)
+ end
+ s_collect_style_width(found,done,all,style,width,family)
+ m_collect_style_width(found,done,all,style,width,families,sorted,strictname)
+ else
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', style '%s'",stage,name,style)
+ end
+ s_collect_style(found,done,all,style,family)
+ m_collect_style(found,done,all,style,families,sorted,strictname)
+ end
+ elseif width and width ~= "" then
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s', width '%s'",stage,name,width)
+ end
+ s_collect_width(found,done,all,width,family)
+ m_collect_width(found,done,all,width,families,sorted,strictname)
else
- return nil, nil, nil
+ if trace_names then
+ logs.report("fonts","resolving stage %s, name '%s'",stage,name)
+ end
+ s_collect(found,done,all,family)
+ m_collect(found,done,all,families,sorted,strictname)
end
end
-local reloaded = false
+function heuristic(name,weight,style,width,variant,all) -- todo: fallbacks
+ local found, done = { }, { }
+--~ print(name,weight,style,width,variant)
+ weight, style, width, variant = weight or "normal", style or "normal", width or "normal", variant or "normal"
+ name = cleanname(name)
+ collect(1,found,done,name,weight,style,width,variant,all)
+ -- still needed ?
+ if #found == 0 and variant ~= "normal" then -- not weight
+ variant = "normal"
+ collect(4,found,done,name,weight,style,width,variant,all)
+ end
+ if #found == 0 and width ~= "normal" then
+ width = "normal"
+ collect(2,found,done,name,weight,style,width,variant,all)
+ end
+ if #found == 0 and weight ~= "normal" then -- not style
+ weight = "normal"
+ collect(3,found,done,name,weight,style,width,variant,all)
+ end
+ if #found == 0 and style ~= "normal" then -- not weight
+ style = "normal"
+ collect(4,found,done,name,weight,style,width,variant,all)
+ end
+ --
+ local nf = #found
+ if trace_names then
+ if nf then
+ local t = { }
+ for i=1,nf do
+ t[#t+1] = format("'%s'",found[i].fontname)
+ end
+ logs.report("fonts","name '%s' resolved to %s instances: %s",name,nf,concat(t," "))
+ else
+ logs.report("fonts","name '%s' unresolved",name)
+ end
+ end
+ if all then
+ return nf > 0 and found
+ else
+ return found[1]
+ end
+end
-function names.specification(askedname, sub)
+function names.specification(askedname,weight,style,width,variant,reload,all)
if askedname and askedname ~= "" and names.enabled then
- askedname = lower(askedname)
- names.load()
- local name, filename, is_sub = found(askedname)
- if not filename and not reloaded and names.autoreload then
- names.loaded = false
- reloaded = true
- io.flush()
- names.load(true)
- name, filename, is_sub = found(askedname)
+ askedname = lower(askedname) -- or cleanname
+ names.load(reload)
+ local found = heuristic(askedname,weight,style,width,variant,all)
+ if not found and is_reloaded() then
+ found = heuristic(askedname,weight,style,width,variant,all)
+ if not filename then
+ found = foundname(askedname) -- old method
+ end
+ end
+ return found
+ end
+end
+
+function names.collect(askedname,weight,style,width,variant,reload,all)
+ if askedname and askedname ~= "" and names.enabled then
+ askedname = lower(askedname) -- or cleanname
+ names.load(reload)
+ local list = heuristic(askedname,weight,style,width,variant,true)
+ if not list or #list == 0 and is_reloaded() then
+ list = heuristic(askedname,weight,style,width,variant,true)
end
- return name, filename, is_sub
+ return list
end
end
-function names.resolve(askedname, sub)
- local name, filename, is_sub = names.specification(askedname, sub)
- return filename, (is_sub and name) or sub
+function names.collectspec(askedname,reload,all)
+ local name, weight, style, width, variant = names.splitspec(askedname)
+ return names.collect(name,weight,style,width,variant,reload,all)
+end
+
+function names.resolvespec(askedname,sub)
+ local found = names.specification(names.splitspec(askedname))
+ if found then
+ return found.filename, found.subfont and found.rawname
+ end
+end
+
+function names.collectfiles(askedname,reload) -- no all
+ if askedname and askedname ~= "" and names.enabled then
+ askedname = lower(askedname) -- or cleanname
+ names.load(reload)
+ local list = { }
+ local basename = file.basename
+ local specifications = names.data.specifications
+ for i=1,#specifications do
+ local s = specifications[i]
+ if find(lower(basename(s.filename)),askedname) then
+ list[#list+1] = s
+ end
+ end
+ return list
+ end
end
--[[ldx--
@@ -530,16 +1355,100 @@ names.new_to_old = {
names.old_to_new = table.swapped(names.new_to_old)
function names.exists(name)
- local fna, found = names.autoreload, false
- names.autoreload = false
- for k,v in ipairs(filters.list) do
+ local found = false
+ local list = filters.list
+ for k=1,#list do
+ local v = list[k]
found = (resolvers.find_file(name,v) or "") ~= ""
if found then
- break
+ return found
+ end
+ end
+ return ((resolvers.find_file(name,"tfm") or "") ~= "") or ((names.resolve(name) or "") ~= "")
+end
+
+-- for i=1,fonts.names.lookup(pattern) do
+-- texio.write_nl(fonts.names.getkey("filename",i))
+-- end
+
+local lastlookups, lastpattern = { }, ""
+
+function names.lookup(pattern,name,reload) -- todo: find
+ if lastpattern ~= pattern then
+ names.load(reload)
+ local specifications = names.data.specifications
+ local families = names.data.families
+ local lookups = specifications
+ if name then
+ lookups = families[name]
+ elseif not find(pattern,"=") then
+ lookups = families[pattern]
+ end
+ if trace_names then
+ logs.report("fonts","starting with %s lookups for '%s'",#lookups,pattern)
+ end
+ if lookups then
+ for key, value in gmatch(pattern,"([^=,]+)=([^=,]+)") do
+ local t = { }
+ for i=1,#lookups do
+ local s = lookups[i]
+ if s[key] == value then
+ t[#t+1] = lookups[i]
+ end
+ end
+ if trace_names then
+ logs.report("fonts","%s matches for key '%s' with value '%s'",#t,key,value)
+ end
+ lookups = t
+ end
end
+ lastpattern = pattern
+ lastlookups = lookups or { }
+ end
+ return #lastlookups
+end
+
+function names.getlookupkey(key,n)
+ local l = lastlookups[n or 1]
+ return (l and l[key]) or ""
+end
+
+function names.noflookups()
+ return #lastlookups
+end
+
+function names.getlookups(pattern,name,reload)
+ if pattern then
+ names.lookup(pattern,name,reload)
end
- found = found or (resolvers.find_file(name,"tfm") or "") ~= ""
- found = found or (names.resolve(name) or "") ~= ""
- names.autoreload = fna
- return found
+ return lastlookups
+end
+
+function table.formatcolumns(result)
+ if result and #result > 0 then
+ local widths = { }
+ local first = result[1]
+ local n = #first
+ for i=1,n do
+ widths[i] = 0
+ end
+ for i=1,#result do
+ local r = result[i]
+ for j=1,n do
+ local w = #r[j]
+ if w > widths[j] then
+ widths[j] = w
+ end
+ end
+ end
+ for i=1,n do
+ widths[i] = "%-" .. widths[i] .. "s"
+ end
+ local template = concat(widths," ")
+ for i=1,#result do
+ local str = format(template,unpack(result[i]))
+ result[i] = string.strip(str)
+ end
+ end
+ return result
end
diff --git a/Master/texmf-dist/tex/context/base/font-tfm.lua b/Master/texmf-dist/tex/context/base/font-tfm.lua
index b2015723e36..31ae2cae1c2 100644
--- a/Master/texmf-dist/tex/context/base/font-tfm.lua
+++ b/Master/texmf-dist/tex/context/base/font-tfm.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-tfm'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -36,6 +36,7 @@ fonts.initializers = fonts.initializers or { }
fonts.initializers.common = fonts.initializers.common or { }
local fontdata = fonts.ids
+local disc = node.id('disc')
local glyph = node.id('glyph')
local set_attribute = node.set_attribute
@@ -47,33 +48,9 @@ supplied by <l n='luatex'/>.</p>
tfm.resolve_vf = true -- false
tfm.share_base_kerns = false -- true (.5 sec slower on mk but brings down mem from 410M to 310M, beware: then script/lang share too)
tfm.mathactions = { }
+tfm.fontname_mode = "fullpath"
-function tfm.enhance(tfmdata,specification)
- local name, size = specification.name, specification.size
- local encoding, filename = match(name,"^(.-)%-(.*)$") -- context: encoding-name.*
- if filename and encoding and fonts.enc.known[encoding] then
- local data = fonts.enc.load(encoding)
- if data then
- local characters = tfmdata.characters
- tfmdata.encoding = encoding
- local vector = data.vector
- local original = { }
- for k, v in next, characters do
- v.name = vector[k]
- v.index = k
- original[k] = v
- end
- for k,v in next, data.unicodes do
- if k ~= v then
- if trace_defining then
- logs.report("define font","mapping %s onto %s",k,v)
- end
- characters[k] = original[v]
- end
- end
- end
- end
-end
+tfm.enhance = tfm.enhance or function() end
function tfm.read_from_tfm(specification)
local fname, tfmdata = specification.filename or "", nil
@@ -186,36 +163,36 @@ fonts.trace_scaling = false
-- basekerns are scaled and will be hashed by table id
-- sharedkerns are unscaled and are be hashed by concatenated indexes
-function tfm.check_base_kerns(tfmdata)
- if tfm.share_base_kerns then
- local sharedkerns = tfmdata.sharedkerns
- if sharedkerns then
- local basekerns = { }
- tfmdata.basekerns = basekerns
- return sharedkerns, basekerns
- end
- end
- return nil, nil
-end
+--~ function tfm.check_base_kerns(tfmdata)
+--~ if tfm.share_base_kerns then
+--~ local sharedkerns = tfmdata.sharedkerns
+--~ if sharedkerns then
+--~ local basekerns = { }
+--~ tfmdata.basekerns = basekerns
+--~ return sharedkerns, basekerns
+--~ end
+--~ end
+--~ return nil, nil
+--~ end
-function tfm.prepare_base_kerns(tfmdata)
- if tfm.share_base_kerns and not tfmdata.sharedkerns then
- local sharedkerns = { }
- tfmdata.sharedkerns = sharedkerns
- for u, chr in next, tfmdata.characters do
- local kerns = chr.kerns
- if kerns then
- local hash = concat(sortedkeys(kerns), " ")
- local base = sharedkerns[hash]
- if not base then
- sharedkerns[hash] = kerns
- else
- chr.kerns = base
- end
- end
- end
- end
-end
+--~ function tfm.prepare_base_kerns(tfmdata)
+--~ if tfm.share_base_kerns and not tfmdata.sharedkerns then
+--~ local sharedkerns = { }
+--~ tfmdata.sharedkerns = sharedkerns
+--~ for u, chr in next, tfmdata.characters do
+--~ local kerns = chr.kerns
+--~ if kerns then
+--~ local hash = concat(sortedkeys(kerns), " ")
+--~ local base = sharedkerns[hash]
+--~ if not base then
+--~ sharedkerns[hash] = kerns
+--~ else
+--~ chr.kerns = base
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
-- we can have cache scaled characters when we are in node mode and don't have
-- protruding and expansion: hash == fullname @ size @ protruding @ expansion
@@ -228,13 +205,21 @@ local charactercache = { }
-- a virtual font has italic correction make sure to set the
-- has_italic flag. Some more flags will be added in the future.
-function tfm.do_scale(tfmtable, scaledpoints)
- tfm.prepare_base_kerns(tfmtable) -- optimalization
+function tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
if scaledpoints < 0 then
scaledpoints = (- scaledpoints/1000) * tfmtable.designsize -- already in sp
end
- local delta = scaledpoints/(tfmtable.units or 1000) -- brr, some open type fonts have 2048
- local t = { }
+ local units = tfmtable.units or 1000
+ local delta = scaledpoints/units -- brr, some open type fonts have 2048
+ return scaledpoints, delta, units
+end
+
+function tfm.do_scale(tfmtable, scaledpoints, relativeid)
+ -- tfm.prepare_base_kerns(tfmtable) -- optimalization
+ local t = { } -- the new table
+ local scaledpoints, delta, units = tfm.calculate_scale(tfmtable, scaledpoints, relativeid)
+ t.units_per_em = units or 1000
+ local hdelta, vdelta = delta, delta
-- unicoded unique descriptions shared cidinfo characters changed parameters indices
for k,v in next, tfmtable do
if type(v) == "table" then
@@ -243,6 +228,19 @@ function tfm.do_scale(tfmtable, scaledpoints)
t[k] = v
end
end
+ local extend_factor = tfmtable.extend_factor or 0
+ if extend_factor ~= 0 and extend_factor ~= 1 then
+ hdelta = hdelta * extend_factor
+ t.extend = extend_factor * 1000
+ else
+ t.extend = 1000
+ end
+ local slant_factor = tfmtable.slant_factor or 0
+ if slant_factor ~= 0 then
+ t.slant = slant_factor * 1000
+ else
+ t.slant = 0
+ end
-- status
local isvirtual = tfmtable.type == "virtual" or tfmtable.virtualized
local hasmath = (tfmtable.math_parameters ~= nil and next(tfmtable.math_parameters) ~= nil) or (tfmtable.MathConstants ~= nil and next(tfmtable.MathConstants) ~= nil)
@@ -258,6 +256,9 @@ function tfm.do_scale(tfmtable, scaledpoints)
t.unicodes = tfmtable.unicodes
t.indices = tfmtable.indices
t.marks = tfmtable.marks
+t.goodies = tfmtable.goodies
+t.colorscheme = tfmtable.colorscheme
+--~ t.embedding = tfmtable.embedding
t.descriptions = descriptions
if tfmtable.fonts then
t.fonts = table.fastcopy(tfmtable.fonts) -- hm also at the end
@@ -267,18 +268,18 @@ function tfm.do_scale(tfmtable, scaledpoints)
local tfmp = tfmtable.parameters -- let's check for indexes
--
tp.slant = (tfmp.slant or tfmp[1] or 0)
- tp.space = (tfmp.space or tfmp[2] or 0)*delta
- tp.space_stretch = (tfmp.space_stretch or tfmp[3] or 0)*delta
- tp.space_shrink = (tfmp.space_shrink or tfmp[4] or 0)*delta
- tp.x_height = (tfmp.x_height or tfmp[5] or 0)*delta
- tp.quad = (tfmp.quad or tfmp[6] or 0)*delta
- tp.extra_space = (tfmp.extra_space or tfmp[7] or 0)*delta
+ tp.space = (tfmp.space or tfmp[2] or 0)*hdelta
+ tp.space_stretch = (tfmp.space_stretch or tfmp[3] or 0)*hdelta
+ tp.space_shrink = (tfmp.space_shrink or tfmp[4] or 0)*hdelta
+ tp.x_height = (tfmp.x_height or tfmp[5] or 0)*vdelta
+ tp.quad = (tfmp.quad or tfmp[6] or 0)*hdelta
+ tp.extra_space = (tfmp.extra_space or tfmp[7] or 0)*hdelta
local protrusionfactor = (tp.quad ~= 0 and 1000/tp.quad) or 0
local tc = t.characters
local characters = tfmtable.characters
local nameneeded = not tfmtable.shared.otfdata --hack
local changed = tfmtable.changed or { } -- for base mode
- local ischanged = not table.is_empty(changed)
+ local ischanged = changed and next(changed)
local indices = tfmtable.indices
local luatex = tfmtable.luatex
local tounicode = luatex and luatex.tounicode
@@ -286,14 +287,15 @@ function tfm.do_scale(tfmtable, scaledpoints)
local defaultheight = luatex and luatex.defaultheight or 0
local defaultdepth = luatex and luatex.defaultdepth or 0
-- experimental, sharing kerns (unscaled and scaled) saves memory
- local sharedkerns, basekerns = tfm.check_base_kerns(tfmtable)
+ -- local sharedkerns, basekerns = tfm.check_base_kerns(tfmtable)
-- loop over descriptions (afm and otf have descriptions, tfm not)
-- there is no need (yet) to assign a value to chr.tonunicode
- local scaledwidth = defaultwidth * delta
- local scaledheight = defaultheight * delta
- local scaleddepth = defaultdepth * delta
+ local scaledwidth = defaultwidth * hdelta
+ local scaledheight = defaultheight * vdelta
+ local scaleddepth = defaultdepth * vdelta
local stackmath = tfmtable.ignore_stack_math ~= true
-local private = fonts.private
+ local private = fonts.private
+ local sharedkerns = { }
for k,v in next, characters do
local chr, description, index
if ischanged then
@@ -314,9 +316,9 @@ local private = fonts.private
local width = description.width
local height = description.height
local depth = description.depth
- if width then width = delta*width else width = scaledwidth end
- if height then height = delta*height else height = scaledheight end
- -- if depth then depth = delta*depth else depth = scaleddepth end
+ if width then width = hdelta*width else width = scaledwidth end
+ if height then height = vdelta*height else height = scaledheight end
+ -- if depth then depth = vdelta*depth else depth = scaleddepth end
if depth and depth ~= 0 then
depth = delta*depth
if nameneeded then
@@ -362,6 +364,7 @@ local private = fonts.private
end
end
if hasquality then
+ -- we could move these calculations elsewhere (saves calculations)
local ve = v.expansion_factor
if ve then
chr.expansion_factor = ve*1000 -- expansionfactor, hm, can happen elsewhere
@@ -379,7 +382,7 @@ local private = fonts.private
if hasitalic then
local vi = description.italic or v.italic
if vi and vi ~= 0 then
- chr.italic = vi*delta
+ chr.italic = vi*hdelta
end
end
-- to be tested
@@ -395,14 +398,19 @@ local private = fonts.private
for i=1,#vv do
local vvi = vv[i]
t[i] = {
- ["start"] = (vvi["start"] or 0)*delta,
- ["end"] = (vvi["end"] or 0)*delta,
- ["advance"] = (vvi["advance"] or 0)*delta,
+ ["start"] = (vvi["start"] or 0)*vdelta,
+ ["end"] = (vvi["end"] or 0)*vdelta,
+ ["advance"] = (vvi["advance"] or 0)*vdelta,
["extender"] = vvi["extender"],
["glyph"] = vvi["glyph"],
}
end
chr.vert_variants = t
+ --~ local ic = v.vert_italic_correction
+ --~ if ic then
+ --~ chr.italic = ic * hdelta
+ --~ print(format("0x%05X -> %s",k,chr.italic))
+ --~ end
else
local hv = v.horiz_variants
if hv then
@@ -410,9 +418,9 @@ local private = fonts.private
for i=1,#hv do
local hvi = hv[i]
t[i] = {
- ["start"] = (hvi["start"] or 0)*delta,
- ["end"] = (hvi["end"] or 0)*delta,
- ["advance"] = (hvi["advance"] or 0)*delta,
+ ["start"] = (hvi["start"] or 0)*hdelta,
+ ["end"] = (hvi["end"] or 0)*hdelta,
+ ["advance"] = (hvi["advance"] or 0)*hdelta,
["extender"] = hvi["extender"],
["glyph"] = hvi["glyph"],
}
@@ -423,31 +431,23 @@ local private = fonts.private
end
local vt = description.top_accent
if vt then
- chr.top_accent = delta*vt
+ chr.top_accent = vdelta*vt
end
if stackmath then
local mk = v.mathkerns
if mk then
local kerns = { }
- -- for k, v in next, mk do
- -- local kk = { }
- -- for i=1,#v do
- -- local vi = v[i]
- -- kk[i] = { height = delta*vi.height, kern = delta*vi.kern }
- -- end
- -- kerns[k] = kk
- -- end
local v = mk.top_right if v then local k = { } for i=1,#v do local vi = v[i]
- k[i] = { height = delta*vi.height, kern = delta*vi.kern }
+ k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern }
end kerns.top_right = k end
local v = mk.top_left if v then local k = { } for i=1,#v do local vi = v[i]
- k[i] = { height = delta*vi.height, kern = delta*vi.kern }
+ k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern }
end kerns.top_left = k end
local v = mk.bottom_left if v then local k = { } for i=1,#v do local vi = v[i]
- k[i] = { height = delta*vi.height, kern = delta*vi.kern }
+ k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern }
end kerns.bottom_left = k end
local v = mk.bottom_right if v then local k = { } for i=1,#v do local vi = v[i]
- k[i] = { height = delta*vi.height, kern = delta*vi.kern }
+ k[i] = { height = vdelta*vi.height, kern = vdelta*vi.kern }
end kerns.bottom_right = k end
chr.mathkern = kerns -- singular
end
@@ -456,19 +456,26 @@ local private = fonts.private
if not nodemode then
local vk = v.kerns
if vk then
- if sharedkerns then
- local base = basekerns[vk] -- hashed by table id, not content
- if not base then
- base = {}
- for k,v in next, vk do base[k] = v*delta end
- basekerns[vk] = base
- end
- chr.kerns = base
- else
- local tt = {}
- for k,v in next, vk do tt[k] = v*delta end
- chr.kerns = tt
+ --~ if sharedkerns then
+ --~ local base = basekerns[vk] -- hashed by table id, not content
+ --~ if not base then
+ --~ base = {}
+ --~ for k,v in next, vk do base[k] = v*hdelta end
+ --~ basekerns[vk] = base
+ --~ end
+ --~ chr.kerns = base
+ --~ else
+ --~ local tt = {}
+ --~ for k,v in next, vk do tt[k] = v*hdelta end
+ --~ chr.kerns = tt
+ --~ end
+ local s = sharedkerns[vk]
+ if not s then
+ s = { }
+ for k,v in next, vk do s[k] = v*hdelta end
+ sharedkerns[vk] = s
end
+ chr.kerns = s
end
local vl = v.ligatures
if vl then
@@ -487,6 +494,8 @@ local private = fonts.private
local vc = v.commands
if vc then
-- we assume non scaled commands here
+ -- tricky .. we need to scale pseudo math glyphs too
+ -- which is why we deal with rules too
local ok = false
for i=1,#vc do
local key = vc[i][1]
@@ -500,8 +509,12 @@ local private = fonts.private
for i=1,#vc do
local ivc = vc[i]
local key = ivc[1]
- if key == "right" or key == "down" then
- tt[#tt+1] = { key, ivc[2]*delta }
+ if key == "right" then
+ tt[#tt+1] = { key, ivc[2]*hdelta }
+ elseif key == "down" then
+ tt[#tt+1] = { key, ivc[2]*vdelta }
+ elseif key == "rule" then
+ tt[#tt+1] = { key, ivc[2]*vdelta, ivc[3]*hdelta }
else -- not comment
tt[#tt+1] = ivc -- shared since in cache and untouched
end
@@ -517,6 +530,8 @@ local private = fonts.private
-- t.encodingbytes, t.filename, t.fullname, t.name: elsewhere
t.size = scaledpoints
t.factor = delta
+ t.hfactor = hdelta
+ t.vfactor = vdelta
if t.fonts then
t.fonts = table.fastcopy(t.fonts) -- maybe we virtualize more afterwards
end
@@ -524,20 +539,20 @@ local private = fonts.private
-- mathematics.extras.copy(t) -- can be done elsewhere if needed
local ma = tfm.mathactions
for i=1,#ma do
- ma[i](t,tfmtable,delta)
+ ma[i](t,tfmtable,delta,hdelta,vdelta) -- what delta?
end
end
-- needed for \high cum suis
local tpx = tp.x_height
-if hasmath then
- if not tp[13] then tp[13] = .86*tpx end -- mathsupdisplay
- if not tp[14] then tp[14] = .86*tpx end -- mathsupnormal
- if not tp[15] then tp[15] = .86*tpx end -- mathsupcramped
- if not tp[16] then tp[16] = .48*tpx end -- mathsubnormal
- if not tp[17] then tp[17] = .48*tpx end -- mathsubcombined
- if not tp[22] then tp[22] = 0 end -- mathaxisheight
- if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard
-end
+ if hasmath then
+ if not tp[13] then tp[13] = .86*tpx end -- mathsupdisplay
+ if not tp[14] then tp[14] = .86*tpx end -- mathsupnormal
+ if not tp[15] then tp[15] = .86*tpx end -- mathsupcramped
+ if not tp[16] then tp[16] = .48*tpx end -- mathsubnormal
+ if not tp[17] then tp[17] = .48*tpx end -- mathsubcombined
+ if not tp[22] then tp[22] = 0 end -- mathaxisheight
+ if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard
+ end
t.tounicode = 1
t.cidinfo = tfmtable.cidinfo
-- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename
@@ -545,18 +560,23 @@ end
-- can have multiple subfonts
if hasmath then
if trace_defining then
- logs.report("define font","math enabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename")
+ logs.report("define font","math enabled for: name '%s', fullname: '%s', filename: '%s'",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename")
end
else
if trace_defining then
- logs.report("define font","math disabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename")
+ logs.report("define font","math disabled for: name '%s', fullname: '%s', filename: '%s'",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename")
end
t.nomath, t.MathConstants = true, nil
end
- -- fullname is used in the subsetting
if not t.psname then
- t.psname = t.fullname -- else bad luck
+ -- name used in pdf file as well as for selecting subfont in ttc/dfont
+ t.psname = t.fontname or (t.fullname and fonts.names.cleanname(t.fullname))
+ end
+ if trace_defining then
+ logs.report("define font","used for accesing subfont: '%s'",t.psname or "nopsname")
+ logs.report("define font","used for subsetting: '%s'",t.fontname or "nofontname")
end
+--~ print(t.fontname,table.serialize(t.MathConstants))
return t, delta
end
@@ -576,21 +596,19 @@ local lastfont = nil
--
-- flushing the kern and ligature tables from memory saves a lot (only
-- base mode) but it complicates vf building where the new characters
--- demand this data
-
---~ for id, f in pairs(fonts.ids) do -- or font.fonts
---~ local ffi = font.fonts[id]
---~ f.characters = ffi.characters
---~ f.kerns = ffi.kerns
---~ f.ligatures = ffi.ligatures
---~ end
+-- demand this data .. solution: functions that access them
function tfm.cleanup_table(tfmdata) -- we need a cleanup callback, now we miss the last one
if tfm.auto_cleanup then -- ok, we can hook this into everyshipout or so ... todo
if tfmdata.type == 'virtual' or tfmdata.virtualized then
for k, v in next, tfmdata.characters do
- if v.commands then v.commands = nil end
+ if v.commands then v.commands = nil end
+ -- if v.kerns then v.kerns = nil end
end
+ else
+ -- for k, v in next, tfmdata.characters do
+ -- if v.kerns then v.kerns = nil end
+ -- end
end
end
end
@@ -598,8 +616,8 @@ end
function tfm.cleanup(tfmdata) -- we need a cleanup callback, now we miss the last one
end
-function tfm.scale(tfmtable, scaledpoints)
- local t, factor = tfm.do_scale(tfmtable, scaledpoints)
+function tfm.scale(tfmtable, scaledpoints, relativeid)
+ local t, factor = tfm.do_scale(tfmtable, scaledpoints, relativeid)
t.factor = factor
t.ascender = factor*(tfmtable.ascender or 0)
t.descender = factor*(tfmtable.descender or 0)
@@ -633,7 +651,8 @@ function fonts.analyzers.aux.setstate(head,font)
local descriptions = tfmdata.descriptions
local first, last, current, n, done = nil, nil, head, 0, false -- maybe make n boolean
while current do
- if current.id == glyph and current.font == font then
+ local id = current.id
+ if id == glyph and current.font == font then
local d = descriptions[current.char]
if d then
if d.class == "mark" then
@@ -654,6 +673,10 @@ function fonts.analyzers.aux.setstate(head,font)
end
first, last, n = nil, nil, 0
end
+ elseif id == disc then
+ -- always in the middle
+ set_attribute(current,state,2) -- midi
+ last = current
else -- finish
if first and first == last then
set_attribute(last,state,4) -- isol
@@ -681,155 +704,33 @@ function tfm.replacements(tfm,value)
-- tfm.characters[0x0060] = tfm.characters[0x2018]
end
--- auto complete font with missing composed characters
-
-table.insert(fonts.manipulators,"compose")
-
-function fonts.initializers.common.compose(tfmdata,value)
- if value then
- fonts.vf.aux.compose_characters(tfmdata)
- end
-end
-
--- tfm features, experimental
-
-tfm.features = tfm.features or { }
-tfm.features.list = tfm.features.list or { }
-tfm.features.default = tfm.features.default or { }
-
-function tfm.enhance(tfmdata,specification)
- -- we don't really share tfm data because we always reload
- -- but this is more in sycn with afm and such
- local features = (specification.features and specification.features.normal ) or { }
- tfmdata.shared = tfmdata.shared or { }
- tfmdata.shared.features = features
- -- tfmdata.shared.tfmdata = tfmdata -- circular
- tfmdata.filename = specification.name
- if not features.encoding then
- local name, size = specification.name, specification.size
- local encoding, filename = match(name,"^(.-)%-(.*)$") -- context: encoding-name.*
- if filename and encoding and fonts.enc.known[encoding] then
- features.encoding = encoding
- end
- end
- tfm.set_features(tfmdata)
-end
-
-function tfm.set_features(tfmdata)
- -- todo: no local functions
- local shared = tfmdata.shared
--- local tfmdata = shared.tfmdata
- local features = shared.features
- if not table.is_empty(features) then
- local mode = tfmdata.mode or fonts.mode
- local fi = fonts.initializers[mode]
- if fi and fi.tfm then
- local function initialize(list) -- using tex lig and kerning
- if list then
- for i=1,#list do
- local f = list[i]
- local value = features[f]
- if value and fi.tfm[f] then -- brr
- if tfm.trace_features then
- logs.report("define font","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown')
- end
- fi.tfm[f](tfmdata,value)
- mode = tfmdata.mode or fonts.mode
- fi = fonts.initializers[mode]
- end
- end
- end
- end
- initialize(fonts.triggers)
- initialize(tfm.features.list)
- initialize(fonts.manipulators)
- end
- local fm = fonts.methods[mode]
- if fm and fm.tfm then
- local function register(list) -- node manipulations
- if list then
- for i=1,#list do
- local f = list[i]
- if features[f] and fm.tfm[f] then -- brr
- if not shared.processors then -- maybe also predefine
- shared.processors = { fm.tfm[f] }
- else
- shared.processors[#shared.processors+1] = fm.tfm[f]
- end
- end
- end
- end
- end
- register(tfm.features.list)
- end
- end
-end
-
-function tfm.features.register(name,default)
- tfm.features.list[#tfm.features.list+1] = name
- tfm.features.default[name] = default
-end
-
-function tfm.reencode(tfmdata,encoding)
- if encoding and fonts.enc.known[encoding] then
- local data = fonts.enc.load(encoding)
- if data then
- local characters, original, vector = tfmdata.characters, { }, data.vector
- tfmdata.encoding = encoding -- not needed
- for k, v in next, characters do
- v.name, v.index, original[k] = vector[k], k, v
- end
- for k,v in next, data.unicodes do
- if k ~= v then
- if trace_defining then
- logs.report("define font","reencoding U+%04X to U+%04X",k,v)
- end
- characters[k] = original[v]
- end
- end
- end
- end
-end
-
-tfm.features.register('reencode')
-
-fonts.initializers.base.tfm.reencode = tfm.reencode
-fonts.initializers.node.tfm.reencode = tfm.reencode
-
-fonts.enc = fonts.enc or { }
-fonts.enc.remappings = fonts.enc.remappings or { }
-
-function tfm.remap(tfmdata,remapping)
- local vector = remapping and fonts.enc.remappings[remapping]
- if vector then
- local characters, original = tfmdata.characters, { }
- for k, v in next, characters do
- original[k], characters[k] = v, nil
- end
- for k,v in next, vector do
- if k ~= v then
- if trace_defining then
- logs.report("define font","remapping U+%04X to U+%04X",k,v)
+-- checking
+
+function tfm.checked_filename(metadata,whatever)
+ local foundfilename = metadata.foundfilename
+ if not foundfilename then
+ local askedfilename = metadata.filename or ""
+ if askedfilename ~= "" then
+ foundfilename = resolvers.findbinfile(askedfilename,"") or ""
+ if foundfilename == "" then
+ logs.report("fonts","source file '%s' is not found",askedfilename)
+ foundfilename = resolvers.findbinfile(file.basename(askedfilename),"") or ""
+ if foundfilename ~= "" then
+ logs.report("fonts","using source file '%s' (cache mismatch)",foundfilename)
end
- local c = original[k]
- characters[v] = c
- c.index = k
end
+ elseif whatever then
+ logs.report("fonts","no source file for '%s'",whatever)
+ foundfilename = ""
end
- tfmdata.encodingbytes = 2
- tfmdata.format = 'type1'
+ metadata.foundfilename = foundfilename
+ -- logs.report("fonts","using source file '%s'",foundfilename)
end
+ return foundfilename
end
-tfm.features.register('remap')
-
-fonts.initializers.base.tfm.remap = tfm.remap
-fonts.initializers.node.tfm.remap = tfm.remap
-
-- status info
statistics.register("fonts load time", function()
- if statistics.elapsedindeed(fonts) then
- return format("%s seconds",statistics.elapsedtime(fonts))
- end
+ return statistics.elapsedseconds(fonts)
end)
diff --git a/Master/texmf-dist/tex/context/base/font-tra.mkiv b/Master/texmf-dist/tex/context/base/font-tra.mkiv
index c45e1394d83..e47c8c49d48 100644
--- a/Master/texmf-dist/tex/context/base/font-tra.mkiv
+++ b/Master/texmf-dist/tex/context/base/font-tra.mkiv
@@ -27,8 +27,8 @@
\newbox\otfcollector
-\def\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}}
-\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}}
+\unexpanded\def\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}}
+\unexpanded\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}}
\def\resetotfcollecting{\ctxlua{nodes.tracers.steppers.reset()}}
% Rather experimental:
@@ -88,12 +88,12 @@
\stoplinecorrection
\blank}}
-\def\startotfsample
+\unexpanded\def\startotfsample
{\enabletrackers[*otf.sample]% beware, kind of global
\startotfcollecting
\begingroup}
-\def\stopotfsample
+\unexpanded\def\stopotfsample
{\endgroup
\stopotfcollecting
\disabletrackers[*otf.sample]% beware, kind of global: otf.sample
diff --git a/Master/texmf-dist/tex/context/base/font-vf.lua b/Master/texmf-dist/tex/context/base/font-vf.lua
index c103555a3be..4f99c47b94b 100644
--- a/Master/texmf-dist/tex/context/base/font-vf.lua
+++ b/Master/texmf-dist/tex/context/base/font-vf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-vf'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/font-xtx.lua b/Master/texmf-dist/tex/context/base/font-xtx.lua
index 7b3f1ec8196..eac75dd2901 100644
--- a/Master/texmf-dist/tex/context/base/font-xtx.lua
+++ b/Master/texmf-dist/tex/context/base/font-xtx.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['font-xtx'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['font-xtx'] = {
local texsprint, count = tex.sprint, tex.count
local format, concat, gmatch, match, find, lower = string.format, table.concat, string.gmatch, string.match, string.find, string.lower
local tostring, next = tostring, next
+local lpegmatch = lpeg.match
local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
@@ -71,12 +72,15 @@ local function istrue (s) list[s] = 'yes' end
local function isfalse(s) list[s] = 'no' end
local function iskey (k,v) list[k] = v end
+local function istrue (s) list[s] = true end
+local function isfalse(s) list[s] = false end
+
local spaces = lpeg.P(" ")^0
local namespec = (1-lpeg.S("/:("))^0 -- was: (1-lpeg.S("/: ("))^0
local crapspec = spaces * lpeg.P("/") * (((1-lpeg.P(":"))^0)/iscrap) * spaces
local filename = (lpeg.P("file:")/isfile * (namespec/thename)) + (lpeg.P("[") * lpeg.P(true)/isname * (((1-lpeg.P("]"))^0)/thename) * lpeg.P("]"))
local fontname = (lpeg.P("name:")/isname * (namespec/thename)) + lpeg.P(true)/issome * (namespec/thename)
-local sometext = (lpeg.R("az") + lpeg.R("AZ") + lpeg.R("09"))^1
+local sometext = (lpeg.R("az","AZ","09") + lpeg.S("+-."))^1
local truevalue = lpeg.P("+") * spaces * (sometext/istrue)
local falsevalue = lpeg.P("-") * spaces * (sometext/isfalse)
local keyvalue = (lpeg.C(sometext) * spaces * lpeg.P("=") * spaces * lpeg.C(sometext))/iskey
@@ -86,15 +90,17 @@ local option = spaces * (keyvalue + falsevalue + truevalue + somevalue) * sp
local options = lpeg.P(":") * spaces * (lpeg.P(";")^0 * option)^0
local pattern = (filename + fontname) * subvalue^0 * crapspec^0 * options^0
+local normalize_meanings = fonts.otf.meanings.normalize
+
function fonts.define.specify.colonized(specification) -- xetex mode
list = { }
- pattern:match(specification.specification)
- for k, v in next, list do
- list[k] = v:is_boolean()
- if type(list[a]) == "nil" then
- list[k] = v
- end
- end
+ lpegmatch(pattern,specification.specification)
+--~ for k, v in next, list do
+--~ list[k] = v:is_boolean()
+--~ if type(list[a]) == "nil" then
+--~ list[k] = v
+--~ end
+--~ end
list.crap = nil -- style not supported, maybe some day
if list.name then
specification.name = list.name
@@ -108,7 +114,8 @@ function fonts.define.specify.colonized(specification) -- xetex mode
specification.sub = list.sub
list.sub = nil
end
- specification.features.normal = list
+-- specification.features.normal = list
+ specification.features.normal = normalize_meanings(list)
return specification
end
diff --git a/Master/texmf-dist/tex/context/base/font-xtx.mkii b/Master/texmf-dist/tex/context/base/font-xtx.mkii
index 5f4b85879af..d6086b44e64 100644
--- a/Master/texmf-dist/tex/context/base/font-xtx.mkii
+++ b/Master/texmf-dist/tex/context/base/font-xtx.mkii
@@ -98,11 +98,14 @@
\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
- {\edef\checkedfontfeatures
+ {\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
@@ -121,33 +124,49 @@
\processcommacommand[\checkedfontfeatures]\doconvertfontfeatures % raw
\ifx\convertedfontfeatures\empty
\let\checkedfontfeatures\empty
- \else
+ \else\ifconditional\enabledfontfeatures
\edef\checkedfontfeatures{:\convertedfontfeatures}%
- \fi
+ \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
+ \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\convertedfontfeatures
- {\convertedfontfeatures
- \ifx\!!stringb\v!yes
- +\!!stringa
- \else\ifx\!!stringb\v!no
- -\!!stringa
- \else
- \!!stringa=\!!stringb
- \fi\fi;}%
+ \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%
diff --git a/Master/texmf-dist/tex/context/base/grph-fig.mkiv b/Master/texmf-dist/tex/context/base/grph-fig.mkiv
index 415a2aa7623..e10dc0a32c6 100644
--- a/Master/texmf-dist/tex/context/base/grph-fig.mkiv
+++ b/Master/texmf-dist/tex/context/base/grph-fig.mkiv
@@ -15,7 +15,7 @@
\unprotect
-\def\setupexternalfigures
+\unexpanded\def\setupexternalfigures
{\dosingleempty\dosetupexternalfigures}
\def\dosetupexternalfigures[#1]%
@@ -87,7 +87,7 @@
%
% \defineexternalfigure[name][settings]
-\def\defineexternalfigure
+\unexpanded\def\defineexternalfigure
{\dodoubleargument\dodefineexternalfigure}
\def\dodefineexternalfigure[#1][#2]%
@@ -130,19 +130,99 @@
\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\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]}}}}
+ {\dodouseexternalfigure{#2}{#2}{#3}{#4}}
+ {\dodouseexternalfigure{#2}{#2}{}{#4}}}}
{\doifelsenothing{#2}
{\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][][#3]}}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][#3][#4]}}}
+ {\dodouseexternalfigure{#1}{#1}{}{#3}}
+ {\dodouseexternalfigure{#1}{#1}{#3}{#4}}}
{\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][][#3]}}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][#3][#4]}}}}}
+ {\dodouseexternalfigure{#1}{#2}{}{#3}}
+ {\dodouseexternalfigure{#1}{#2}{#3}{#4}}}}}
+
+\def\dodouseexternalfigure#1#2#3#4%
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][#3][#4]}%
+ \doanalyseexternalfigurecollection[#2][#4]}
+
+\newconditional\inexternalfigurecollection
+\newdimen\xexternalfigurecollectionminwidth
+\newdimen\xexternalfigurecollectionmaxwidth
+\newdimen\xexternalfigurecollectionminheight
+\newdimen\xexternalfigurecollectionmaxheight
+
+\def\doanalyseexternalfigurecollection[#1][#2]%
+ {\ifconditional\inexternalfigurecollection
+ \setfalse\inexternalfigurecollection
+ \getfiguredimensions[#1][#2]%
+ \settrue\inexternalfigurecollection
+ \scratchdimen\naturalfigurewidth
+ \ifdim\scratchdimen>\xexternalfigurecollectionmaxwidth \xexternalfigurecollectionmaxwidth \scratchdimen \fi
+ \ifdim\scratchdimen<\xexternalfigurecollectionminwidth \xexternalfigurecollectionminwidth \scratchdimen \fi
+ \scratchdimen\naturalfigureheight
+ \ifdim\scratchdimen>\xexternalfigurecollectionmaxheight \xexternalfigurecollectionmaxheight\scratchdimen \fi
+ \ifdim\scratchdimen<\xexternalfigurecollectionminheight \xexternalfigurecollectionminheight\scratchdimen \fi
+ \fi}
+
+\unexpanded\def\startexternalfigurecollection[#1]%
+ {\begingroup
+ \def\currentexternalfigurecollection{#1}%
+ \settrue\inexternalfigurecollection
+ \xexternalfigurecollectionminwidth \maxdimen
+ \xexternalfigurecollectionmaxwidth \zeropoint
+ \xexternalfigurecollectionminheight\maxdimen
+ \xexternalfigurecollectionmaxheight\zeropoint}
+
+\unexpanded\def\stopexternalfigurecollection
+ {\setxvalue{\??ef:c:\currentexternalfigurecollection:\c!minwidth }{\the\xexternalfigurecollectionminwidth }%
+ \setxvalue{\??ef:c:\currentexternalfigurecollection:\c!maxwidth }{\the\xexternalfigurecollectionmaxwidth }%
+ \setxvalue{\??ef:c:\currentexternalfigurecollection:\c!minheight}{\the\xexternalfigurecollectionminheight}%
+ \setxvalue{\??ef:c:\currentexternalfigurecollection:\c!maxheight}{\the\xexternalfigurecollectionmaxheight}%
+ \endgroup}
+
+\def\externalfigurecollectionparameter#1#2%
+ {\csname\ifcsname\??ef:c:#1:#2\endcsname\??ef:c:#1:#2\else\s!empty\fi\endcsname}
+
+\def\externalfigurecollectionminwidth #1{\externalfigurecollectionparameter{#1}\c!minwidth }
+\def\externalfigurecollectionmaxwidth #1{\externalfigurecollectionparameter{#1}\c!maxwidth }
+\def\externalfigurecollectionminheight#1{\externalfigurecollectionparameter{#1}\c!minheight}
+\def\externalfigurecollectionmaxheight#1{\externalfigurecollectionparameter{#1}\c!maxheight}
+
+\let\efcparameter\externalfigurecollectionparameter
+\let\efcminwidth \externalfigurecollectionminwidth
+\let\efcmaxwidth \externalfigurecollectionmaxwidth
+\let\efcminheight\externalfigurecollectionminheight
+\let\efcmaxheight\externalfigurecollectionmaxheight
+
+% \startexternalfigurecollection[name]
+% \useexternalfigure[cow] [cow.pdf]
+% \useexternalfigure[mill][mill.png]
+% \stopexternalfigurecollection
+% \starttext
+% \bTABLE
+% \bTR
+% \bTD \externalfigure[cow] [height=\externalfigurecollectionmaxheight{name}] \eTD
+% \bTD \externalfigure[mill][height=\externalfigurecollectionmaxheight{name}] \eTD
+% \eTR
+% \eTABLE
+% \stoptext
\def\dosetefparameters#1#2#3% parent_id use_settings current_settings
{\doifelsenothing{#1} % inherit from parent
@@ -173,7 +253,7 @@
\long\def\resourcecomment#1%
{\long\gdef\currentresourcecomment{#1}}
-\long\def\startresourcecomment#1\stopresourcecomment
+\long\unexpanded\def\startresourcecomment#1\stopresourcecomment
{\long\gdef\currentresourcecomment{#1}}
\let\currentresourcecomment\empty
@@ -290,7 +370,7 @@
{\hskip2em\box\colorbarbox}%
\global\wd\colorbarbox\zeropoint}
-\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]%
+\unexpanded\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]%
{\hbox
{\setbox0\hbox
{\useexternalfigure[\s!dummy][#2][#3,#5]%
@@ -402,11 +482,13 @@
\long\def\dostartfigure#1%
{\dotripleargument\dodostartfigure#1\stopfigure}
-\def\startfigure
+\unexpanded\def\startfigure
{\grabuntil{\e!stop\v!figure}\dostartfigure}
%D NEW: used in styledesign manual
+% beware in mkiv we don't have the typeset- prefix
+%
% \setbuffer[typeset-b]\endbuffer
% \setbuffer[typeset-a]\endbuffer
%
@@ -431,32 +513,64 @@
\dodotypesetbuffer[\jobname][]
\fi\fi}
-\def\dodotypesetbuffer[#1][#2]% beware: this will mix up the mp graphics
+% \def\dodotypesetbuffer[#1][#2]%
+% {\bgroup
+% \global\advance\noftypesetbuffers\plusone
+% \edef\bufferfilename{\jobname-buffer-\the\noftypesetbuffers}%
+% \doifmode{*\v!first}
+% {\ctxlua{buffers.save("\bufferfilename.tmp","#1",true)}%
+% \executesystemcommand{context \bufferfilename.tmp}}%
+% \externalfigure[\bufferfilename.pdf][#2]%
+% \egroup}
+
+\def\dodotypesetbuffer[#1][#2]%
{\bgroup
\global\advance\noftypesetbuffers\plusone
\edef\bufferfilename{\jobname-buffer-\the\noftypesetbuffers}%
- \ctxlua{buffers.save("\bufferfilename.tmp","#1",true)}%
- \executesystemcommand{context \bufferfilename.tmp}%
+ \ctxlua{buffers.run("\bufferfilename.tmp","#1",true)}%
\externalfigure[\bufferfilename.pdf][#2]%
\egroup}
+
+\def\dodotypesetbufferindeed#1%
+ {}
% for me only (manuals and such)
+%
+% \definetypesetting [name] [options] [settings-a]
+%
+% \typesetfile [name] [file] [settings-b]
+% \typesetfile [file] [options] [settings-b]
+% \typesetfile [file] [settings-b]
+% \typesetfile [file]
+%
+% \enabletrackers[files.run]
+% \starttext
+% \typesetfile[oepsoeps.tex][width=10cm,frame=on]
+% \stoptext
\definesystemvariable{tz}
-\def\definetypesetting{\dotripleempty\dodefinetypesetting}
+\unexpanded\def\definetypesetting{\dotripleempty\dodefinetypesetting}
\def\typesetfile {\dotripleempty\dotypesetfile}
-\def\dodefinetypesetting[#1][#2][#3]%
- {\doifsomething{#1}{\setvalue{\??tz#1}{\dodotypesetfile{#2}{#3}}}}
+\unexpanded\def\definetypesetting{\dotripleempty\dodefinetypesetting}
+\def\typesetfile {\dotripleempty\dotypesetfile}
-\def\dotypesetfile[#1][#2][#3]%
- {\executeifdefined{\??tz#1}\gobbletwoarguments{#2}{#3}}
+\def\dodefinetypesetting[#1][#2][#3]% <name> options settings-a
+ {\doifsomething{#1}{\setvalue{\??tz#1}{\dodotypesetfile{#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]}
+\def\dotypesetfile[#1][#2][#3]% <name> filename settings-b | filename options settings
+ {\ifcsname\??tz#1\endcsname
+ \csname\??tz#1\endcsname{#2}{#3}%
+ \else\ifthirdargument % filename options settings
+ \dodotypesetfile{#2}{#3}{#1}{}%
+ \else\ifsecondargument % filename settings
+ \dodotypesetfile{}{#2}{#1}{}%
+ \fi\fi\fi}
+
+\def\dodotypesetfile#1#2#3#4% options settings-a filename settings-b
+ {\edef\typesetfilename{\ctxlua{tex.write(jobfiles.run("#3","#1"))}}%
+ \expanded{\externalfigure[\typesetfilename]}[#2,#4]}
\setupexternalfigures
[\c!option=,
diff --git a/Master/texmf-dist/tex/context/base/grph-fil.lua b/Master/texmf-dist/tex/context/base/grph-fil.lua
new file mode 100644
index 00000000000..2e32c7a6066
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/grph-fil.lua
@@ -0,0 +1,42 @@
+if not modules then modules = { } end modules ['grph-fil'] = {
+ version = 1.001,
+ comment = "companion to grph-fig.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, concat = string.format, table.concat
+
+local trace_run = false trackers.register("files.run",function(v) trace_run = v end)
+
+local command = "context %s"
+
+jobfiles = jobfiles or { }
+jobfiles.collected = jobfiles.collected or { }
+jobfiles.tobesaved = jobfiles.tobesaved or { }
+
+local tobesaved, collected = jobfiles.tobesaved, jobfiles.collected
+
+local function initializer()
+ tobesaved, collected = jobfiles.tobesaved, jobfiles.collected
+end
+
+job.register('jobfiles.collected', jobfiles.tobesaved, initializer)
+
+jobfiles.forcerun = false
+
+function jobfiles.run(name,...)
+ local oldchecksum = collected[name]
+ local newchecksum = file.checksum(name)
+ if jobfiles.forcerun or not oldchecksum or oldchecksum ~= newchecksum then
+ if trace_run then
+ commands.writestatus("buffers","changes in '%s', processing forced",name)
+ end
+ os.execute(format(command,concat({ name, ... }," ")))
+ elseif trace_run then
+ commands.writestatus("buffers","no changes in '%s', not processed",name)
+ end
+ tobesaved[name] = newchecksum
+ return file.replacesuffix(name,"pdf")
+end
diff --git a/Master/texmf-dist/tex/context/base/grph-inc.lua b/Master/texmf-dist/tex/context/base/grph-inc.lua
index 3dfcee739ff..508240a3bc4 100644
--- a/Master/texmf-dist/tex/context/base/grph-inc.lua
+++ b/Master/texmf-dist/tex/context/base/grph-inc.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['grph-inc'] = {
version = 1.001,
- comment = "companion to grph-inc.tex",
+ comment = "companion to grph-inc.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -12,6 +12,8 @@ if not modules then modules = { } end modules ['grph-inc'] = {
-- dimensions
-- consult rlx
+-- figures.boxnumber can go as we now can use names
+
--[[
The ConTeXt figure inclusion mechanisms are among the oldest code
in ConTeXt and evolve dinto a complex whole. One reason is that we
@@ -33,12 +35,20 @@ The TeX-Lua mix is suboptimal. This has to do with the fact that we cannot
run TeX code from within Lua. Some more functionality will move to Lua.
]]--
-local texsprint, format, lower, find, match = tex.sprint, string.format, string.lower, string.find, string.match
+local format, lower, find, match, gsub, gmatch = string.format, string.lower, string.find, string.match, string.gsub, string.gmatch
+local texsprint, texbox = tex.sprint, tex.box
+local contains = table.contains
+local concat = table.concat
+local todimen = string.todimen
local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
-local trace_figures = false trackers.register("figures.locating",function(v) trace_figures = v end)
+local trace_figures = false trackers.register("figures.locating", function(v) trace_figures = v end)
+local trace_bases = false trackers.register("figures.bases", function(v) trace_bases = v end)
+local trace_programs = false trackers.register("figures.programs", function(v) trace_programs = v end)
+local trace_conversion = false trackers.register("figures.conversion", function(v) trace_conversion = v end)
+local trace_inclusion = false trackers.register("figures.inclusion", function(v) trace_inclusion = v end)
--- some extra img functions ---
@@ -69,7 +79,7 @@ local validtypes = table.tohash(img.types())
function img.check_size(size)
if size then
- size = size:gsub("box","")
+ size = gsub(size,"box","")
return (validsizes[size] and size) or "crop"
else
return "crop"
@@ -78,13 +88,13 @@ end
---
-figures = figures or { }
-figures.loaded = figures.loaded or { }
-figures.used = figures.used or { }
-figures.found = figures.found or { }
-figures.suffixes = figures.suffixes or { }
-figures.patterns = figures.patterns or { }
-figures.boxnumber = figures.boxid or 0
+figures = figures or { }
+figures.loaded = figures.loaded or { }
+figures.used = figures.used or { }
+figures.found = figures.found or { }
+figures.suffixes = figures.suffixes or { }
+figures.patterns = figures.patterns or { }
+figures.boxnumber = figures.boxnumber or 0
figures.defaultsearch = true
figures.defaultwidth = 0
figures.defaultheight = 0
@@ -104,7 +114,7 @@ figures.cachepaths = {
figures.paths = table.copy(figures.localpaths)
figures.order = {
- "pdf", "mps", "jpg", "png", "jbig", "svg", "eps", "mov", "buffer", "tex"
+ "pdf", "mps", "jpg", "png", "jbig", "svg", "eps", "gif", "mov", "buffer", "tex",
}
figures.formats = {
@@ -115,6 +125,7 @@ figures.formats = {
["jbig"] = { list = { "jbig", "jbig2", "jb2" } },
["svg"] = { list = { "svg", "svgz" } },
["eps"] = { list = { "eps", "ai" } },
+ ["gif"] = { list = { "gif" } },
["mov"] = { list = { "mov", "avi" } },
["buffer"] = { list = { "tmp", "buffer", "buf" } },
["tex"] = { list = { "tex" } },
@@ -122,19 +133,21 @@ figures.formats = {
function figures.setlookups()
figures.suffixes, figures.patterns = { }, { }
- for _, format in pairs(figures.order) do
+ for _, format in next, figures.order do
local data = figures.formats[format]
local fs, fp = figures.suffixes, figures.patterns
- if data.list then
- for _, s in ipairs(data.list) do
- fs[s] = format -- hash
+ local list = data.list
+ if list then
+ for i=1,#list do
+ fs[list[i]] = format -- hash
end
else
fs[format] = format
end
- if data.patterns then
- for _, s in ipairs(data.patterns) do
- fp[#fp+1] = { s, format } -- array
+ local patterns = data.patterns
+ if patterns then
+ for i=1,#patterns do
+ fp[#fp+1] = { patterns[i], format } -- array
end
end
end
@@ -149,12 +162,12 @@ local function register(tag,target,what)
figures.formats[target] = data
end
local d = data[tag] -- list or pattern
- if d and not table.contains(d,what) then
+ if d and not contains(d,what) then
d[#d+1] = what -- suffix or patternspec
else
data[tag] = { what }
end
- if not table.contains(figures.order,target) then
+ if not contains(figures.order,target) then
figures.order[#figures.order+1] = target
end
figures.setlookups()
@@ -182,35 +195,24 @@ function figures.setpaths(locationset,pathlist)
last_locationset = locationset
end
if h[iv["global"]] then
- for s in pathlist:gmatch("([^, ]+)") do
- if not table.contains(t,s) then
+ -- for s in gmatch(pathlist,",* *([^,]+)") do
+ local list = aux.settings_to_array(pathlist)
+ for i=1,#list do
+ local s = list[i]
+ if not contains(t,s) then
t[#t+1] = s
end
end
end
figures.paths, last_pathlist = t, pathlist
if trace_figures then
- logs.report("figures","locations: %s",last_locationset)
- logs.report("figures","path list: %s",table.concat(figures.paths))
+ commands.writestatus("figures","locations: %s",last_locationset)
+ commands.writestatus("figures","path list: %s",concat(figures.paths, " "))
end
end
-- check conversions and handle it here
---~ local keys = img.keys()
-
---~ function figures.hash(data)
---~ local i = data.status.private
---~ local t = { }
---~ for _, v in ipairs(keys) do
---~ local iv = i[v]
---~ if iv then
---~ t[#t+1] = v .. '=' .. iv
---~ end
---~ end
---~ return table.concat(t,"+")
---~ end
-
function figures.hash(data)
return data.status.hash or tostring(data.status.private) -- the <img object>
-- return data.status.fullname .. "+".. (data.status.page or data.request.page or 1) -- img is still not perfect
@@ -262,13 +264,16 @@ do
end
function figures.push(request)
- statistics.starttiming(figures)
+ local ncs = #callstack + 1
+ if ncs == 1 then
+ statistics.starttiming(figures)
+ end
local figuredata = figures.new()
if request then
local iv = interfaces.variables
- -- request.width/height are strings and are only used when no natural dimensions
- -- can be determined; at some point the handlers might set them to numbers instead
---~ local w, h = tonumber(request.width), tonumber(request.height)
+ -- request.width/height are strings and are only used when no natural dimensions
+ -- can be determined; at some point the handlers might set them to numbers instead
+ -- local w, h = tonumber(request.width), tonumber(request.height)
request.page = math.max(tonumber(request.page) or 1,1)
request.size = img.check_size(request.size)
request.object = iv[request.object] == variables.yes
@@ -277,21 +282,25 @@ do
request.cache = request.cache ~= "" and request.cache
request.prefix = request.prefix ~= "" and request.prefix
request.format = request.format ~= "" and request.format
---~ request.width = (w and w > 0) or false
---~ request.height = (h and h > 0) or false
+ -- request.width = (w and w > 0) or false
+ -- request.height = (h and h > 0) or false
table.merge(figuredata.request,request)
end
- callstack[#callstack+1] = figuredata
+ callstack[ncs] = figuredata
return figuredata
end
function figures.pop()
- figuredata = callstack[#callstack]
- callstack[#callstack] = nil
- statistics.stoptiming(figures)
+ local ncs = #callstack
+ figuredata = callstack[ncs]
+ callstack[ncs] = nil
+ if ncs == 1 then
+ statistics.stoptiming(figures)
+ end
end
-- maybe move texsprint to tex
function figures.get(category,tag,default)
- local value = figuredata[category][tag]
+ local value = figuredata[category]
+ value = value and value[tag]
if not value or value == "" or value == true then
return default or ""
else
@@ -307,19 +316,48 @@ do
end
+local defaultformat = "pdf"
+local defaultprefix = "m_k_v_i_"
+
local function register(askedname,specification)
if specification then
local format = specification.format
if format then
- local converter = figures.converters[format]
+ local conversion = specification.conversion
+ if conversion == "" then
+ conversion = nil
+ end
+ local newformat = conversion
+ if not newformat or newformat == "" then
+ newformat = defaultformat
+ end
+ local converter = (newformat ~= format) and figures.converters[format]
+ if trace_conversion then
+ logs.report("figures","checking conversion of '%s': old format '%s', new format '%s', conversion '%s'",
+ askedname,format,newformat,conversion or "default")
+ end
+ if converter then
+ if converter[newformat] then
+ converter = converter[newformat]
+ else
+ newformat = defaultformat
+ if converter[newformat] then
+ converter = converter[newformat]
+ else
+ newformat = defaultformat
+ end
+ end
+ end
if converter then
local oldname = specification.fullname
- local newformat = "pdf" -- todo, other target than pdf
local newpath = file.dirname(oldname)
- local newbase = file.replacesuffix(file.basename(oldname),newformat)
+ local oldbase = file.basename(oldname)
+ local newbase = file.replacesuffix(oldbase,newformat)
local fc = specification.cache or figures.cachepaths.path
if fc and fc ~= "" and fc ~= "." then
newpath = fc
+ else
+ newbase = defaultprefix .. newbase
end
local subpath = specification.subpath or figures.cachepaths.subpath
if subpath and subpath ~= "" and subpath ~= "." then
@@ -331,10 +369,19 @@ local function register(askedname,specification)
end
local newname = file.join(newpath,newbase)
dir.makedirs(newpath)
+ oldname = file.collapse_path(oldname)
+ newname = file.collapse_path(newname)
local oldtime = lfs.attributes(oldname,'modification') or 0
local newtime = lfs.attributes(newname,'modification') or 0
if oldtime > newtime then
+ if trace_conversion then
+ logs.report("figures","converting '%s' from '%s' to '%s'",askedname,format,newformat)
+ end
converter(oldname,newname)
+ else
+ if trace_conversion then
+ logs.report("figures","no need to convert '%s' from '%s' to '%s'",askedname,format,newformat)
+ end
end
if io.exists(newname) then
specification.foundname = oldname
@@ -353,15 +400,15 @@ local function register(askedname,specification)
if not found then
specification.found = false
if trace_figures then
- logs.report("figures","format not supported: %s",format)
+ commands.writestatus("figures","format not supported: %s",format)
end
else
specification.found = true
if trace_figures then
if validtypes[format] then
- logs.report("figures","format natively supported by backend: %s",format)
+ commands.writestatus("figures","format natively supported by backend: %s",format)
else
- logs.report("figures","format supported by output file format: %s",format)
+ commands.writestatus("figures","format supported by output file format: %s",format)
end
end
end
@@ -369,24 +416,42 @@ local function register(askedname,specification)
specification = { }
end
specification.foundname = specification.foundname or specification.fullname
- figures.found[askedname] = specification
+ figures.found[askedname .. "->" .. (specification.conversion or "default")] = specification
return specification
end
+local resolve_too = true -- urls
+
local function locate(request) -- name, format, cache
local askedname = resolvers.clean_path(request.name)
- if figures.found[askedname] then
- return figures.found[askedname]
+ local foundname = figures.found[askedname .. "->" .. (request.conversion or "default")]
+ if foundname then
+ return foundname
+ end
+ -- protocol check
+ local hashed = url.hashed(askedname)
+ if hashed and hashed.scheme ~= "file" then
+ local foundname = resolvers.findbinfile(askedname)
+ if foundname then
+ askedname = foundname
+ end
end
- local askedpath= file.dirname(askedname)
+ -- we could use the hashed data instead
+ local askedpath= file.is_rootbased_path(askedname)
local askedbase = file.basename(askedname)
local askedformat = (request.format ~= "" and request.format ~= "unknown" and request.format) or file.extname(askedname) or ""
local askedcache = request.cache
+ local askedconversion = request.conversion
if askedformat ~= "" then
+ if trace_figures then
+ commands.writestatus("figures","strategy: forced format")
+ end
askedformat = lower(askedformat)
local format = figures.suffixes[askedformat]
if not format then
- for _, pattern in ipairs(figures.patterns) do
+ local figurepatterns = figures.patterns
+ for i=1,#figurepatterns do
+ local pattern = figurepatterns[i]
if find(askedformat,pattern[1]) then
format = pattern[2]
break
@@ -394,7 +459,7 @@ local function locate(request) -- name, format, cache
end
end
if format then
- local foundname = figures.exists(askedname,format) -- not askedformat
+ local foundname = figures.exists(askedname,format,resolve_too) -- not askedformat
if foundname then
return register(askedname, {
askedname = askedname,
@@ -402,29 +467,36 @@ local function locate(request) -- name, format, cache
format = format,
cache = askedcache,
foundname = foundname,
+ conversion = askedconversion,
})
end
end
- if askedpath ~= "" then
+ if askedpath then
-- path and type given, todo: strip pieces of path
- if figures.exists(askedname,askedformat) then
+ if figures.exists(askedname,askedformat,resolve_too) then
return register(askedname, {
askedname = askedname,
fullname = askedname,
format = askedformat,
cache = askedcache,
+ conversion = askedconversion,
})
end
else
-- type given
- for _, path in ipairs(figures.paths) do
+ local figurepaths = figures.paths
+ for i=1,#figurepaths do
+ local path = figurepaths[i]
local check = path .. "/" .. askedname
- if figures.exists(check,askedformat) then
+ -- we pass 'true' as it can be an url as well, as the type
+ -- is given we don't waste much time
+ if figures.exists(check,askedformat,resolve_too) then
return register(check, {
askedname = askedname,
fullname = check,
format = askedformat,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
@@ -436,56 +508,88 @@ local function locate(request) -- name, format, cache
fullname = check,
format = askedformat,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
end
- elseif askedpath ~= "" then
- for _, format in ipairs(figures.order) do
+ elseif askedpath then
+ if trace_figures then
+ commands.writestatus("figures","strategy: rootbased path")
+ end
+ local figureorder = figures.order
+ for i=1,#figureorder do
+ local format = figureorder[i]
local list = figures.formats[format].list or { format }
- for _, suffix in ipairs(list) do
+ for j=1,#list do
+ local suffix = list[j]
local check = file.addsuffix(askedname,suffix)
- if figures.exists(check,format) then
+ if figures.exists(check,format,resolve_too) then
return register(askedname, {
askedname = askedname,
fullname = check,
format = format,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
end
else
if figures.prefer_quality then
- for _, format in ipairs(figures.order) do
+ if trace_figures then
+ commands.writestatus("figures","strategy: unknown format, prefer quality")
+ end
+ local figurepaths = figures.paths
+ local figureorder = figures.order
+ for j=1,#figureorder do
+ local format = figureorder[j]
local list = figures.formats[format].list or { format }
- for _, suffix in ipairs(list) do
- local name = file.replacesuffix(askedbase,suffix)
- for _, path in ipairs(figures.paths) do
+ for k=1,#list do
+ local suffix = list[k]
+ -- local name = file.replacesuffix(askedbase,suffix)
+ local name = file.replacesuffix(askedname,suffix)
+ for i=1,#figurepaths do
+ local path = figurepaths[i]
local check = path .. "/" .. name
- if figures.exists(check,format) then
+ local isfile = url.hashed(check).scheme == "file"
+ if not isfile then
+ if trace_figures then
+ commands.writestatus("figures","warning: skipping path %s",path)
+ end
+ elseif figures.exists(check,format,true) then
return register(askedname, {
askedname = askedname,
fullname = check,
format = format,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
end
end
else -- 'location'
- for _, path in ipairs(figures.paths) do
- for _, format in ipairs(figures.order) do
+ if trace_figures then
+ commands.writestatus("figures","strategy: unknown format, prefer path")
+ end
+ local figurepaths = figures.paths
+ local figureorder = figures.order
+ for i=1,#figurepaths do
+ local path = figurepaths[i]
+ for j=1,#figureorder do
+ local format = figureorder[j]
local list = figures.formats[format].list or { format }
- for _, suffix in ipairs(list) do
+ for k=1,#list do
+ local suffix = list[k]
local check = path .. "/" .. file.replacesuffix(askedbase,suffix)
- if figures.exists(check,format) then
+ if figures.exists(check,format,resolve_too) then
return register(askedname, {
askedname = askedname,
fullname = check,
format = format,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
@@ -493,9 +597,15 @@ local function locate(request) -- name, format, cache
end
end
if figures.defaultsearch then
- for _, format in ipairs(figures.order) do
+ if trace_figures then
+ commands.writestatus("figures","strategy: default tex path")
+ end
+ local figureorder = figures.order
+ for j=1,#figureorder do
+ local format = figureorder[j]
local list = figures.formats[format].list or { format }
- for _, suffix in ipairs(list) do
+ for k=1,#list do
+ local suffix = list[k]
local check = resolvers.find_file(file.replacesuffix(askedname,suffix))
if check and check ~= "" then
return register(askedname, {
@@ -503,6 +613,7 @@ local function locate(request) -- name, format, cache
fullname = check,
format = format,
cache = askedcache,
+ conversion = askedconversion,
})
end
end
@@ -519,6 +630,7 @@ figures.checkers = figures.checkers or { }
figures.includers = figures.includers or { }
figures.converters = figures.converters or { }
figures.identifiers = figures.identifiers or { }
+figures.programs = figures.programs or { }
figures.identifiers.list = {
figures.identifiers.default
@@ -541,7 +653,9 @@ end
function figures.identify(data)
data = data or figures.current()
- for _, identifier in ipairs(figures.identifiers.list) do
+ local list = figures.identifiers.list
+ for i=1,#list do
+ local identifier = list[i]
data = identifier(data)
if data.status.status > 0 then
break
@@ -549,8 +663,8 @@ function figures.identify(data)
end
return data
end
-function figures.exists(askedname,format)
- return (figures.existers[format] or figures.existers.generic)(askedname)
+function figures.exists(askedname,format,resolve)
+ return (figures.existers[format] or figures.existers.generic)(askedname,resolve)
end
function figures.check(data)
data = data or figures.current()
@@ -569,38 +683,47 @@ end
function figures.done(data)
figures.n = figures.n + 1
data = data or figures.current()
- local dr, du, ds = data.request, data.used, data.status
- ds.width = tex.wd[figures.boxnumber]
- ds.height = tex.ht[figures.boxnumber]
- ds.xscale = ds.width/(du.width or 1)
+--~ print(table.serialize(figures.current()))
+ local dr, du, ds, nr = data.request, data.used, data.status, figures.boxnumber
+ local box = texbox[nr]
+ ds.width = box.width
+ ds.height = box.height
+ ds.xscale = ds.width /(du.width or 1)
ds.yscale = ds.height/(du.height or 1)
+--~ print(table.serialize(figures.current()))
return data
end
-function figures.dummy(data) -- fails
---~ data = data or figures.current()
---~ local dr, du, ds = data.request, data.used, data.status
---~ local r = node.new("rule")
---~ r.width = du.width or figures.defaultwidth
---~ r.height = du.height or figures.defaultheight
---~ r.depth = du.depth or figures.defaultdepth
---~ tex.box[figures.boxnumber] = node.write(r)
- texsprint(ctxcatcodes,"\\emptyfoundexternalfigure")
+function figures.dummy(data)
+ data = data or figures.current()
+ local dr, du, ds, nr = data.request, data.used, data.status, figures.boxnumber
+ local box = node.hpack(node.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
+ -- box.dir = "TLT"
+ box.width = du.width
+ box.height = du.height
+ box.depth = du.depth
+ texbox[nr] = box -- hm, should be global (to be checked for consistency)
end
-- -- -- generic -- -- --
-function figures.existers.generic(askedname)
---~ local result = io.exists(askedname)
---~ result = (result==true and askedname) or result
---~ local result = resolvers.find_file(askedname) or ""
- local result = resolvers.findbinfile(askedname) or ""
- if result == "" then result = false end
+function figures.existers.generic(askedname,resolve)
+ -- not findbinfile
+ local result
+ if lfs.isfile(askedname) then
+ result = askedname
+ elseif resolve then
+ result = resolvers.findbinfile(askedname) or ""
+ if result == "" then result = false end
+ end
if trace_figures then
if result then
- logs.report("figures","found: %s -> %s",askedname,result)
+ commands.writestatus("figures","found: %s -> %s",askedname,result)
else
- logs.report("figures","not found: %s",askedname)
+ commands.writestatus("figures","not found: %s",askedname)
end
end
return result
@@ -608,7 +731,11 @@ end
function figures.checkers.generic(data)
local dr, du, ds = data.request, data.used, data.status
local name, page, size, color = du.fullname or "unknown generic", du.page or dr.page, dr.size or "crop", dr.color or "natural"
- local hash = name .. "->" .. page .. "->" .. size .. "->" .. color
+ local conversion = dr.conversion
+ if not conversion or conversion == "" then
+ conversion = "unknown"
+ end
+ local hash = name .. "->" .. page .. "->" .. size .. "->" .. color .. "->" .. conversion
local figure = figures.loaded[hash]
if figure == nil then
figure = img.new { filename = name, page = page, pagebox = dr.size }
@@ -617,6 +744,13 @@ function figures.checkers.generic(data)
local f, d = backends.codeinjections.setfigurealternative(data,figure)
figure, data = f or figure, d or data
figures.loaded[hash] = figure
+ if trace_conversion then
+ logs.report("figures","new graphic, hash: %s",hash)
+ end
+ else
+ if trace_conversion then
+ logs.report("figures","existing graphic, hash: %s",hash)
+ end
end
if figure then
du.width = figure.width
@@ -643,9 +777,11 @@ function figures.includers.generic(data)
figures.used[hash] = figure
end
if figure then
- local n = figures.boxnumber
- tex.box[n] = img.node(figure) -- img.write(figure)
- tex.wd[n], tex.ht[n], tex.dp[n] = figure.width, figure.height, 0 -- new, hm, tricky, we need to do that in tex (yet)
+ local nr = figures.boxnumber
+ -- it looks like we have a leak in attributes here .. todo
+ local box = node.hpack(img.node(figure)) -- img.node(figure) not longer valid
+ box.width, box.height, box.depth = figure.width, figure.height, 0 -- new, hm, tricky, we need to do that in tex (yet)
+ texbox[nr] = box
ds.objectnumber = figure.objnum
texsprint(ctxcatcodes,"\\relocateexternalfigure")
end
@@ -678,22 +814,29 @@ end
function figures.checkers.mov(data)
local dr, du, ds = data.request, data.used, data.status
- dr.width = (dr.width or figures.defaultwidth):todimen()
- dr.height = (dr.height or figures.defaultheight):todimen()
- du.width = dr.width
- du.height = dr.height
- du.foundname = du.fullname
- local code = backends.codeinjections.insertmovie {
- width = du.width or dr.width,
- height = du.height or dr.height,
- factor = number.dimenfactors.bp,
- ["repeat"] = dr["repeat"],
- controls = dr.controls,
- preview = dr.preview,
- label = dr.label,
- foundname = du.foundname,
- }
- texsprint(ctxcatcodes,format("\\startfoundexternalfigure{%ssp}{%ssp}%s\\stopfoundexternalfigure",du.width,du.height,code))
+ 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
+ logs.report("figures","including movie '%s': width %s, height %s",foundname,width,height)
+ end
+ -- we need to push the node.write in between ... we could make a shared helper for this
+ context.startfoundexternalfigure(width .. "sp",height .. "sp")
+ context(function()
+ backends.codeinjections.insertmovie {
+ width = width,
+ height = height,
+ factor = number.dimenfactors.bp,
+ ["repeat"] = dr["repeat"],
+ controls = dr.controls,
+ preview = dr.preview,
+ label = dr.label,
+ foundname = foundname,
+ }
+ end)
+ context.stopfoundexternalfigure()
return data
end
@@ -750,27 +893,100 @@ function figures.checkers.tex(data)
end
figures.includers.tex = figures.includers.nongeneric
--- -- -- eps -- -- --
+-- -- -- converters -- -- --
+
+local function makeoptions(program)
+ local to = type(options)
+ return (to == "table" and concat(options," ")) or (to == "string" and options) or ""
+end
-function figures.converters.eps(oldname,newname)
- -- hack, we need a lua based converter script, or better, we should use
- -- rlx as alternative
- local outputpath = file.dirname(newname)
- local outputbase = file.basename(newname)
- local command = format("mtxrun bin:pstopdf --outputpath=%s %s",outputpath,oldname)
+local function runprogram(...)
+ local command = format(...)
+ if trace_conversion or trace_programs then
+ logs.report("figures","running %s",command)
+ end
os.spawn(command)
end
-figures.converters.svg = figures.converters.eps
+-- -- -- eps -- -- --
+
+local epsconverter = { }
+figures.converters.eps = epsconverter
+
+figures.programs.gs = {
+ options = {
+ "-dAutoRotatePages=/None",
+ "-dPDFSETTINGS=/prepress",
+ "-dEPSCrop",
+ },
+ command = (os.type == "windows" and "gswin32") or "gs"
+}
+
+function epsconverter.pdf(oldname,newname)
+ local gs = figures.programs.gs
+ runprogram (
+ '%s -q -sDEVICE=pdfwrite -dNOPAUSE -dNOCACHE -dBATCH %s -sOutputFile="%s" "%s" -c quit',
+ gs.command, makeoptions(gs.options), newname, oldname
+ )
+end
+
+epsconverter.default = epsconverter.pdf
+
+-- -- -- svg -- -- --
--- -- -- lowres -- -- --
+local svgconverter = { }
+figures.converters.svg = svgconverter
+figures.converters.svgz = svgconverter
---~ function figures.converters.pdf(oldname,newname)
---~ local outputpath = file.dirname(newname)
---~ local outputbase = file.basename(newname)
---~ local command = format("mtxrun bin:pstopdf --method=4 --outputpath=%s %s",outputpath,oldname)
---~ os.spawn(command)
---~ end
+-- inkscape on windows only works with complete paths
+
+figures.programs.inkscape = {
+ options = {
+ "--export-dpi=600"
+ },
+ command = "inkscape"
+}
+
+function svgconverter.pdf(oldname,newname)
+ local inkscape = figures.programs.inkscape
+ runprogram (
+ '%s "%s" --export-pdf="%s" %s',
+ inkscape.command, oldname, newname, makeoptions(inkscape.options)
+ )
+end
+
+function svgconverter.png(oldname,newname)
+ local inkscape = figures.programs.inkscape
+ runprogram (
+ '%s "%s" --export-png="%s" %s',
+ inkscape.command, oldname, newname, makeoptions(inkscape.options)
+ )
+end
+
+svgconverter.default = svgconverter.pdf
+
+-- -- -- gif -- -- --
+
+local gifconverter = { }
+figures.converters.gif = gifconverter
+
+figures.programs.convert = {
+ command = "convert" -- imagemagick
+}
+
+function gifconverter.pdf(oldname,newname)
+ local convert = figures.programs.convert
+ runprogram (
+ "convert %s %s",
+ convert.command, makeoptions(convert.options), oldname, newname
+ )
+end
+
+gifconverter.default = gifconverter.pdf
+
+-- todo: lowres
+
+-- -- -- bases -- -- --
figures.bases = { }
figures.bases.list = { } -- index => { basename, fullname, xmlroot }
@@ -782,10 +998,7 @@ local bases = figures.bases
function bases.use(basename)
if basename == "reset" then
- bases.list = { }
- bases.used = { }
- bases.found = { }
- bases.enabled = false
+ bases.list, bases.used, bases.found, bases.enabled = { }, { }, { }, false
else
basename = file.addsuffix(basename,"xml")
if not bases.used[basename] then
@@ -796,11 +1009,17 @@ function bases.use(basename)
bases.enabled = true
xml.registerns("rlx","http://www.pragma-ade.com/schemas/rlx") -- we should be able to do this per xml file
end
+ if trace_bases then
+ commands.writestatus("figures","registering base '%s'",basename)
+ end
end
end
end
function bases.find(basename,askedlabel)
+ if trace_bases then
+ commands.writestatus("figures","checking for '%s' in base '%s'",askedlabel,basename)
+ end
basename = file.addsuffix(basename,"xml")
local t = bases.found[askedlabel]
if t == nil then
@@ -808,30 +1027,41 @@ function bases.find(basename,askedlabel)
local page = 0
if base[2] == nil then
-- no yet located
- for _, path in ipairs(figures.paths) do
+ local figurepaths = figures.paths
+ for i=1,#figurepaths do
+ local path = figurepaths[i]
local xmlfile = path .. "/" .. basename
if io.exists(xmlfile) then
base[2] = xmlfile
base[3] = xml.load(xmlfile)
+ if trace_bases then
+ commands.writestatus("figures","base '%s' loaded",xmlfile)
+ end
break
end
end
end
t = false
if base[2] and base[3] then -- rlx:library
- for e, d, k in xml.elements(base[3],"/(*:library|figurelibrary)/*:figure/*:label") do
+ for e in xml.collected(base[3],"/(*:library|figurelibrary)/*:figure/*:label") do
page = page + 1
- if xml.content(d[k]) == askedlabel then
+ if xml.text(e) == askedlabel then
t = {
base = file.replacesuffix(base[2],"pdf"),
format = "pdf",
- name = xml.filters.text(e,"*:file"),
+ name = xml.text(e,"../*:file"), -- to be checked
page = page,
}
bases.found[askedlabel] = t
+ if trace_bases then
+ commands.writestatus("figures","figure '%s' found in base '%s'",askedlabel,base[2])
+ end
return t
end
end
+ if trace_bases and not t then
+ commands.writestatus("figures","figure '%s' not found in base '%s'",askedlabel,base[2])
+ end
end
end
return t
@@ -840,7 +1070,9 @@ end
-- we can access sequential or by name
function bases.locate(askedlabel)
- for _, entry in ipairs(bases.list) do
+ local list = bases.list
+ for i=1,#list do
+ local entry = list[i]
local t = bases.find(entry[1],askedlabel)
if t then
return t
diff --git a/Master/texmf-dist/tex/context/base/grph-inc.mkii b/Master/texmf-dist/tex/context/base/grph-inc.mkii
index dde7ab2e60f..1bd7544d8bc 100644
--- a/Master/texmf-dist/tex/context/base/grph-inc.mkii
+++ b/Master/texmf-dist/tex/context/base/grph-inc.mkii
@@ -476,7 +476,10 @@
\fi}
\def\externalfigurestamp % needs \edef'd macros!
- {\wantedfigurename
+ {\ifx\wantedfigurepath\empty\else
+ -\wantedfigurepath
+ \fi
+ \wantedfigurename
\ifx\wantedfiguretype\empty\else
\ifx\wantedfiguretype\s!unknown\else
-\wantedfiguretype
diff --git a/Master/texmf-dist/tex/context/base/grph-inc.mkiv b/Master/texmf-dist/tex/context/base/grph-inc.mkiv
index c8c0e36b74b..16ee1097a2f 100644
--- a/Master/texmf-dist/tex/context/base/grph-inc.mkiv
+++ b/Master/texmf-dist/tex/context/base/grph-inc.mkiv
@@ -20,21 +20,20 @@
%D - a few more obscure things
\registerctxluafile{grph-inc}{1.001}
+\registerctxluafile{grph-fil}{1.001}
\registerctxluafile{grph-u3d}{1.001} % this will change
+\registerctxluafile{grph-swf}{1.001} % this will change
\unprotect
%D The following registers are used (if only to be downward compatible).
\newbox \foundexternalfigure
-\newif \iftraceexternalfigures
\newif \ifskipexternalfigures
\newtoks \everyexternalfigureresets
\newtoks \everyexternalfigurechecks
\newtoks \externalfigurepostprocessors
-\let\traceexternalfigures \traceexternalfigurestrue
-
\def\resetfigurevariables {\the\everyexternalfigureresets}
\def\checkfigurevariables {\the\everyexternalfigurechecks}
@@ -55,7 +54,7 @@
%D \definegraphictypesynonym[jbg] [jb2]
%D \stoptyping
-\def\definegraphictypesynonym
+\unexpanded\def\definegraphictypesynonym
{\dodoubleargument\dodefinegraphictypesynonym}
\def\dodefinegraphictypesynonym[#1][#2]%
@@ -65,7 +64,7 @@
%D macro picks up the list.
\def\setfigurepathlist
- {\ctxlua{figures.setpaths("\@@exlocation","\@@exdirectory")}}
+ {\ctxlua{figures.setpaths("\@@exlocation",\!!bs\@@exdirectory\!!es)}}
%D Variables:
@@ -86,14 +85,13 @@
\def\figurefilecache {\ctxlua{figures.tprint("request","cache")}}
\def\figurefileprefix {\ctxlua{figures.tprint("request","prefix")}}
-\def\figurenaturalwidth {\ctxlua{figures.tprint("used","width",\number\dimexpr\defaultfigurewidth\relax)}sp}
+\def\figurenaturalwidth {\ctxlua{figures.tprint("used","width", \number\dimexpr\defaultfigurewidth \relax)}sp}
\def\figurenaturalheight {\ctxlua{figures.tprint("used","height",\number\dimexpr\defaultfigureheight\relax)}sp}
\def\figurefilepath {\ctxlua{tex.sprint(tex.ctxcatcodes,file.dirname (figures.get("used","fullname")))}}
\def\figurefilename {\ctxlua{tex.sprint(tex.ctxcatcodes,file.nameonly(figures.get("used","fullname")))}}
\def\figurefiletype {\ctxlua{tex.sprint(tex.ctxcatcodes,file.extname (figures.get("used","fullname")))}}
\def\figurefullname {\ctxlua{figures.tprint("used","fullname")}}
-
\def\noffigurepages {\ctxlua{figures.tprint("used","pages",0)}}
\let\naturalfigurewidth \figurenaturalwidth
@@ -105,7 +103,7 @@
\let\figurescaleyscale \figureyscale
\appendtoks
- \ctxlua {
+ \ctxlua { % figures.defaultwidth .. why not dimen
figures.setpaths("\@@exlocation","\@@exdirectory") ;
figures.defaultwidth = \number\dimexpr\defaultfigurewidth \relax ;
figures.defaultheight = \number\dimexpr\defaultfigureheight\relax ;
@@ -214,6 +212,10 @@
\newconditional\testexternalfigureonly
+% \enabletrackers[figures.conversion]
+% \externalfigure[demo.svg]
+% \externalfigure[demo.svg][conversion=png]
+
\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]% \cmd label filename parent_id preset current
{\dontcomplain
\restorecatcodes
@@ -237,6 +239,7 @@
controls="\@@efcontrols",
preview="\@@efpreview",
display="\@@efdisplay",
+ conversion="\@@efconversion",
color="\internalspotcolorparent\@@efcolor", % hack is needed
["repeat"]="\@@efrepeat",
width="\@@efwidth", % can be crap
@@ -244,6 +247,12 @@
} }%
\ctxlua{figures.identify()}%
\ifconditional\testexternalfigureonly
+ \ifcase\figurestatus \else
+ \ctxlua{figures.check()}%
+ \ctxlua{figures.dummy()}%
+ \ctxlua{figures.scale()}%
+ \ctxlua{figures.done()}%
+ \fi
\signalexternalfigure
\else
\ifcase\figurestatus
@@ -277,10 +286,10 @@
\global\setsystemmode \v!figure % todo, also: \v!resource
\fi}
-\def\startfoundexternalfigure#1#2%
+\unexpanded\def\startfoundexternalfigure#1#2% ht wd
{\global\setbox\foundexternalfigure\vbox to #2\bgroup\vss\hbox to #1\bgroup}
-\def\stopfoundexternalfigure
+\unexpanded\def\stopfoundexternalfigure
{\hss\egroup\egroup}
\def\emptyfoundexternalfigure
diff --git a/Master/texmf-dist/tex/context/base/grph-swf.lua b/Master/texmf-dist/tex/context/base/grph-swf.lua
new file mode 100644
index 00000000000..e55454b52b5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/grph-swf.lua
@@ -0,0 +1,43 @@
+if not modules then modules = { } end modules ['grph-swf'] = {
+ version = 1.001,
+ comment = "companion to grph-inc.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 texsprint = tex.sprint
+local ctxcatcodes = tex.ctxcatcodes
+local pdfannotation = nodes.pdfannotation
+
+function figures.checkers.swf(data)
+ local dr, du, ds = data.request, data.used, data.status
+ local width = (dr.width or figures.defaultwidth):todimen()
+ local height = (dr.height or figures.defaultheight):todimen()
+ local foundname = du.fullname
+ dr.width, dr.height = width, height
+ du.width, du.height, du.foundname = width, height, foundname
+ texsprint(ctxcatcodes,format("\\startfoundexternalfigure{%ssp}{%ssp}",width,height))
+ local annot, preview, ref = backends.pdf.helpers.insertswf {
+ foundname = foundname,
+ width = width,
+ height = height,
+ -- factor = number.dimenfactors.bp,
+ -- display = dr.display,
+ -- controls = dr.controls,
+ -- label = dr.label,
+ }
+ -- node.write(pdfannotation(width,-height,0,annot()))
+ texsprint(ctxcatcodes,format("\\pdfannot width %ssp height %ssp {%s}",width,height,annot())) -- brrrr
+--~ if ref then -- wrong ! a direct ref should work
+--~ texsprint(ctxcatcodes,format("\\smash{\\pdfrefximage%s\\relax}",ref)) -- brrrr
+--~ end
+ texsprint(ctxcatcodes,"\\stopfoundexternalfigure")
+ return data
+end
+
+figures.includers.swf = figures.includers.nongeneric
+
+figures.registersuffix("swf","swf")
diff --git a/Master/texmf-dist/tex/context/base/grph-trf.mkii b/Master/texmf-dist/tex/context/base/grph-trf.mkii
index 798a9b0b470..3e32395b480 100644
--- a/Master/texmf-dist/tex/context/base/grph-trf.mkii
+++ b/Master/texmf-dist/tex/context/base/grph-trf.mkii
@@ -262,6 +262,7 @@
\else\ifdim\scaleboxdimy>\scaleboxvsize
\global\scaleboxdimx\zeropoint \global\scaleboxdimy\scaleboxvsize
\fi\fi
+ \setscaleboxbydimension
\fi}
\def\setscaleboxbyscale
@@ -380,7 +381,8 @@
\scratchdimen\scaleboxoutervsize % \textheight
\fi
\fi\fi\fi}
- {\scaleboxoutervsize\scaleparameter\c!maxheight}%
+ {\scratchdimen\scaleparameter\c!maxheight
+ \scaleboxoutervsize\scratchdimen}%
\doifelsenothing{\scaleparameter\c!height}
{\scaleboxvsize\scratchdimen}
{\scaleboxvsize\scaleparameter\c!height}%
diff --git a/Master/texmf-dist/tex/context/base/grph-trf.mkiv b/Master/texmf-dist/tex/context/base/grph-trf.mkiv
index 798a9b0b470..9924a68e8e3 100644
--- a/Master/texmf-dist/tex/context/base/grph-trf.mkiv
+++ b/Master/texmf-dist/tex/context/base/grph-trf.mkiv
@@ -14,6 +14,8 @@
%D It may be that some functionality got lost. If it concerns
%D defined features, let me know and it will be sorted out.
+%D We will move the calculations to lua.
+
\writestatus{loading}{ConTeXt Graphic Macros / Transformations}
\unprotect
@@ -113,6 +115,7 @@
\global\let\finalscaleboxxfactor\!!hundred
\global\let\finalscaleboxyfactor\!!hundred
\ifdim\nextboxht>\zeropoint \ifdim\nextboxwd>\zeropoint
+ % hm, still useful? better in lua anyway
\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
@@ -126,10 +129,10 @@
\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
+% \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
@@ -200,7 +203,6 @@
\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}}
@@ -262,6 +264,7 @@
\else\ifdim\scaleboxdimy>\scaleboxvsize
\global\scaleboxdimx\zeropoint \global\scaleboxdimy\scaleboxvsize
\fi\fi
+ \setscaleboxbydimension
\fi}
\def\setscaleboxbyscale
@@ -371,8 +374,7 @@
\else % hm, there should be an option to force this
\ifdim\pagegoal<\maxdimen
\ifdim\pagetotal<\pagegoal
- \scratchdimen\pagegoal
- \advance\scratchdimen -\pagetotal
+ \scratchdimen\dimexpr\pagegoal-\pagetotal\relax
\else
\scratchdimen\scaleboxoutervsize % \textheight
\fi
@@ -380,7 +382,8 @@
\scratchdimen\scaleboxoutervsize % \textheight
\fi
\fi\fi\fi}
- {\scaleboxoutervsize\scaleparameter\c!maxheight}%
+ {\scratchdimen\scaleparameter\c!maxheight
+ \scaleboxoutervsize\scratchdimen}%
\doifelsenothing{\scaleparameter\c!height}
{\scaleboxvsize\scratchdimen}
{\scaleboxvsize\scaleparameter\c!height}%
@@ -455,7 +458,7 @@
%D
%D \showsetup{setupclipping}
-\def\setupclipping
+\unexpanded\def\setupclipping
{\dodoubleargument\getparameters[\??cp]}
\def\clip
diff --git a/Master/texmf-dist/tex/context/base/grph-u3d.lua b/Master/texmf-dist/tex/context/base/grph-u3d.lua
index e5944691c00..f3bf1763115 100644
--- a/Master/texmf-dist/tex/context/base/grph-u3d.lua
+++ b/Master/texmf-dist/tex/context/base/grph-u3d.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['grph-u3d'] = {
version = 1.001,
- comment = "companion to grph-inc.tex",
+ comment = "companion to grph-inc.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -8,34 +8,38 @@ if not modules then modules = { } end modules ['grph-u3d'] = {
-- see lpdf-u3d.lua for comment
-local format = string.format
+local trace_inclusion = false trackers.register("figures.inclusion", function(v) trace_inclusion = v end)
-local texsprint = tex.sprint
-local ctxcatcodes = tex.ctxcatcodes
+local pdfannotation = nodes.pdfannotation
+local todimen = string.todimen
+
+-- maybe todo: backends.codeinjections.insertu3d
function figures.checkers.u3d(data)
local dr, du, ds = data.request, data.used, data.status
- local width = (dr.width or figures.defaultwidth):todimen()
- local height = (dr.height or figures.defaultheight):todimen()
+ 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
- texsprint(ctxcatcodes,format("\\startfoundexternalfigure{%ssp}{%ssp}",width,height))
- local annot, preview, ref = backends.pdf.helpers.insert3d {
- foundname = foundname,
- width = width,
- height = height,
- factor = number.dimenfactors.bp,
- display = dr.display,
- controls = dr.controls,
- label = dr.label,
- }
- -- node.write(nodes.pdfannot(width,-height,0,annot()))
- texsprint(ctxcatcodes,format("\\pdfannot width %ssp height %ssp {%s}",width,height,annot())) -- brrrr
---~ if ref then -- wrong ! a direct ref should work
---~ texsprint(ctxcatcodes,format("\\smash{\\pdfrefximage%s\\relax}",ref)) -- brrrr
---~ end
- texsprint(ctxcatcodes,"\\stopfoundexternalfigure")
+ if trace_inclusion then
+ logs.report("figures","including u3d '%s': width %s, height %s",foundname,width,height)
+ end
+ context.startfoundexternalfigure(width .. "sp",height .. "sp")
+ context(function()
+ local annotation, preview, ref = backends.pdf.helpers.insert3d {
+ foundname = foundname,
+ width = width,
+ height = height,
+ factor = number.dimenfactors.bp,
+ display = dr.display,
+ controls = dr.controls,
+ label = dr.label,
+ }
+--~ print(annotation, preview, ref)
+ node.write(pdfannotation(width,height,0,annotation()))
+ end)
+ context.stopfoundexternalfigure()
return data
end
diff --git a/Master/texmf-dist/tex/context/base/hand-ini.mkiv b/Master/texmf-dist/tex/context/base/hand-ini.mkiv
index 41e9db415fb..0285b10cbb1 100644
--- a/Master/texmf-dist/tex/context/base/hand-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/hand-ini.mkiv
@@ -17,12 +17,36 @@
% \definefontfeature[demo][default][mode=node,expansion=quality]
% \definefontfeature[demo][default][mode=node,protrusion=pure]
+% experimental setup:
+%
+% \showframe \setupalign[hanging] \enabletrackers[fonts.protrusion]
+%
+% \definefontfeature[default] [default][mode=node,script=latn]
+% %definefontfeature[whatever][default][mode=node,lfbd=yes,rtbd=yes,script=latn]
+% \definefontfeature[whatever][default][mode=node,protrusion=quality]
+% \definefontfeature[whocares][default][mode=node,protrusion=yes,opbd=yes,script=latn] % left|right|yes
+%
+% \definedfont[fxlbi.otf*default] \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
+% \definedfont[fxlbi.otf*whatever] \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
+% \definedfont[fxlbi.otf*whocares] \input tufte 0123456789 \par \dorecurse{15}{1 2 3 4 5 6 7 8 9 0 } \par
+%
+% %definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea]
+% \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn]
+%
+% \definedfont[texgyrepagella-regularxx.otf*whocares] \input tufte
+
\unprotect
%D New stuff.
-\def\setupfontexpansion [#1][#2]{\ctxlua{commands.setupfontexpansion ("#1","#2")}}
-\def\setupfontprotrusion[#1][#2]{\ctxlua{commands.setupfontprotrusion("#1","#2")}}
+\unexpanded\def\setupfontexpansion {\dodoubleargument\dosetupfontexpansion }
+\unexpanded\def\setupfontprotrusion{\dodoubleargument\dosetupfontprotrusion}
+
+\def\dosetupfontexpansion [#1][#2]{\ctxlua{commands.setupfontexpansion ("#1","#2")}}
+\def\dosetupfontprotrusion[#1][#2]{\ctxlua{commands.setupfontprotrusion("#1","#2")}}
+
+% \setupfontprotrusion[quality-upright][vector=quality]
+% \setupfontprotrusion[quality-slanted][vector=quality,right=1.5]
%D Old stuff.
@@ -36,9 +60,9 @@
\appendtoks \disableadjusting \to \everyforgetall % Here or not here?
\appendtoks \disableprotruding \to \everyforgetall % Here or not here?
-\def\startfonthandling #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen
-\def\definefonthandling {\dotripleempty\dodefinefonthandling}
-\def\setupfonthandling {\dodoubleempty\dosetupfonthandling }
+\unexpanded\def\startfonthandling #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen
+\unexpanded\def\definefonthandling {\dotripleempty\dodefinefonthandling}
+\unexpanded\def\setupfonthandling {\dodoubleempty\dosetupfonthandling }
\def\dodefinefonthandling[#1][#2][#3]{\fonthandlingerror}
\def\dosetupfonthandling [#1][#2]{\fonthandlingerror}
\def\usehandling [#1]{\fonthandlingerror}
diff --git a/Master/texmf-dist/tex/context/base/java-ini.lua b/Master/texmf-dist/tex/context/base/java-ini.lua
index 161a1657e90..f64a8a18fb0 100644
--- a/Master/texmf-dist/tex/context/base/java-ini.lua
+++ b/Master/texmf-dist/tex/context/base/java-ini.lua
@@ -1,12 +1,13 @@
if not modules then modules = { } end modules ['java-ini'] = {
version = 1.001,
- comment = "companion to java-ini.tex",
+ comment = "companion to java-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 lpegmatch = lpeg.match
javascripts = javascripts or { }
javascripts.codes = javascripts.codes or { }
@@ -42,18 +43,18 @@ local parsepreamble = name * ((used * name) + lpeg.Cc("")) * spaces * script
local parsefunctions = (fname + any)^0
function javascripts.storecode(str)
- local name, uses, script = parsecode:match(str)
+ local name, uses, script = lpegmatch(parsecode,str)
if name and name ~= "" then
javascripts.codes[name] = { uses, script }
end
end
function javascripts.storepreamble(str) -- now later
- local name, used, script = parsepreamble:match(str)
+ local name, used, script = lpegmatch(parsepreamble,str)
if name and name ~= "" then
preambles[#preambles+1] = { name, used, script }
preambled[name] = #preambles
- parsefunctions:match(script)
+ lpegmatch(parsefunctions,script)
end
end
@@ -61,7 +62,7 @@ function javascripts.setpreamble(name,script) -- now later
if name and name ~= "" then
preambles[#preambles+1] = { name, "now", script }
preambled[name] = #preambles
- parsefunctions:match(script)
+ lpegmatch(parsefunctions,script)
end
end
@@ -73,7 +74,7 @@ function javascripts.addtopreamble(name,script) -- now later
else
preambles[#preambles+1] = { name, "now", script }
preambled[name] = #preambles
- parsefunctions:match(script)
+ lpegmatch(parsefunctions,script)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/l-aux.lua b/Master/texmf-dist/tex/context/base/l-aux.lua
index 0e5babeeb26..97063e3bca9 100644
--- a/Master/texmf-dist/tex/context/base/l-aux.lua
+++ b/Master/texmf-dist/tex/context/base/l-aux.lua
@@ -1,15 +1,27 @@
if not modules then modules = { } end modules ['l-aux'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
}
+-- for inline, no store split : for s in string.gmatch(str,",* *([^,]+)") do .. end
+
aux = aux or { }
local concat, format, gmatch = table.concat, string.format, string.gmatch
local tostring, type = tostring, type
+local lpegmatch = lpeg.match
+
+local P, R, V = lpeg.P, lpeg.R, lpeg.V
+
+local escape, left, right = P("\\"), P('{'), P('}')
+
+lpeg.patterns.balanced = P {
+ [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
+ [2] = left * V(1) * right
+}
local space = lpeg.P(' ')
local equal = lpeg.P("=")
@@ -17,7 +29,7 @@ local comma = lpeg.P(",")
local lbrace = lpeg.P("{")
local rbrace = lpeg.P("}")
local nobrace = 1 - (lbrace+rbrace)
-local nested = lpeg.P{ lbrace * (nobrace + lpeg.V(1))^0 * rbrace }
+local nested = lpeg.P { lbrace * (nobrace + lpeg.V(1))^0 * rbrace }
local spaces = space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
@@ -55,13 +67,13 @@ function aux.make_settings_to_hash_pattern(set,how)
end
end
-function aux.settings_to_hash(str)
+function aux.settings_to_hash(str,existing)
if str and str ~= "" then
- hash = { }
+ hash = existing or { }
if moretolerant then
- pattern_b_s:match(str)
+ lpegmatch(pattern_b_s,str)
else
- pattern_a_s:match(str)
+ lpegmatch(pattern_a_s,str)
end
return hash
else
@@ -69,39 +81,41 @@ function aux.settings_to_hash(str)
end
end
-function aux.settings_to_hash_tolerant(str)
+function aux.settings_to_hash_tolerant(str,existing)
if str and str ~= "" then
- hash = { }
- pattern_b_s:match(str)
+ hash = existing or { }
+ lpegmatch(pattern_b_s,str)
return hash
else
return { }
end
end
-function aux.settings_to_hash_strict(str)
+function aux.settings_to_hash_strict(str,existing)
if str and str ~= "" then
- hash = { }
- pattern_c_s:match(str)
+ hash = existing or { }
+ lpegmatch(pattern_c_s,str)
return next(hash) and hash
else
return nil
end
end
-local seperator = comma * space^0
+local separator = comma * space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
-local pattern = lpeg.Ct(value*(seperator*value)^0)
+local pattern = lpeg.Ct(value*(separator*value)^0)
-- "aap, {noot}, mies" : outer {} removes, leading spaces ignored
aux.settings_to_array_pattern = pattern
+-- we could use a weak table as cache
+
function aux.settings_to_array(str)
if not str or str == "" then
return { }
else
- return pattern:match(str)
+ return lpegmatch(pattern,str)
end
end
@@ -110,10 +124,10 @@ local function set(t,v)
end
local value = lpeg.P(lpeg.Carg(1)*value) / set
-local pattern = value*(seperator*value)^0 * lpeg.Carg(1)
+local pattern = value*(separator*value)^0 * lpeg.Carg(1)
function aux.add_settings_to_array(t,str)
- return pattern:match(str, nil, t)
+ return lpegmatch(pattern,str,nil,t)
end
function aux.hash_to_string(h,separator,yes,no,strict,omit)
@@ -161,6 +175,13 @@ function aux.settings_to_set(str,t)
return t
end
+local value = lbrace * lpeg.C((nobrace + nested)^0) * rbrace
+local pattern = lpeg.Ct((space + value)^0)
+
+function aux.arguments_to_table(str)
+ return lpegmatch(pattern,str)
+end
+
-- temporary here
function aux.getparameters(self,class,parentclass,settings)
@@ -169,36 +190,31 @@ function aux.getparameters(self,class,parentclass,settings)
sc = table.clone(self[parent])
self[class] = sc
end
- aux.add_settings_to_array(sc, settings)
+ aux.settings_to_hash(settings,sc)
end
-- temporary here
-local digit = lpeg.R("09")
-local period = lpeg.P(".")
-local zero = lpeg.P("0")
-
---~ local finish = lpeg.P(-1)
---~ local nodigit = (1-digit) + finish
---~ local case_1 = (period * zero^1 * #nodigit)/"" -- .000
---~ local case_2 = (period * (1-(zero^0/"") * #nodigit)^1 * (zero^0/"") * nodigit) -- .010 .10 .100100
-
+local digit = lpeg.R("09")
+local period = lpeg.P(".")
+local zero = lpeg.P("0")
local trailingzeros = zero^0 * -digit -- suggested by Roberto R
-local case_1 = period * trailingzeros / ""
-local case_2 = period * (digit - trailingzeros)^1 * (trailingzeros / "")
-
-local number = digit^1 * (case_1 + case_2)
-local stripper = lpeg.Cs((number + 1)^0)
+local case_1 = period * trailingzeros / ""
+local case_2 = period * (digit - trailingzeros)^1 * (trailingzeros / "")
+local number = digit^1 * (case_1 + case_2)
+local stripper = lpeg.Cs((number + 1)^0)
--~ local sample = "bla 11.00 bla 11 bla 0.1100 bla 1.00100 bla 0.00 bla 0.001 bla 1.1100 bla 0.100100100 bla 0.00100100100"
--~ collectgarbage("collect")
--~ str = string.rep(sample,10000)
--~ local ts = os.clock()
---~ stripper:match(str)
---~ print(#str, os.clock()-ts, stripper:match(sample))
+--~ lpegmatch(stripper,str)
+--~ print(#str, os.clock()-ts, lpegmatch(stripper,sample))
+
+lpeg.patterns.strip_zeros = stripper
function aux.strip_zeros(str)
- return stripper:match(str)
+ return lpegmatch(stripper,str)
end
function aux.definetable(target) -- defines undefined tables
@@ -221,3 +237,25 @@ function aux.accesstable(target)
end
return t
end
+
+--~ function string.commaseparated(str)
+--~ return gmatch(str,"([^,%s]+)")
+--~ end
+
+-- as we use this a lot ...
+
+--~ function aux.cachefunction(action,weak)
+--~ local cache = { }
+--~ if weak then
+--~ setmetatable(cache, { __mode = "kv" } )
+--~ end
+--~ local function reminder(str)
+--~ local found = cache[str]
+--~ if not found then
+--~ found = action(str)
+--~ cache[str] = found
+--~ end
+--~ return found
+--~ end
+--~ return reminder, cache
+--~ end
diff --git a/Master/texmf-dist/tex/context/base/l-boolean.lua b/Master/texmf-dist/tex/context/base/l-boolean.lua
index c8c919edaf2..be7ec7d5705 100644
--- a/Master/texmf-dist/tex/context/base/l-boolean.lua
+++ b/Master/texmf-dist/tex/context/base/l-boolean.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-boolean'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/l-dimen.lua b/Master/texmf-dist/tex/context/base/l-dimen.lua
index 32becb2768e..da5ab143e58 100644
--- a/Master/texmf-dist/tex/context/base/l-dimen.lua
+++ b/Master/texmf-dist/tex/context/base/l-dimen.lua
@@ -15,14 +15,20 @@ done by using the conversion factors collected in the following
table.</p>
--ldx]]--
-local format, type = string.format, type
+local format, match, gsub, type, setmetatable = string.format, string.match, string.gsub, type, setmetatable
+local P, S, R, Cc, lpegmatch = lpeg.P, lpeg.S, lpeg.R, lpeg.Cc, lpeg.match
+
+number = number or { }
+
+number.tonumberf = function(n) return match(format("%.20f",n),"(.-0?)0*$") end -- one zero too much but alas
+number.tonumberg = function(n) return format("%.20g",n) end
local dimenfactors = {
["pt"] = 1/65536,
["in"] = ( 100/ 7227)/65536,
["cm"] = ( 254/ 7227)/65536,
- ["mm"] = ( 254/72270)/65536,
- ["sp"] = 1,
+ ["mm"] = ( 2540/ 7227)/65536,
+ ["sp"] = 1, -- 65536 sp in 1pt
["bp"] = ( 7200/ 7227)/65536,
["pc"] = ( 1/ 12)/65536,
["dd"] = ( 1157/ 1238)/65536,
@@ -31,17 +37,62 @@ local dimenfactors = {
["nc"] = ( 5080/65043)/65536
}
+--~ print(table.serialize(dimenfactors))
+--~
+--~ %.99g:
+--~
+--~ t={
+--~ ["bp"]=1.5201782378580324e-005,
+--~ ["cc"]=1.1883696112892098e-006,
+--~ ["cm"]=5.3628510057769479e-007,
+--~ ["dd"]=1.4260435335470516e-005,
+--~ ["em"]=0.000152587890625,
+--~ ["ex"]=6.103515625e-005,
+--~ ["in"]=2.1113586636917117e-007,
+--~ ["mm"]=5.3628510057769473e-008,
+--~ ["nc"]=1.1917446679504327e-006,
+--~ ["nd"]=1.4300936015405194e-005,
+--~ ["pc"]=1.2715657552083333e-006,
+--~ ["pt"]=1.52587890625e-005,
+--~ ["sp"]=1,
+--~ }
+--~
+--~ patched %s and tonumber
+--~
+--~ t={
+--~ ["bp"]=0.00001520178238,
+--~ ["cc"]=0.00000118836961,
+--~ ["cm"]=0.0000005362851,
+--~ ["dd"]=0.00001426043534,
+--~ ["em"]=0.00015258789063,
+--~ ["ex"]=0.00006103515625,
+--~ ["in"]=0.00000021113587,
+--~ ["mm"]=0.00000005362851,
+--~ ["nc"]=0.00000119174467,
+--~ ["nd"]=0.00001430093602,
+--~ ["pc"]=0.00000127156576,
+--~ ["pt"]=0.00001525878906,
+--~ ["sp"]=1,
+--~ }
+
--[[ldx--
<p>A conversion function that takes a number, unit (string) and optional
format (string) is implemented using this table.</p>
--ldx]]--
+-- was:
+
local function todimen(n,unit,fmt)
if type(n) == 'string' then
return n
else
unit = unit or 'pt'
- return format(fmt or "%.5f%s",n*dimenfactors[unit],unit)
+ return format(fmt or "%s%s",n*dimenfactors[unit],unit)
+ -- if fmt then
+ -- return format(fmt,n*dimenfactors[unit],unit)
+ -- else
+ -- return match(format("%.20f",n*dimenfactors[unit]),"(.-0?)0*$") .. unit
+ -- end
end
end
@@ -49,8 +100,7 @@ end
<p>We collect a bunch of converters in the <type>number</type> namespace.</p>
--ldx]]--
-number = number or { }
-
+number.maxdimen = 1073741823
number.todimen = todimen
number.dimenfactors = dimenfactors
@@ -75,10 +125,12 @@ a number and optionally a unit. When no unit is given a constant
capture takes place.</p>
--ldx]]--
-local amount = (lpeg.S("+-")^0 * lpeg.R("09")^0 * lpeg.P(".")^0 * lpeg.R("09")^0) + lpeg.Cc("0")
-local unit = lpeg.R("az")^1
+local amount = (S("+-")^0 * R("09")^0 * P(".")^0 * R("09")^0) + Cc("0")
+local unit = R("az")^1
-local pattern = amount/tonumber * (unit^1/dimenfactors + lpeg.Cc(1)) -- tonumber is new
+local dimenpair = amount/tonumber * (unit^1/dimenfactors + Cc(1)) -- tonumber is new
+
+lpeg.patterns.dimenpair = dimenpair
--[[ldx--
<p>We use a metatable to intercept errors. When no key is found in
@@ -89,30 +141,37 @@ alternative index function.</p>
local mt = { } setmetatable(dimenfactors,mt)
mt.__index = function(t,s)
- error("wrong dimension: " .. s)
- return 1
+ -- error("wrong dimension: " .. (s or "?")) -- better a message
+ return false
end
function string:todimen()
if type(self) == "number" then
return self
else
- local value, unit = pattern:match(self)
- print(value,unit)
+ local value, unit = lpegmatch(dimenpair,self)
return value/unit
end
end
+local amount = S("+-")^0 * R("09")^0 * S(".,")^0 * R("09")^0
+local unit = P("pt") + P("cm") + P("mm") + P("sp") + P("bp") + P("in") +
+ P("pc") + P("dd") + P("cc") + P("nd") + P("nc")
+
+local validdimen = amount * unit
+
+lpeg.patterns.validdimen = pattern
+
--[[ldx--
<p>This converter accepts calls like:</p>
<typing>
-string.todimen("10"))
-string.todimen(".10"))
-string.todimen("10.0"))
-string.todimen("10.0pt"))
-string.todimen("10pt"))
-string.todimen("10.0pt"))
+string.todimen("10")
+string.todimen(".10")
+string.todimen("10.0")
+string.todimen("10.0pt")
+string.todimen("10pt")
+string.todimen("10.0pt")
</typing>
<p>And of course the often more efficient:</p>
@@ -145,7 +204,7 @@ function dimen(a)
if a then
local ta= type(a)
if ta == "string" then
- local value, unit = pattern:match(a)
+ local value, unit = lpegmatch(pattern,a)
if type(unit) == "function" then
k = value/unit()
else
@@ -262,7 +321,7 @@ is loaded, the relevant tables that hold the functions needed may not
yet be available.</p>
--ldx]]--
-function dimensions.texify()
+function dimensions.texify() -- todo: %
local fti, fc = fonts and fonts.ids and fonts.ids, font and font.current
if fti and fc then
dimenfactors["ex"] = function() return fti[fc()].ex_height end
@@ -312,7 +371,7 @@ function dimen(a)
if k then
a = k
else
- local value, unit = pattern:match(a)
+ local value, unit = lpegmatch(dimenpair,a)
if type(unit) == "function" then
k = value/unit()
else
@@ -336,7 +395,7 @@ function string:todimen()
else
local k = known[self]
if not k then
- local value, unit = pattern:match(self)
+ local value, unit = lpegmatch(dimenpair,self)
if value and unit then
k = value/unit
else
@@ -349,6 +408,10 @@ function string:todimen()
end
end
+function number.toscaled(d)
+ return format("0.5f",d/2^16)
+end
+
--[[ldx--
<p>In a similar fashion we can define a glue datatype. In that case we
probably use a hash instead of a one-element table.</p>
diff --git a/Master/texmf-dist/tex/context/base/l-dir.lua b/Master/texmf-dist/tex/context/base/l-dir.lua
index 5a726303f0c..2643f538b94 100644
--- a/Master/texmf-dist/tex/context/base/l-dir.lua
+++ b/Master/texmf-dist/tex/context/base/l-dir.lua
@@ -1,16 +1,25 @@
if not modules then modules = { } end modules ['l-dir'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
}
+-- dir.expand_name will be merged with cleanpath and collapsepath
+
local type = type
-local find, gmatch = string.find, string.gmatch
+local find, gmatch, match, gsub = string.find, string.gmatch, string.match, string.gsub
+local lpegmatch = lpeg.match
dir = dir or { }
+-- handy
+
+function dir.current()
+ return (gsub(lfs.currentdir(),"\\","/"))
+end
+
-- optimizing for no string.find (*) does not save time
local attributes = lfs.attributes
@@ -41,6 +50,35 @@ end
dir.glob_pattern = glob_pattern
+local function collect_pattern(path,patt,recurse,result)
+ local ok, scanner
+ result = result or { }
+ if path == "/" then
+ ok, scanner = xpcall(function() return walkdir(path..".") end, function() end) -- kepler safe
+ else
+ ok, scanner = xpcall(function() return walkdir(path) end, function() end) -- kepler safe
+ end
+ if ok and type(scanner) == "function" then
+ if not find(path,"/$") then path = path .. '/' end
+ for name in scanner do
+ local full = path .. name
+ local attr = attributes(full)
+ local mode = attr.mode
+ if mode == 'file' then
+ if find(full,patt) then
+ result[name] = attr
+ end
+ elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then
+ attr.list = collect_pattern(full,patt,recurse)
+ result[name] = attr
+ end
+ end
+ end
+ return result
+end
+
+dir.collect_pattern = collect_pattern
+
local P, S, R, C, Cc, Cs, Ct, Cv, V = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Cv, lpeg.V
local pattern = Ct {
@@ -60,29 +98,48 @@ local filter = Cs ( (
)^0 )
local function glob(str,t)
- if type(str) == "table" then
- local t = t or { }
- for s=1,#str do
- glob(str[s],t)
+ if type(t) == "function" then
+ if type(str) == "table" then
+ for s=1,#str do
+ glob(str[s],t)
+ end
+ elseif lfs.isfile(str) then
+ t(str)
+ else
+ local split = lpegmatch(pattern,str)
+ if split then
+ local root, path, base = split[1], split[2], split[3]
+ local recurse = find(base,"%*%*")
+ local start = root .. path
+ local result = lpegmatch(filter,start .. base)
+ glob_pattern(start,result,recurse,t)
+ end
end
- return t
- elseif lfs.isfile(str) then
- local t = t or { }
- t[#t+1] = str
- return t
else
- local split = pattern:match(str)
- if split then
+ if type(str) == "table" then
+ local t = t or { }
+ for s=1,#str do
+ glob(str[s],t)
+ end
+ return t
+ elseif lfs.isfile(str) then
local t = t or { }
- local action = action or function(name) t[#t+1] = name end
- local root, path, base = split[1], split[2], split[3]
- local recurse = find(base,"%*%*")
- local start = root .. path
- local result = filter:match(start .. base)
- glob_pattern(start,result,recurse,action)
+ t[#t+1] = str
return t
else
- return { }
+ local split = lpegmatch(pattern,str)
+ if split then
+ local t = t or { }
+ local action = action or function(name) t[#t+1] = name end
+ local root, path, base = split[1], split[2], split[3]
+ local recurse = find(base,"%*%*")
+ local start = root .. path
+ local result = lpegmatch(filter,start .. base)
+ glob_pattern(start,result,recurse,action)
+ return t
+ else
+ return { }
+ end
end
end
end
@@ -144,11 +201,12 @@ end
local make_indeed = true -- false
-if string.find(os.getenv("PATH"),";") then
+if string.find(os.getenv("PATH"),";") then -- os.type == "windows"
function dir.mkdirs(...)
- local str, pth = "", ""
- for _, s in ipairs({...}) do
+ local str, pth, t = "", "", { ... }
+ for i=1,#t do
+ local s = t[i]
if s ~= "" then
if str ~= "" then
str = str .. "/" .. s
@@ -159,13 +217,13 @@ if string.find(os.getenv("PATH"),";") then
end
local first, middle, last
local drive = false
- first, middle, last = str:match("^(//)(//*)(.*)$")
+ first, middle, last = match(str,"^(//)(//*)(.*)$")
if first then
-- empty network path == local path
else
- first, last = str:match("^(//)/*(.-)$")
+ first, last = match(str,"^(//)/*(.-)$")
if first then
- middle, last = str:match("([^/]+)/+(.-)$")
+ middle, last = match(str,"([^/]+)/+(.-)$")
if middle then
pth = "//" .. middle
else
@@ -173,11 +231,11 @@ if string.find(os.getenv("PATH"),";") then
last = ""
end
else
- first, middle, last = str:match("^([a-zA-Z]:)(/*)(.-)$")
+ first, middle, last = match(str,"^([a-zA-Z]:)(/*)(.-)$")
if first then
pth, drive = first .. middle, true
else
- middle, last = str:match("^(/*)(.-)$")
+ middle, last = match(str,"^(/*)(.-)$")
if not middle then
last = str
end
@@ -211,34 +269,31 @@ if string.find(os.getenv("PATH"),";") then
--~ print(dir.mkdirs("///a/b/c"))
--~ print(dir.mkdirs("a/bbb//ccc/"))
- function dir.expand_name(str)
- local first, nothing, last = str:match("^(//)(//*)(.*)$")
+ function dir.expand_name(str) -- will be merged with cleanpath and collapsepath
+ local first, nothing, last = match(str,"^(//)(//*)(.*)$")
if first then
- first = lfs.currentdir() .. "/"
- first = first:gsub("\\","/")
+ first = dir.current() .. "/"
end
if not first then
- first, last = str:match("^(//)/*(.*)$")
+ first, last = match(str,"^(//)/*(.*)$")
end
if not first then
- first, last = str:match("^([a-zA-Z]:)(.*)$")
+ first, last = match(str,"^([a-zA-Z]:)(.*)$")
if first and not find(last,"^/") then
local d = lfs.currentdir()
if lfs.chdir(first) then
- first = lfs.currentdir()
- first = first:gsub("\\","/")
+ first = dir.current()
end
lfs.chdir(d)
end
end
if not first then
- first, last = lfs.currentdir(), str
- first = first:gsub("\\","/")
+ first, last = dir.current(), str
end
- last = last:gsub("//","/")
- last = last:gsub("/%./","/")
- last = last:gsub("^/*","")
- first = first:gsub("/*$","")
+ last = gsub(last,"//","/")
+ last = gsub(last,"/%./","/")
+ last = gsub(last,"^/*","")
+ first = gsub(first,"/*$","")
if last == "" then
return first
else
@@ -249,8 +304,9 @@ if string.find(os.getenv("PATH"),";") then
else
function dir.mkdirs(...)
- local str, pth = "", ""
- for _, s in ipairs({...}) do
+ local str, pth, t = "", "", { ... }
+ for i=1,#t do
+ local s = t[i]
if s ~= "" then
if str ~= "" then
str = str .. "/" .. s
@@ -259,7 +315,7 @@ else
end
end
end
- str = str:gsub("/+","/")
+ str = gsub(str,"/+","/")
if find(str,"^/") then
pth = "/"
for s in gmatch(str,"[^/]+") do
@@ -293,12 +349,12 @@ else
--~ print(dir.mkdirs("///a/b/c"))
--~ print(dir.mkdirs("a/bbb//ccc/"))
- function dir.expand_name(str)
+ function dir.expand_name(str) -- will be merged with cleanpath and collapsepath
if not find(str,"^/") then
str = lfs.currentdir() .. "/" .. str
end
- str = str:gsub("//","/")
- str = str:gsub("/%./","/")
+ str = gsub(str,"//","/")
+ str = gsub(str,"/%./","/")
return str
end
diff --git a/Master/texmf-dist/tex/context/base/l-file.lua b/Master/texmf-dist/tex/context/base/l-file.lua
index 0782ac67634..2bfc0709007 100644
--- a/Master/texmf-dist/tex/context/base/l-file.lua
+++ b/Master/texmf-dist/tex/context/base/l-file.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-file'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -11,14 +11,17 @@ if not modules then modules = { } end modules ['l-file'] = {
file = file or { }
local concat = table.concat
-local find, gmatch, match, gsub = string.find, string.gmatch, string.match, string.gsub
+local find, gmatch, match, gsub, sub, char = string.find, string.gmatch, string.match, string.gsub, string.sub, string.char
+local lpegmatch = lpeg.match
function file.removesuffix(filename)
return (gsub(filename,"%.[%a%d]+$",""))
end
function file.addsuffix(filename, suffix)
- if not find(filename,"%.[%a%d]+$") then
+ if not suffix or suffix == "" then
+ return filename
+ elseif not find(filename,"%.[%a%d]+$") then
return filename .. "." .. suffix
else
return filename
@@ -41,20 +44,39 @@ function file.nameonly(name)
return (gsub(match(name,"^.+[/\\](.-)$") or name,"%..*$",""))
end
-function file.extname(name)
- return match(name,"^.+%.([^/\\]-)$") or ""
+function file.extname(name,default)
+ return match(name,"^.+%.([^/\\]-)$") or default or ""
end
file.suffix = file.extname
---~ print(file.join("x/","/y"))
---~ print(file.join("http://","/y"))
---~ print(file.join("http://a","/y"))
---~ print(file.join("http:///a","/y"))
---~ print(file.join("//nas-1","/y"))
+--~ function file.join(...)
+--~ local pth = concat({...},"/")
+--~ pth = gsub(pth,"\\","/")
+--~ local a, b = match(pth,"^(.*://)(.*)$")
+--~ if a and b then
+--~ return a .. gsub(b,"//+","/")
+--~ end
+--~ a, b = match(pth,"^(//)(.*)$")
+--~ if a and b then
+--~ return a .. gsub(b,"//+","/")
+--~ end
+--~ return (gsub(pth,"//+","/"))
+--~ end
+
+local trick_1 = char(1)
+local trick_2 = "^" .. trick_1 .. "/+"
function file.join(...)
- local pth = concat({...},"/")
+ local lst = { ... }
+ local a, b = lst[1], lst[2]
+ if a == "" then
+ lst[1] = trick_1
+ elseif b and find(a,"^/+$") and find(b,"^/") then
+ lst[1] = ""
+ lst[2] = gsub(b,"^/+","")
+ end
+ local pth = concat(lst,"/")
pth = gsub(pth,"\\","/")
local a, b = match(pth,"^(.*://)(.*)$")
if a and b then
@@ -64,17 +86,28 @@ function file.join(...)
if a and b then
return a .. gsub(b,"//+","/")
end
+ pth = gsub(pth,trick_2,"")
return (gsub(pth,"//+","/"))
end
+--~ print(file.join("//","/y"))
+--~ print(file.join("/","/y"))
+--~ print(file.join("","/y"))
+--~ print(file.join("/x/","/y"))
+--~ print(file.join("x/","/y"))
+--~ print(file.join("http://","/y"))
+--~ print(file.join("http://a","/y"))
+--~ print(file.join("http:///a","/y"))
+--~ print(file.join("//nas-1","/y"))
+
function file.iswritable(name)
local a = lfs.attributes(name) or lfs.attributes(file.dirname(name,"."))
- return a and a.permissions:sub(2,2) == "w"
+ return a and sub(a.permissions,2,2) == "w"
end
function file.isreadable(name)
local a = lfs.attributes(name)
- return a and a.permissions:sub(1,1) == "r"
+ return a and sub(a.permissions,1,1) == "r"
end
file.is_readable = file.isreadable
@@ -82,36 +115,50 @@ file.is_writable = file.iswritable
-- todo: lpeg
-function file.split_path(str)
- local t = { }
- str = gsub(str,"\\", "/")
- str = gsub(str,"(%a):([;/])", "%1\001%2")
- for name in gmatch(str,"([^;:]+)") do
- if name ~= "" then
- t[#t+1] = gsub(name,"\001",":")
- end
- end
- return t
+--~ function file.split_path(str)
+--~ local t = { }
+--~ str = gsub(str,"\\", "/")
+--~ str = gsub(str,"(%a):([;/])", "%1\001%2")
+--~ for name in gmatch(str,"([^;:]+)") do
+--~ if name ~= "" then
+--~ t[#t+1] = gsub(name,"\001",":")
+--~ end
+--~ end
+--~ return t
+--~ end
+
+local checkedsplit = string.checkedsplit
+
+function file.split_path(str,separator)
+ str = gsub(str,"\\","/")
+ return checkedsplit(str,separator or io.pathseparator)
end
function file.join_path(tab)
return concat(tab,io.pathseparator) -- can have trailing //
end
+-- we can hash them weakly
+
function file.collapse_path(str)
- str = gsub(str,"/%./","/")
- local n, m = 1, 1
- while n > 0 or m > 0 do
- str, n = gsub(str,"[^/%.]+/%.%.$","")
- str, m = gsub(str,"[^/%.]+/%.%./","")
+ str = gsub(str,"\\","/")
+ if find(str,"/") then
+ str = gsub(str,"^%./",(gsub(lfs.currentdir(),"\\","/")) .. "/") -- ./xx in qualified
+ str = gsub(str,"/%./","/")
+ local n, m = 1, 1
+ while n > 0 or m > 0 do
+ str, n = gsub(str,"[^/%.]+/%.%.$","")
+ str, m = gsub(str,"[^/%.]+/%.%./","")
+ end
+ str = gsub(str,"([^/])/$","%1")
+ -- str = gsub(str,"^%./","") -- ./xx in qualified
+ str = gsub(str,"/%.$","")
end
- str = gsub(str,"([^/])/$","%1")
- str = gsub(str,"^%./","")
- str = gsub(str,"/%.$","")
if str == "" then str = "." end
return str
end
+--~ print(file.collapse_path("/a"))
--~ print(file.collapse_path("a/./b/.."))
--~ print(file.collapse_path("a/aa/../b/bb"))
--~ print(file.collapse_path("a/../.."))
@@ -141,27 +188,27 @@ end
--~ local pattern = (noslashes^0 * slashes)^0 * (noperiod^1 * period)^1 * lpeg.C(noperiod^1) * -1
--~ function file.extname(name)
---~ return pattern:match(name) or ""
+--~ return lpegmatch(pattern,name) or ""
--~ end
--~ local pattern = lpeg.Cs(((period * noperiod^1 * -1)/"" + 1)^1)
--~ function file.removesuffix(name)
---~ return pattern:match(name)
+--~ return lpegmatch(pattern,name)
--~ end
--~ local pattern = (noslashes^0 * slashes)^1 * lpeg.C(noslashes^1) * -1
--~ function file.basename(name)
---~ return pattern:match(name) or name
+--~ return lpegmatch(pattern,name) or name
--~ end
--~ local pattern = (noslashes^0 * slashes)^1 * lpeg.Cp() * noslashes^1 * -1
--~ function file.dirname(name)
---~ local p = pattern:match(name)
+--~ local p = lpegmatch(pattern,name)
--~ if p then
---~ return name:sub(1,p-2)
+--~ return sub(name,1,p-2)
--~ else
--~ return ""
--~ end
@@ -170,7 +217,7 @@ end
--~ local pattern = (noslashes^0 * slashes)^0 * (noperiod^1 * period)^1 * lpeg.Cp() * noperiod^1 * -1
--~ function file.addsuffix(name, suffix)
---~ local p = pattern:match(name)
+--~ local p = lpegmatch(pattern,name)
--~ if p then
--~ return name
--~ else
@@ -181,9 +228,9 @@ end
--~ local pattern = (noslashes^0 * slashes)^0 * (noperiod^1 * period)^1 * lpeg.Cp() * noperiod^1 * -1
--~ function file.replacesuffix(name,suffix)
---~ local p = pattern:match(name)
+--~ local p = lpegmatch(pattern,name)
--~ if p then
---~ return name:sub(1,p-2) .. "." .. suffix
+--~ return sub(name,1,p-2) .. "." .. suffix
--~ else
--~ return name .. "." .. suffix
--~ end
@@ -192,11 +239,11 @@ end
--~ local pattern = (noslashes^0 * slashes)^0 * lpeg.Cp() * ((noperiod^1 * period)^1 * lpeg.Cp() + lpeg.P(true)) * noperiod^1 * -1
--~ function file.nameonly(name)
---~ local a, b = pattern:match(name)
+--~ local a, b = lpegmatch(pattern,name)
--~ if b then
---~ return name:sub(a,b-2)
+--~ return sub(name,a,b-2)
--~ elseif a then
---~ return name:sub(a)
+--~ return sub(name,a)
--~ else
--~ return name
--~ end
@@ -230,11 +277,11 @@ local rootbased = lpeg.P("/") + letter*lpeg.P(":")
-- ./name ../name /name c: :// name/name
function file.is_qualified_path(filename)
- return qualified:match(filename)
+ return lpegmatch(qualified,filename) ~= nil
end
function file.is_rootbased_path(filename)
- return rootbased:match(filename)
+ return lpegmatch(rootbased,filename) ~= nil
end
local slash = lpeg.S("\\/")
@@ -247,12 +294,21 @@ local base = lpeg.C((1-suffix)^0)
local pattern = (drive + lpeg.Cc("")) * (path + lpeg.Cc("")) * (base + lpeg.Cc("")) * (suffix + lpeg.Cc(""))
function file.splitname(str) -- returns drive, path, base, suffix
- return pattern:match(str)
+ return lpegmatch(pattern,str)
end
--- function test(t) for k, v in pairs(t) do print(v, "=>", file.splitname(v)) end end
+-- function test(t) for k, v in next, t do print(v, "=>", file.splitname(v)) end end
--
-- test { "c:", "c:/aa", "c:/aa/bb", "c:/aa/bb/cc", "c:/aa/bb/cc.dd", "c:/aa/bb/cc.dd.ee" }
-- test { "c:", "c:aa", "c:aa/bb", "c:aa/bb/cc", "c:aa/bb/cc.dd", "c:aa/bb/cc.dd.ee" }
-- test { "/aa", "/aa/bb", "/aa/bb/cc", "/aa/bb/cc.dd", "/aa/bb/cc.dd.ee" }
-- test { "aa", "aa/bb", "aa/bb/cc", "aa/bb/cc.dd", "aa/bb/cc.dd.ee" }
+
+--~ -- todo:
+--~
+--~ if os.type == "windows" then
+--~ local currentdir = lfs.currentdir
+--~ function lfs.currentdir()
+--~ return (gsub(currentdir(),"\\","/"))
+--~ end
+--~ end
diff --git a/Master/texmf-dist/tex/context/base/l-io.lua b/Master/texmf-dist/tex/context/base/l-io.lua
index bcdf8791e3e..66e279309fb 100644
--- a/Master/texmf-dist/tex/context/base/l-io.lua
+++ b/Master/texmf-dist/tex/context/base/l-io.lua
@@ -1,12 +1,12 @@
if not modules then modules = { } end modules ['l-io'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 = string.byte
+local byte, find, gsub = string.byte, string.find, string.gsub
if string.find(os.getenv("PATH"),";") then
io.fileseparator, io.pathseparator = "\\", ";"
@@ -35,7 +35,7 @@ function io.savedata(filename,data,joiner)
elseif type(data) == "function" then
data(f)
else
- f:write(data)
+ f:write(data or "")
end
f:close()
return true
@@ -164,20 +164,21 @@ function io.ask(question,default,options)
end
io.write(string.format(" "))
local answer = io.read()
- answer = answer:gsub("^%s*(.*)%s*$","%1")
+ answer = gsub(answer,"^%s*(.*)%s*$","%1")
if answer == "" and default then
return default
elseif not options then
return answer
else
- for _,v in pairs(options) do
- if v == answer then
+ for k=1,#options do
+ if options[k] == answer then
return answer
end
end
local pattern = "^" .. answer
- for _,v in pairs(options) do
- if v:find(pattern) then
+ for k=1,#options do
+ local v = options[k]
+ if find(v,pattern) then
return v
end
end
diff --git a/Master/texmf-dist/tex/context/base/l-lpeg.lua b/Master/texmf-dist/tex/context/base/l-lpeg.lua
index 88b445717f6..b107a8e6432 100644
--- a/Master/texmf-dist/tex/context/base/l-lpeg.lua
+++ b/Master/texmf-dist/tex/context/base/l-lpeg.lua
@@ -1,57 +1,63 @@
if not modules then modules = { } end modules ['l-lpeg'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 P, S, Ct, C, Cs, Cc = lpeg.P, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc
-
---~ l-lpeg.lua :
-
---~ lpeg.digit = lpeg.R('09')^1
---~ lpeg.sign = lpeg.S('+-')^1
---~ lpeg.cardinal = lpeg.P(lpeg.sign^0 * lpeg.digit^1)
---~ lpeg.integer = lpeg.P(lpeg.sign^0 * lpeg.digit^1)
---~ lpeg.float = lpeg.P(lpeg.sign^0 * lpeg.digit^0 * lpeg.P('.') * lpeg.digit^1)
---~ lpeg.number = lpeg.float + lpeg.integer
---~ lpeg.oct = lpeg.P("0") * lpeg.R('07')^1
---~ lpeg.hex = lpeg.P("0x") * (lpeg.R('09') + lpeg.R('AF'))^1
---~ lpeg.uppercase = lpeg.P("AZ")
---~ lpeg.lowercase = lpeg.P("az")
-
---~ lpeg.eol = lpeg.S('\r\n\f')^1 -- includes formfeed
---~ lpeg.space = lpeg.S(' ')^1
---~ lpeg.nonspace = lpeg.P(1-lpeg.space)^1
---~ lpeg.whitespace = lpeg.S(' \r\n\f\t')^1
---~ lpeg.nonwhitespace = lpeg.P(1-lpeg.whitespace)^1
-
-local hash = { }
+local lpeg = require("lpeg")
+
+lpeg.patterns = lpeg.patterns or { } -- so that we can share
+local patterns = lpeg.patterns
+
+local P, R, S, Ct, C, Cs, Cc, V = lpeg.P, lpeg.R, lpeg.S, lpeg.Ct, lpeg.C, lpeg.Cs, lpeg.Cc, lpeg.V
+local match = lpeg.match
+
+local digit, sign = R('09'), S('+-')
+local cr, lf, crlf = P("\r"), P("\n"), P("\r\n")
+local utf8byte = R("\128\191")
+
+patterns.utf8byte = utf8byte
+patterns.utf8one = R("\000\127")
+patterns.utf8two = R("\194\223") * utf8byte
+patterns.utf8three = R("\224\239") * utf8byte * utf8byte
+patterns.utf8four = R("\240\244") * utf8byte * utf8byte * utf8byte
+
+patterns.digit = digit
+patterns.sign = sign
+patterns.cardinal = sign^0 * digit^1
+patterns.integer = sign^0 * digit^1
+patterns.float = sign^0 * digit^0 * P('.') * digit^1
+patterns.number = patterns.float + patterns.integer
+patterns.oct = P("0") * R("07")^1
+patterns.octal = patterns.oct
+patterns.HEX = P("0x") * R("09","AF")^1
+patterns.hex = P("0x") * R("09","af")^1
+patterns.hexadecimal = P("0x") * R("09","AF","af")^1
+patterns.lowercase = R("az")
+patterns.uppercase = R("AZ")
+patterns.letter = patterns.lowercase + patterns.uppercase
+patterns.space = S(" ")
+patterns.eol = S("\n\r")
+patterns.spacer = S(" \t\f\v") -- + string.char(0xc2, 0xa0) if we want utf (cf mail roberto)
+patterns.newline = crlf + cr + lf
+patterns.nonspace = 1 - patterns.space
+patterns.nonspacer = 1 - patterns.spacer
+patterns.whitespace = patterns.eol + patterns.spacer
+patterns.nonwhitespace = 1 - patterns.whitespace
+patterns.utf8 = patterns.utf8one + patterns.utf8two + patterns.utf8three + patterns.utf8four
+patterns.utfbom = P('\000\000\254\255') + P('\255\254\000\000') + P('\255\254') + P('\254\255') + P('\239\187\191')
function lpeg.anywhere(pattern) --slightly adapted from website
- return P { P(pattern) + 1 * lpeg.V(1) }
-end
-
-function lpeg.startswith(pattern) --slightly adapted
- return P(pattern)
+ return P { P(pattern) + 1 * V(1) } -- why so complex?
end
function lpeg.splitter(pattern, action)
return (((1-P(pattern))^1)/action+1)^0
end
--- variant:
-
---~ local parser = lpeg.Ct(lpeg.splitat(newline))
-
-local crlf = P("\r\n")
-local cr = P("\r")
-local lf = P("\n")
-local space = S(" \t\f\v") -- + string.char(0xc2, 0xa0) if we want utf (cf mail roberto)
-local newline = crlf + cr + lf
-local spacing = space^0 * newline
-
+local spacing = patterns.spacer^0 * patterns.newline -- sort of strip
local empty = spacing * Cc("")
local nonempty = Cs((1-spacing)^1) * spacing^-1
local content = (empty + nonempty)^1
@@ -59,15 +65,15 @@ local content = (empty + nonempty)^1
local capture = Ct(content^0)
function string:splitlines()
- return capture:match(self)
+ return match(capture,self)
end
-lpeg.linebyline = content -- better make a sublibrary
+patterns.textline = content
---~ local p = lpeg.splitat("->",false) print(p:match("oeps->what->more")) -- oeps what more
---~ local p = lpeg.splitat("->",true) print(p:match("oeps->what->more")) -- oeps what->more
---~ local p = lpeg.splitat("->",false) print(p:match("oeps")) -- oeps
---~ local p = lpeg.splitat("->",true) print(p:match("oeps")) -- oeps
+--~ local p = lpeg.splitat("->",false) print(match(p,"oeps->what->more")) -- oeps what more
+--~ local p = lpeg.splitat("->",true) print(match(p,"oeps->what->more")) -- oeps what->more
+--~ local p = lpeg.splitat("->",false) print(match(p,"oeps")) -- oeps
+--~ local p = lpeg.splitat("->",true) print(match(p,"oeps")) -- oeps
local splitters_s, splitters_m = { }, { }
@@ -77,7 +83,7 @@ local function splitat(separator,single)
separator = P(separator)
if single then
local other, any = C((1 - separator)^0), P(1)
- splitter = other * (separator * C(any^0) + "")
+ splitter = other * (separator * C(any^0) + "") -- ?
splitters_s[separator] = splitter
else
local other = C((1 - separator)^0)
@@ -92,11 +98,68 @@ lpeg.splitat = splitat
local cache = { }
+function lpeg.split(separator,str)
+ local c = cache[separator]
+ if not c then
+ c = Ct(splitat(separator))
+ cache[separator] = c
+ end
+ return match(c,str)
+end
+
function string:split(separator)
local c = cache[separator]
if not c then
c = Ct(splitat(separator))
cache[separator] = c
end
- return c:match(self)
+ return match(c,self)
+end
+
+lpeg.splitters = cache
+
+local cache = { }
+
+function lpeg.checkedsplit(separator,str)
+ local c = cache[separator]
+ if not c then
+ separator = P(separator)
+ local other = C((1 - separator)^0)
+ c = Ct(separator^0 * other * (separator^1 * other)^0)
+ cache[separator] = c
+ end
+ return match(c,str)
end
+
+function string:checkedsplit(separator)
+ local c = cache[separator]
+ if not c then
+ separator = P(separator)
+ local other = C((1 - separator)^0)
+ c = Ct(separator^0 * other * (separator^1 * other)^0)
+ cache[separator] = c
+ end
+ return match(c,self)
+end
+
+--~ function lpeg.append(list,pp)
+--~ local p = pp
+--~ for l=1,#list do
+--~ if p then
+--~ p = p + P(list[l])
+--~ else
+--~ p = P(list[l])
+--~ end
+--~ end
+--~ return p
+--~ end
+
+--~ from roberto's site:
+
+local f1 = string.byte
+
+local function f2(s) local c1, c2 = f1(s,1,2) return c1 * 64 + c2 - 12416 end
+local function f3(s) local c1, c2, c3 = f1(s,1,3) return (c1 * 64 + c2) * 64 + c3 - 925824 end
+local function f4(s) local c1, c2, c3, c4 = f1(s,1,4) return ((c1 * 64 + c2) * 64 + c3) * 64 + c4 - 63447168 end
+
+patterns.utf8byte = patterns.utf8one/f1 + patterns.utf8two/f2 + patterns.utf8three/f3 + patterns.utf8four/f4
diff --git a/Master/texmf-dist/tex/context/base/l-math.lua b/Master/texmf-dist/tex/context/base/l-math.lua
index bfb3d506b0c..fc8db472142 100644
--- a/Master/texmf-dist/tex/context/base/l-math.lua
+++ b/Master/texmf-dist/tex/context/base/l-math.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-math'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/l-md5.lua b/Master/texmf-dist/tex/context/base/l-md5.lua
index 8640ad54e22..27955ef9b9e 100644
--- a/Master/texmf-dist/tex/context/base/l-md5.lua
+++ b/Master/texmf-dist/tex/context/base/l-md5.lua
@@ -57,7 +57,7 @@ end
function file.loadchecksum(name)
if md5 then
local data = io.loaddata(name .. ".md5")
- return data and data:gsub("%s","")
+ return data and (gsub(data,"%s",""))
end
return nil
end
diff --git a/Master/texmf-dist/tex/context/base/l-number.lua b/Master/texmf-dist/tex/context/base/l-number.lua
index 18d488a1aaf..a1249f0556a 100644
--- a/Master/texmf-dist/tex/context/base/l-number.lua
+++ b/Master/texmf-dist/tex/context/base/l-number.lua
@@ -1,19 +1,21 @@
if not modules then modules = { } end modules ['l-number'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 = string.format
+local tostring = tostring
+local format, floor, insert, match = string.format, math.floor, table.insert, string.match
+local lpegmatch = lpeg.match
number = number or { }
-- a,b,c,d,e,f = number.toset(100101)
function number.toset(n)
- return (tostring(n)):match("(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)")
+ return match(tostring(n),"(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)")
end
function number.toevenhex(n)
@@ -39,7 +41,18 @@ end
local one = lpeg.C(1-lpeg.S(''))^1
function number.toset(n)
- return one:match(tostring(n))
+ return lpegmatch(one,tostring(n))
end
-
+function number.bits(n,zero)
+ local t, i = { }, (zero and 0) or 1
+ while n > 0 do
+ local m = n % 2
+ if m > 0 then
+ insert(t,1,i)
+ end
+ n = floor(n/2)
+ i = i + 1
+ end
+ return t
+end
diff --git a/Master/texmf-dist/tex/context/base/l-os.lua b/Master/texmf-dist/tex/context/base/l-os.lua
index 47b47fa4f60..fba2cd31770 100644
--- a/Master/texmf-dist/tex/context/base/l-os.lua
+++ b/Master/texmf-dist/tex/context/base/l-os.lua
@@ -1,45 +1,62 @@
if not modules then modules = { } end modules ['l-os'] = {
version = 1.001,
- comment = "companion to luat-lub.tex",
+ 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 find = string.find
+-- maybe build io.flush in os.execute
+
+local find, format, gsub = string.find, string.format, string.gsub
+local random, ceil = math.random, math.ceil
+
+local execute, spawn, exec, ioflush = os.execute, os.spawn or os.execute, os.exec or os.execute, io.flush
+
+function os.execute(...) ioflush() return execute(...) end
+function os.spawn (...) ioflush() return spawn (...) end
+function os.exec (...) ioflush() return exec (...) end
function os.resultof(command)
- return io.popen(command,"r"):read("*all")
+ ioflush() -- else messed up logging
+ local handle = io.popen(command,"r")
+ if not handle then
+ -- print("unknown command '".. command .. "' in os.resultof")
+ return ""
+ else
+ return handle:read("*all") or ""
+ end
end
-if not os.exec then os.exec = os.execute end
-if not os.spawn then os.spawn = os.execute end
-
---~ os.type : windows | unix (new, we already guessed os.platform)
---~ os.name : windows | msdos | linux | macosx | solaris | .. | generic (new)
+--~ os.type : windows | unix (new, we already guessed os.platform)
+--~ os.name : windows | msdos | linux | macosx | solaris | .. | generic (new)
+--~ os.platform : extended os.name with architecture
if not io.fileseparator then
if find(os.getenv("PATH"),";") then
- io.fileseparator, io.pathseparator, os.platform = "\\", ";", os.type or "windows"
+ io.fileseparator, io.pathseparator, os.type = "\\", ";", os.type or "mswin"
else
- io.fileseparator, io.pathseparator, os.platform = "/" , ":", os.type or "unix"
+ io.fileseparator, io.pathseparator, os.type = "/" , ":", os.type or "unix"
end
end
-os.platform = os.platform or os.type or (io.pathseparator == ";" and "windows") or "unix"
+os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
+os.name = os.name or (os.type == "windows" and "mswin" ) or "linux"
+
+if os.type == "windows" then
+ os.libsuffix, os.binsuffix = 'dll', 'exe'
+else
+ os.libsuffix, os.binsuffix = 'so', ''
+end
function os.launch(str)
- if os.platform == "windows" then
+ if os.type == "windows" then
os.execute("start " .. str) -- os.spawn ?
else
os.execute(str .. " &") -- os.spawn ?
end
end
-if not os.setenv then
- function os.setenv() return false end
-end
-
if not os.times then
-- utime = user time
-- stime = system time
@@ -69,62 +86,216 @@ end
--~ print(os.date("%H:%M:%S",os.gettimeofday()))
--~ print(os.date("%H:%M:%S",os.time()))
-os.arch = os.arch or function()
- local a = os.resultof("uname -m") or "linux"
- os.arch = function()
- return a
+-- no need for function anymore as we have more clever code and helpers now
+-- this metatable trickery might as well disappear
+
+os.resolvers = os.resolvers or { }
+
+local resolvers = os.resolvers
+
+local osmt = getmetatable(os) or { __index = function(t,k) t[k] = "unset" return "unset" end } -- maybe nil
+local osix = osmt.__index
+
+osmt.__index = function(t,k)
+ return (resolvers[k] or osix)(t,k)
+end
+
+setmetatable(os,osmt)
+
+if not os.setenv then
+
+ -- we still store them but they won't be seen in
+ -- child processes although we might pass them some day
+ -- using command concatination
+
+ local env, getenv = { }, os.getenv
+
+ function os.setenv(k,v)
+ env[k] = v
+ end
+
+ function os.getenv(k)
+ return env[k] or getenv(k)
end
- return a
+
end
-local platform
-
-function os.currentplatform(name,default)
- if not platform then
- local name = os.name or os.platform or name -- os.name is built in, os.platform is mine
- if not name then
- platform = default or "linux"
- elseif name == "windows" or name == "mswin" or name == "win32" or name == "msdos" then
- if os.getenv("PROCESSOR_ARCHITECTURE") == "AMD64" then
- platform = "mswin-64"
- else
- platform = "mswin"
- end
+-- we can use HOSTTYPE on some platforms
+
+local name, platform = os.name or "linux", os.getenv("MTX_PLATFORM") or ""
+
+local function guess()
+ local architecture = os.resultof("uname -m") or ""
+ if architecture ~= "" then
+ return architecture
+ end
+ architecture = os.getenv("HOSTTYPE") or ""
+ if architecture ~= "" then
+ return architecture
+ end
+ return os.resultof("echo $HOSTTYPE") or ""
+end
+
+if platform ~= "" then
+
+ os.platform = platform
+
+elseif os.type == "windows" then
+
+ -- we could set the variable directly, no function needed here
+
+ function os.resolvers.platform(t,k)
+ local platform, architecture = "", os.getenv("PROCESSOR_ARCHITECTURE") or ""
+ if find(architecture,"AMD64") then
+ platform = "mswin-64"
+ else
+ platform = "mswin"
+ end
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+elseif name == "linux" then
+
+ function os.resolvers.platform(t,k)
+ -- we sometims have HOSTTYPE set so let's check that first
+ local platform, architecture = "", os.getenv("HOSTTYPE") or os.resultof("uname -m") or ""
+ if find(architecture,"x86_64") then
+ platform = "linux-64"
+ elseif find(architecture,"ppc") then
+ platform = "linux-ppc"
+ else
+ platform = "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 os.resolvers.platform(t,k)
+ -- local platform, architecture = "", os.getenv("HOSTTYPE") or ""
+ -- if architecture == "" then
+ -- architecture = os.resultof("echo $HOSTTYPE") or ""
+ -- end
+ local platform, architecture = "", os.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") then
+ platform = "osx-intel"
+ elseif find(architecture,"x86_64") then
+ platform = "osx-64"
+ else
+ platform = "osx-ppc"
+ end
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+elseif name == "sunos" then
+
+ function os.resolvers.platform(t,k)
+ local platform, architecture = "", os.resultof("uname -m") or ""
+ if find(architecture,"sparc") then
+ platform = "solaris-sparc"
+ else -- if architecture == 'i86pc'
+ platform = "solaris-intel"
+ end
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+elseif name == "freebsd" then
+
+ function os.resolvers.platform(t,k)
+ local platform, architecture = "", os.resultof("uname -m") or ""
+ if find(architecture,"amd64") then
+ platform = "freebsd-amd64"
+ else
+ platform = "freebsd"
+ end
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+elseif name == "kfreebsd" then
+
+ function os.resolvers.platform(t,k)
+ -- we sometims have HOSTTYPE set so let's check that first
+ local platform, architecture = "", os.getenv("HOSTTYPE") or os.resultof("uname -m") or ""
+ if find(architecture,"x86_64") then
+ platform = "kfreebsd-64"
else
- local architecture = os.arch()
- if name == "linux" then
- if find(architecture,"x86_64") then
- platform = "linux-64"
- elseif find(architecture,"ppc") then
- platform = "linux-ppc"
- else
- platform = "linux"
- end
- elseif name == "macosx" then
- if find(architecture,"i386") then
- platform = "osx-intel"
- else
- platform = "osx-ppc"
- end
- elseif name == "sunos" then
- if find(architecture,"sparc") then
- platform = "solaris-sparc"
- else -- if architecture == 'i86pc'
- platform = "solaris-intel"
- end
- elseif name == "freebsd" then
- if find(architecture,"amd64") then
- platform = "freebsd-amd64"
- else
- platform = "freebsd"
- end
- else
- platform = default or name
- end
+ platform = "kfreebsd-i386"
end
- function os.currentplatform()
- return platform
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+else
+
+ -- platform = "linux"
+ -- os.setenv("MTX_PLATFORM",platform)
+ -- os.platform = platform
+
+ function os.resolvers.platform(t,k)
+ local platform = "linux"
+ os.setenv("MTX_PLATFORM",platform)
+ os.platform = platform
+ return platform
+ end
+
+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)
+ )
+end
+
+local d
+
+function os.timezone(delta)
+ d = d or tonumber(tonumber(os.date("%H")-os.date("!%H")))
+ if delta then
+ if d > 0 then
+ return format("+%02i:00",d)
+ else
+ return format("-%02i:00",-d)
end
+ else
+ return 1
end
- return platform
end
diff --git a/Master/texmf-dist/tex/context/base/l-pdfview.lua b/Master/texmf-dist/tex/context/base/l-pdfview.lua
new file mode 100644
index 00000000000..627477ee823
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/l-pdfview.lua
@@ -0,0 +1,95 @@
+if not modules then modules = { } end modules ['l-pdfview'] = {
+ version = 1.001,
+ comment = "companion to mtx-context.lua",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, getenv = string.format, os.getenv
+
+pdfview = pdfview or { }
+
+local opencalls = {
+ ['default'] = "pdfopen --file", -- "pdfopen --back --file"
+ ['xpdf'] = "xpdfopen",
+}
+
+local closecalls= {
+ ['default'] = "pdfclose --file",
+ ['xpdf'] = nil,
+}
+
+local allcalls = {
+ ['default'] = "pdfclose --all",
+ ['xpdf'] = nil,
+}
+
+if os.type == "windows" then
+ opencalls['okular'] = 'start "test" "c:/program files/kde/bin/okular.exe" --unique' -- todo: get focus
+else
+ opencalls['okular'] = 'okular --unique'
+end
+
+pdfview.METHOD = "MTX_PDFVIEW_METHOD"
+pdfview.method = getenv(pdfview.METHOD) or 'default'
+pdfview.method = (opencalls[pdfview.method] and pdfview.method) or 'default'
+
+function pdfview.methods()
+ return table.concat(table.sortedkeys(opencalls), " ")
+end
+
+function pdfview.status()
+ return format("pdfview methods: %s, current method: %s, MTX_PDFVIEW_METHOD=%s",pdfview.methods(),pdfview.method,getenv(pdfview.METHOD) or "<unset>")
+end
+
+local openedfiles = { }
+
+local function fullname(name)
+ return file.addsuffix(name,"pdf")
+end
+
+function pdfview.open(...)
+ local opencall = opencalls[pdfview.method]
+ if opencall then
+ local t = { ... }
+ for i=1,#t do
+ local name = fullname(t[i])
+ if io.exists(name) then
+ os.execute(format('%s "%s" 2>&1', opencall, name))
+ openedfiles[name] = true
+ end
+ end
+ end
+end
+
+function pdfview.close(...)
+ local closecall = closecalls[pdfview.method]
+ if closecall then
+ local t = { ... }
+ for i=1,#t do
+ local name = fullname(t[i])
+ if openedfiles[name] then
+ os.execute(format('%s "%s" 2>&1', closecall, name))
+ openedfiles[name] = nil
+ else
+ pdfview.closeall()
+ break
+ end
+ end
+ end
+end
+
+function pdfview.closeall()
+ local allcall = allcalls[pdfview.method]
+ if allcall then
+ os.execute(format('%s 2>&1', allcall))
+ end
+ openedfiles = { }
+end
+
+--~ pdfview.open("t:/document/show-exa.pdf")
+--~ os.sleep(3)
+--~ pdfview.close("t:/document/show-exa.pdf")
+
+return pdfview
diff --git a/Master/texmf-dist/tex/context/base/l-set.lua b/Master/texmf-dist/tex/context/base/l-set.lua
index 7fc67b24b34..f844d0b4004 100644
--- a/Master/texmf-dist/tex/context/base/l-set.lua
+++ b/Master/texmf-dist/tex/context/base/l-set.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-set'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/l-string.lua b/Master/texmf-dist/tex/context/base/l-string.lua
index f46d6df24a0..9856d521249 100644
--- a/Master/texmf-dist/tex/context/base/l-string.lua
+++ b/Master/texmf-dist/tex/context/base/l-string.lua
@@ -1,12 +1,15 @@
if not modules then modules = { } end modules ['l-string'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 sub, gsub, find, match, gmatch, format, char, byte, rep = string.sub, string.gsub, string.find, string.match, string.gmatch, string.format, string.char, string.byte, string.rep
+local sub, gsub, find, match, gmatch, format, char, byte, rep, lower = string.sub, string.gsub, string.find, string.match, string.gmatch, string.format, string.char, string.byte, string.rep, string.lower
+local lpegmatch = lpeg.match
+
+-- some functions may disappear as they are not used anywhere
if not string.split then
@@ -46,8 +49,16 @@ function string:unquote()
return (gsub(self,"^([\"\'])(.*)%1$","%2"))
end
+--~ function string:unquote()
+--~ if find(self,"^[\'\"]") then
+--~ return sub(self,2,-2)
+--~ else
+--~ return self
+--~ end
+--~ end
+
function string:quote() -- we could use format("%q")
- return '"' .. self:unquote() .. '"'
+ return format("%q",self)
end
function string:count(pattern) -- variant 3
@@ -67,12 +78,23 @@ function string:limit(n,sentinel)
end
end
-function string:strip()
- return (gsub(self,"^%s*(.-)%s*$", "%1"))
+--~ function string:strip() -- the .- is quite efficient
+--~ -- return match(self,"^%s*(.-)%s*$") or ""
+--~ -- return match(self,'^%s*(.*%S)') or '' -- posted on lua list
+--~ return find(s,'^%s*$') and '' or match(s,'^%s*(.*%S)')
+--~ end
+
+do -- roberto's variant:
+ local space = lpeg.S(" \t\v\n")
+ local nospace = 1 - space
+ local stripper = space^0 * lpeg.C((space^0 * nospace^1)^0)
+ function string.strip(str)
+ return lpegmatch(stripper,str) or ""
+ end
end
function string:is_empty()
- return not find(find,"%S")
+ return not find(self,"%S")
end
function string:enhance(pattern,action)
@@ -106,14 +128,14 @@ if not string.characters then
local function nextchar(str, index)
index = index + 1
- return (index <= #str) and index or nil, str:sub(index,index)
+ return (index <= #str) and index or nil, sub(str,index,index)
end
function string:characters()
return nextchar, self, 0
end
local function nextbyte(str, index)
index = index + 1
- return (index <= #str) and index or nil, byte(str:sub(index,index))
+ return (index <= #str) and index or nil, byte(sub(str,index,index))
end
function string:bytes()
return nextbyte, self, 0
@@ -126,7 +148,7 @@ end
function string:rpadd(n,chr)
local m = n-#self
if m > 0 then
- return self .. self.rep(chr or " ",m)
+ return self .. rep(chr or " ",m)
else
return self
end
@@ -135,7 +157,7 @@ end
function string:lpadd(n,chr)
local m = n-#self
if m > 0 then
- return self.rep(chr or " ",m) .. self
+ return rep(chr or " ",m) .. self
else
return self
end
@@ -183,6 +205,17 @@ function string:pattesc()
return (gsub(self,".",patterns_escapes))
end
+local simple_escapes = {
+ ["-"] = "%-",
+ ["."] = "%.",
+ ["?"] = ".",
+ ["*"] = ".*",
+}
+
+function string:simpleesc()
+ return (gsub(self,".",simple_escapes))
+end
+
function string:tohash()
local t = { }
for s in gmatch(self,"([^, ]+)") do -- lpeg
@@ -194,10 +227,10 @@ end
local pattern = lpeg.Ct(lpeg.C(1)^0)
function string:totable()
- return pattern:match(self)
+ return lpegmatch(pattern,self)
end
---~ for _, str in ipairs {
+--~ local t = {
--~ "1234567123456712345671234567",
--~ "a\tb\tc",
--~ "aa\tbb\tcc",
@@ -205,7 +238,10 @@ end
--~ "aaaa\tbbbb\tcccc",
--~ "aaaaa\tbbbbb\tccccc",
--~ "aaaaaa\tbbbbbb\tcccccc",
---~ } do print(string.tabtospace(str)) end
+--~ }
+--~ for k,v do
+--~ print(string.tabtospace(t[k]))
+--~ end
function string.tabtospace(str,tab)
-- we don't handle embedded newlines
@@ -213,7 +249,7 @@ function string.tabtospace(str,tab)
local s = find(str,"\t")
if s then
if not tab then tab = 7 end -- only when found
- local d = tab-(s-1)%tab
+ local d = tab-(s-1) % tab
if d > 0 then
str = gsub(str,"\t",rep(" ",d),1)
else
@@ -231,3 +267,22 @@ function string:compactlong() -- strips newlines and leading spaces
self = gsub(self,"^ *","")
return self
end
+
+function string:striplong() -- strips newlines and leading spaces
+ self = gsub(self,"^%s*","")
+ self = gsub(self,"[\n\r]+ *","\n")
+ return self
+end
+
+function string:topattern(lowercase,strict)
+ if lowercase then
+ self = lower(self)
+ end
+ self = gsub(self,".",simple_escapes)
+ if self == "" then
+ self = ".*"
+ elseif strict then
+ self = "^" .. self .. "$"
+ end
+ return self
+end
diff --git a/Master/texmf-dist/tex/context/base/l-table.lua b/Master/texmf-dist/tex/context/base/l-table.lua
index 90cb068e23e..ee395d0f140 100644
--- a/Master/texmf-dist/tex/context/base/l-table.lua
+++ b/Master/texmf-dist/tex/context/base/l-table.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-table'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -9,9 +9,58 @@ if not modules then modules = { } end modules ['l-table'] = {
table.join = table.concat
local concat, sort, insert, remove = table.concat, table.sort, table.insert, table.remove
-local format, find, gsub, lower, dump = string.format, string.find, string.gsub, string.lower, string.dump
+local format, find, gsub, lower, dump, match = string.format, string.find, string.gsub, string.lower, string.dump, string.match
local getmetatable, setmetatable = getmetatable, setmetatable
-local type, next, tostring, ipairs = type, next, tostring, ipairs
+local type, next, tostring, tonumber, ipairs = type, next, tostring, tonumber, ipairs
+
+-- Starting with version 5.2 Lua no longer provide ipairs, which makes
+-- sense. As we already used the for loop and # in most places the
+-- impact on ConTeXt was not that large; the remaining ipairs already
+-- have been replaced. In a similar fashio we also hardly used pairs.
+--
+-- Just in case, we provide the fallbacks as discussed in Programming
+-- in Lua (http://www.lua.org/pil/7.3.html):
+
+if not ipairs then
+
+ -- for k, v in ipairs(t) do ... end
+ -- for k=1,#t do local v = t[k] ... end
+
+ local function iterate(a,i)
+ i = i + 1
+ local v = a[i]
+ if v ~= nil then
+ return i, v --, nil
+ end
+ end
+
+ function ipairs(a)
+ return iterate, a, 0
+ end
+
+end
+
+if not pairs then
+
+ -- for k, v in pairs(t) do ... end
+ -- for k, v in next, t do ... end
+
+ function pairs(t)
+ return next, t -- , nil
+ end
+
+end
+
+-- Also, unpack has been moved to the table table, and for compatiility
+-- reasons we provide both now.
+
+if not table.unpack then
+ table.unpack = _G.unpack
+elseif not unpack then
+ _G.unpack = table.unpack
+end
+
+-- extra functions, some might go (when not used)
function table.strip(tab)
local lst = { }
@@ -26,6 +75,14 @@ function table.strip(tab)
return lst
end
+function table.keys(t)
+ local k = { }
+ for key, _ in next, t do
+ k[#k+1] = key
+ end
+ return k
+end
+
local function compare(a,b)
return (tostring(a) < tostring(b))
end
@@ -69,7 +126,7 @@ end
table.sortedkeys = sortedkeys
table.sortedhashkeys = sortedhashkeys
-function table.sortedpairs(t)
+function table.sortedhash(t)
local s = sortedhashkeys(t) -- maybe just sortedkeys
local n = 0
local function kv(s)
@@ -80,6 +137,8 @@ function table.sortedpairs(t)
return kv, s
end
+table.sortedpairs = table.sortedhash
+
function table.append(t, list)
for _,v in next, list do
insert(t,v)
@@ -188,7 +247,7 @@ end
table.fastcopy = fastcopy
table.copy = copy
--- rougly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack)
+-- roughly: copy-loop : unpack : sub == 0.9 : 0.4 : 0.45 (so in critical apps, use unpack)
function table.sub(t,i,j)
return { unpack(t,i,j) }
@@ -202,18 +261,18 @@ end
-- slower than #t on indexed tables (#t only returns the size of the numerically indexed slice)
-function table.is_empty(t)
+function table.is_empty(t) -- obolete, use inline code instead
return not t or not next(t)
end
-function table.one_entry(t)
+function table.one_entry(t) -- obolete, use inline code instead
local n = next(t)
return n and not next(t,n)
end
-function table.starts_at(t)
- return ipairs(t,1)(t,0)
-end
+--~ function table.starts_at(t) -- obsolete, not nice anyway
+--~ return ipairs(t,1)(t,0)
+--~ end
function table.tohash(t,value)
local h = { }
@@ -291,6 +350,8 @@ end
--
-- local propername = lpeg.P(lpeg.R("AZ","az","__") * lpeg.R("09","AZ","az", "__")^0 * lpeg.P(-1) )
+-- problem: there no good number_to_string converter with the best resolution
+
local function do_serialize(root,name,depth,level,indexed)
if level > 0 then
depth = depth .. " "
@@ -313,8 +374,9 @@ local function do_serialize(root,name,depth,level,indexed)
handle(format("%s{",depth))
end
end
+ -- we could check for k (index) being number (cardinal)
if root and next(root) then
- local first, last = nil, 0 -- #root cannot be trusted here
+ local first, last = nil, 0 -- #root cannot be trusted here (will be ok in 5.2 when ipairs is gone)
if compact then
-- NOT: for k=1,#root do (we need to quit at nil)
for k,v in ipairs(root) do -- can we use next?
@@ -335,10 +397,10 @@ local function do_serialize(root,name,depth,level,indexed)
if hexify then
handle(format("%s 0x%04X,",depth,v))
else
- handle(format("%s %s,",depth,v))
+ handle(format("%s %s,",depth,v)) -- %.99g
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
handle(format("%s %s,",depth,v))
else
handle(format("%s %q,",depth,v))
@@ -375,29 +437,29 @@ local function do_serialize(root,name,depth,level,indexed)
--~ if hexify then
--~ handle(format("%s %s=0x%04X,",depth,key(k),v))
--~ else
- --~ handle(format("%s %s=%s,",depth,key(k),v))
+ --~ handle(format("%s %s=%s,",depth,key(k),v)) -- %.99g
--~ end
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
handle(format("%s [0x%04X]=0x%04X,",depth,k,v))
else
- handle(format("%s [%s]=%s,",depth,k,v))
+ handle(format("%s [%s]=%s,",depth,k,v)) -- %.99g
end
elseif noquotes and not reserved[k] and find(k,"^%a[%w%_]*$") then
if hexify then
handle(format("%s %s=0x%04X,",depth,k,v))
else
- handle(format("%s %s=%s,",depth,k,v))
+ handle(format("%s %s=%s,",depth,k,v)) -- %.99g
end
else
if hexify then
handle(format("%s [%q]=0x%04X,",depth,k,v))
else
- handle(format("%s [%q]=%s,",depth,k,v))
+ handle(format("%s [%q]=%s,",depth,k,v)) -- %.99g
end
end
elseif t == "string" then
- if reduce and (find(v,"^[%-%+]?[%d]-%.?[%d+]$") == 1) then
+ if reduce and tonumber(v) then
--~ handle(format("%s %s=%s,",depth,key(k),v))
if type(k) == "number" then -- or find(k,"^%d+$") then
if hexify then
@@ -606,7 +668,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify)
end
end
-local function flatten(t,f,complete)
+local function flatten(t,f,complete) -- is this used? meybe a variant with next, ...
for i=1,#t do
local v = t[i]
if type(v) == "table" then
@@ -635,6 +697,24 @@ end
table.flatten_one_level = table.unnest
+-- a better one:
+
+local function flattened(t,f)
+ if not f then
+ f = { }
+ end
+ for k, v in next, t do
+ if type(v) == "table" then
+ flattened(v,f)
+ else
+ f[k] = v
+ end
+ end
+ return f
+end
+
+table.flattened = flattened
+
-- the next three may disappear
function table.remove_value(t,value) -- todo: n
@@ -770,7 +850,7 @@ function table.clone(t,p) -- t is optional or nil or table
elseif not t then
t = { }
end
- setmetatable(t, { __index = function(_,key) return p[key] end })
+ setmetatable(t, { __index = function(_,key) return p[key] end }) -- why not __index = p ?
return t
end
@@ -798,18 +878,33 @@ function table.reverse(t)
return tt
end
---~ function table.keys(t)
---~ local k = { }
---~ for k,_ in next, t do
---~ k[#k+1] = k
---~ end
---~ return k
---~ end
+function table.insert_before_value(t,value,extra)
+ for i=1,#t do
+ if t[i] == extra then
+ remove(t,i)
+ end
+ end
+ for i=1,#t do
+ if t[i] == value then
+ insert(t,i,extra)
+ return
+ end
+ end
+ insert(t,1,extra)
+end
+
+function table.insert_after_value(t,value,extra)
+ for i=1,#t do
+ if t[i] == extra then
+ remove(t,i)
+ end
+ end
+ for i=1,#t do
+ if t[i] == value then
+ insert(t,i+1,extra)
+ return
+ end
+ end
+ insert(t,#t+1,extra)
+end
---~ function table.keys_as_string(t)
---~ local k = { }
---~ for k,_ in next, t do
---~ k[#k+1] = k
---~ end
---~ return concat(k,"")
---~ end
diff --git a/Master/texmf-dist/tex/context/base/l-unicode.lua b/Master/texmf-dist/tex/context/base/l-unicode.lua
index 124a1e24038..0c5a60142ae 100644
--- a/Master/texmf-dist/tex/context/base/l-unicode.lua
+++ b/Master/texmf-dist/tex/context/base/l-unicode.lua
@@ -1,18 +1,39 @@
if not modules then modules = { } end modules ['l-unicode'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
}
+if not unicode then
+
+ unicode = { utf8 = { } }
+
+ local floor, char = math.floor, string.char
+
+ function unicode.utf8.utfchar(n)
+ if n < 0x80 then
+ return char(n)
+ elseif n < 0x800 then
+ return char(0xC0 + floor(n/0x40)) .. char(0x80 + (n % 0x40))
+ elseif n < 0x10000 then
+ return char(0xE0 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40))
+ elseif n < 0x40000 then
+ return char(0xF0 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40))
+ else -- wrong:
+ -- return char(0xF1 + floor(n/0x1000000)) .. char(0x80 + floor(n/0x40000)) .. char(0x80 + floor(n/0x1000)) .. char(0x80 + (floor(n/0x40) % 0x40)) .. char(0x80 + (n % 0x40))
+ return "?"
+ end
+ end
+
+end
+
utf = utf or unicode.utf8
local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub
local char, byte, find, bytepairs = string.char, string.byte, string.find, string.bytepairs
-unicode = unicode or { }
-
-- 0 EF BB BF UTF-8
-- 1 FF FE UTF-16-little-endian
-- 2 FE FF UTF-16-big-endian
@@ -27,14 +48,20 @@ unicode.utfname = {
[4] = 'utf-32-be'
}
-function unicode.utftype(f) -- \000 fails !
+-- \000 fails in <= 5.0 but is valid in >=5.1 where %z is depricated
+
+function unicode.utftype(f)
local str = f:read(4)
if not str then
f:seek('set')
return 0
- elseif find(str,"^%z%z\254\255") then
+ -- elseif find(str,"^%z%z\254\255") then -- depricated
+ -- elseif find(str,"^\000\000\254\255") then -- not permitted and bugged
+ elseif find(str,"\000\000\254\255",1,true) then -- seems to work okay (TH)
return 4
- elseif find(str,"^\255\254%z%z") then
+ -- elseif find(str,"^\255\254%z%z") then -- depricated
+ -- elseif find(str,"^\255\254\000\000") then -- not permitted and bugged
+ elseif find(str,"\255\254\000\000",1,true) then -- seems to work okay (TH)
return 3
elseif find(str,"^\254\255") then
f:seek('set',2)
diff --git a/Master/texmf-dist/tex/context/base/l-url.lua b/Master/texmf-dist/tex/context/base/l-url.lua
index 097c944677b..e3e6f81302c 100644
--- a/Master/texmf-dist/tex/context/base/l-url.lua
+++ b/Master/texmf-dist/tex/context/base/l-url.lua
@@ -1,13 +1,14 @@
if not modules then modules = { } end modules ['l-url'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 char, gmatch = string.char, string.gmatch
+local char, gmatch, gsub = string.char, string.gmatch, string.gsub
local tonumber, type = tonumber, type
+local lpegmatch = lpeg.match
-- from the spec (on the web):
--
@@ -31,7 +32,9 @@ local hexdigit = lpeg.R("09","AF","af")
local plus = lpeg.P("+")
local escaped = (plus / " ") + (percent * lpeg.C(hexdigit * hexdigit) / tochar)
-local scheme = lpeg.Cs((escaped+(1-colon-slash-qmark-hash))^0) * colon + lpeg.Cc("")
+-- we assume schemes with more than 1 character (in order to avoid problems with windows disks)
+
+local scheme = lpeg.Cs((escaped+(1-colon-slash-qmark-hash))^2) * colon + lpeg.Cc("")
local authority = slash * slash * lpeg.Cs((escaped+(1- slash-qmark-hash))^0) + lpeg.Cc("")
local path = slash * lpeg.Cs((escaped+(1- qmark-hash))^0) + lpeg.Cc("")
local query = qmark * lpeg.Cs((escaped+(1- hash))^0) + lpeg.Cc("")
@@ -39,25 +42,51 @@ local fragment = hash * lpeg.Cs((escaped+(1- endofstring))^0
local parser = lpeg.Ct(scheme * authority * path * query * fragment)
+-- todo: reconsider Ct as we can as well have five return values (saves a table)
+-- so we can have two parsers, one with and one without
+
function url.split(str)
- return (type(str) == "string" and parser:match(str)) or str
+ return (type(str) == "string" and lpegmatch(parser,str)) or str
end
+-- todo: cache them
+
function url.hashed(str)
local s = url.split(str)
+ local somescheme = s[1] ~= ""
return {
- scheme = (s[1] ~= "" and s[1]) or "file",
+ scheme = (somescheme and s[1]) or "file",
authority = s[2],
- path = s[3],
- query = s[4],
- fragment = s[5],
- original = str
+ path = s[3],
+ query = s[4],
+ fragment = s[5],
+ original = str,
+ noscheme = not somescheme,
}
end
+function url.hasscheme(str)
+ return url.split(str)[1] ~= ""
+end
+
+function url.addscheme(str,scheme)
+ return (url.hasscheme(str) and str) or ((scheme or "file:///") .. str)
+end
+
+function url.construct(hash)
+ local fullurl = hash.sheme .. "://".. hash.authority .. hash.path
+ if hash.query then
+ fullurl = fullurl .. "?".. hash.query
+ end
+ if hash.fragment then
+ fullurl = fullurl .. "?".. hash.fragment
+ end
+ return fullurl
+end
+
function url.filename(filename)
local t = url.hashed(filename)
- return (t.scheme == "file" and t.path:gsub("^/([a-zA-Z])([:|])/)","%1:")) or filename
+ return (t.scheme == "file" and (gsub(t.path,"^/([a-zA-Z])([:|])/)","%1:"))) or filename
end
function url.query(str)
diff --git a/Master/texmf-dist/tex/context/base/l-utils.lua b/Master/texmf-dist/tex/context/base/l-utils.lua
index 8d531711fb4..ebc27b8cfcd 100644
--- a/Master/texmf-dist/tex/context/base/l-utils.lua
+++ b/Master/texmf-dist/tex/context/base/l-utils.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['l-utils'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -8,6 +8,10 @@ if not modules then modules = { } end modules ['l-utils'] = {
-- hm, quite unreadable
+local gsub = string.gsub
+local concat = table.concat
+local type, next = type, next
+
if not utils then utils = { } end
if not utils.merger then utils.merger = { } end
if not utils.lua then utils.lua = { } end
@@ -45,7 +49,7 @@ function utils.merger._self_load_(name)
end
if data and utils.merger.strip_comment then
-- saves some 20K
- data = data:gsub("%-%-~[^\n\r]*[\r\n]", "")
+ data = gsub(data,"%-%-~[^\n\r]*[\r\n]", "")
end
return data or ""
end
@@ -63,7 +67,7 @@ end
function utils.merger._self_swap_(data,code)
if data ~= "" then
- return (data:gsub(utils.merger.pattern, function(s)
+ return (gsub(data,utils.merger.pattern, function(s)
return "\n\n" .. "-- "..utils.merger.m_begin .. "\n" .. code .. "\n" .. "-- "..utils.merger.m_end .. "\n\n"
end, 1))
else
@@ -73,8 +77,8 @@ end
--~ stripper:
--~
---~ data = string.gsub(data,"%-%-~[^\n]*\n","")
---~ data = string.gsub(data,"\n\n+","\n")
+--~ data = gsub(data,"%-%-~[^\n]*\n","")
+--~ data = gsub(data,"\n\n+","\n")
function utils.merger._self_libs_(libs,list)
local result, f, frozen = { }, nil, false
@@ -82,9 +86,10 @@ function utils.merger._self_libs_(libs,list)
if type(libs) == 'string' then libs = { libs } end
if type(list) == 'string' then list = { list } end
local foundpath = nil
- for _, lib in ipairs(libs) do
- for _, pth in ipairs(list) do
- pth = string.gsub(pth,"\\","/") -- file.clean_path
+ for i=1,#libs do
+ local lib = libs[i]
+ for j=1,#list do
+ local pth = gsub(list[j],"\\","/") -- file.clean_path
utils.report("checking library path %s",pth)
local name = pth .. "/" .. lib
if lfs.isfile(name) then
@@ -96,7 +101,8 @@ function utils.merger._self_libs_(libs,list)
if foundpath then
utils.report("using library path %s",foundpath)
local right, wrong = { }, { }
- for _, lib in ipairs(libs) do
+ for i=1,#libs do
+ local lib = libs[i]
local fullname = foundpath .. "/" .. lib
if lfs.isfile(fullname) then
-- right[#right+1] = lib
@@ -110,15 +116,15 @@ function utils.merger._self_libs_(libs,list)
end
end
if #right > 0 then
- utils.report("merged libraries: %s",table.concat(right," "))
+ utils.report("merged libraries: %s",concat(right," "))
end
if #wrong > 0 then
- utils.report("skipped libraries: %s",table.concat(wrong," "))
+ utils.report("skipped libraries: %s",concat(wrong," "))
end
else
utils.report("no valid library path found")
end
- return table.concat(result, "\n\n")
+ return concat(result, "\n\n")
end
function utils.merger.selfcreate(libs,list,target)
diff --git a/Master/texmf-dist/tex/context/base/l-xml.lua b/Master/texmf-dist/tex/context/base/l-xml.lua
index 8b8a6ce4433..14e97337b25 100644
--- a/Master/texmf-dist/tex/context/base/l-xml.lua
+++ b/Master/texmf-dist/tex/context/base/l-xml.lua
@@ -1,2441 +1,23 @@
if not modules then modules = { } end modules ['l-xml'] = {
version = 1.001,
- comment = "this module is the basis for the lxml-* ones",
+ comment = "this module is replaced by the lxml-* ones",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- RJ: key=value ... lpeg.Ca(lpeg.Cc({}) * (pattern-producing-key-and-value / rawset)^0)
+-- We asume that the helper modules l-*.lua are loaded
+-- already. But anyway if you use mtxrun to run your script
+-- all is taken care of.
--- some code may move to l-xmlext
--- some day we will really compile the lpaths (just construct functions)
--- todo: some things per xml file, like namespace remapping
-
---[[ldx--
-<p>The parser used here is inspired by the variant discussed in the lua book, but
-handles comment and processing instructions, has a different structure, provides
-parent access; a first version used different tricky but was less optimized to we
-went this route. First we had a find based parser, now we have an <l n='lpeg'/> based one.
-The find based parser can be found in l-xml-edu.lua along with other older code.</p>
-
-<p>Expecially the lpath code is experimental, we will support some of xpath, but
-only things that make sense for us; as compensation it is possible to hook in your
-own functions. Apart from preprocessing content for <l n='context'/> we also need
-this module for process management, like handling <l n='ctx'/> and <l n='rlx'/>
-files.</p>
-
-<typing>
-a/b/c /*/c
-a/b/c/first() a/b/c/last() a/b/c/index(n) a/b/c/index(-n)
-a/b/c/text() a/b/c/text(1) a/b/c/text(-1) a/b/c/text(n)
-</typing>
-
-<p>Beware, the interface may change. For instance at, ns, tg, dt may get more
-verbose names. Once the code is stable we will also remove some tracing and
-optimize the code.</p>
---ldx]]--
-
-xml = xml or { }
-tex = tex or { }
-
-local concat, remove, insert = table.concat, table.remove, table.insert
-local type, next, tonumber, tostring, setmetatable, loadstring = type, next, tonumber, tostring, setmetatable, loadstring
-local format, lower, gmatch, gsub, find = string.format, string.lower, string.gmatch, string.gsub, string.find
-
---[[ldx--
-<p>This module can be used stand alone but also inside <l n='mkiv'/> in
-which case it hooks into the tracker code. Therefore we provide a few
-functions that set the tracers.</p>
---ldx]]--
-
-local trace_lpath, trace_remap = false, false
-
-if trackers then
- trackers.register("xml.lpath", function(v) trace_lpath = v end)
- trackers.register("xml.remap", function(v) trace_remap = v end)
-end
-
-function xml.settrace(str,value)
- if str == "lpath" then
- trace_lpath = value or false
- elseif str == "remap" then
- trace_remap = value or false
- end
-end
-
---[[ldx--
-<p>First a hack to enable namespace resolving. A namespace is characterized by
-a <l n='url'/>. The following function associates a namespace prefix with a
-pattern. We use <l n='lpeg'/>, which in this case is more than twice as fast as a
-find based solution where we loop over an array of patterns. Less code and
-much cleaner.</p>
---ldx]]--
-
-xml.xmlns = xml.xmlns or { }
-
-do
-
- local check = lpeg.P(false)
- local parse = check
-
- --[[ldx--
- <p>The next function associates a namespace prefix with an <l n='url'/>. This
- normally happens independent of parsing.</p>
-
- <typing>
- xml.registerns("mml","mathml")
- </typing>
- --ldx]]--
-
- function xml.registerns(namespace, pattern) -- pattern can be an lpeg
- check = check + lpeg.C(lpeg.P(lower(pattern))) / namespace
- parse = lpeg.P { lpeg.P(check) + 1 * lpeg.V(1) }
- end
-
- --[[ldx--
- <p>The next function also registers a namespace, but this time we map a
- given namespace prefix onto a registered one, using the given
- <l n='url'/>. This used for attributes like <t>xmlns:m</t>.</p>
-
- <typing>
- xml.checkns("m","http://www.w3.org/mathml")
- </typing>
- --ldx]]--
-
- function xml.checkns(namespace,url)
- local ns = parse:match(lower(url))
- if ns and namespace ~= ns then
- xml.xmlns[namespace] = ns
- end
- end
-
- --[[ldx--
- <p>Next we provide a way to turn an <l n='url'/> into a registered
- namespace. This used for the <t>xmlns</t> attribute.</p>
-
- <typing>
- resolvedns = xml.resolvens("http://www.w3.org/mathml")
- </typing>
-
- This returns <t>mml</t>.
- --ldx]]--
-
- function xml.resolvens(url)
- return parse:match(lower(url)) or ""
- end
-
- --[[ldx--
- <p>A namespace in an element can be remapped onto the registered
- one efficiently by using the <t>xml.xmlns</t> table.</p>
- --ldx]]--
-
-end
-
---[[ldx--
-<p>This version uses <l n='lpeg'/>. We follow the same approach as before, stack and top and
-such. This version is about twice as fast which is mostly due to the fact that
-we don't have to prepare the stream for cdata, doctype etc etc. This variant is
-is dedicated to Luigi Scarso, who challenged me with 40 megabyte <l n='xml'/> files that
-took 12.5 seconds to load (1.5 for file io and the rest for tree building). With
-the <l n='lpeg'/> implementation we got that down to less 7.3 seconds. Loading the 14
-<l n='context'/> interface definition files (2.6 meg) went down from 1.05 seconds to 0.55.</p>
-
-<p>Next comes the parser. The rather messy doctype definition comes in many
-disguises so it is no surprice that later on have to dedicate quite some
-<l n='lpeg'/> code to it.</p>
-
-<typing>
-<!DOCTYPE Something PUBLIC "... ..." "..." [ ... ] >
-<!DOCTYPE Something PUBLIC "... ..." "..." >
-<!DOCTYPE Something SYSTEM "... ..." [ ... ] >
-<!DOCTYPE Something SYSTEM "... ..." >
-<!DOCTYPE Something [ ... ] >
-<!DOCTYPE Something >
-</typing>
-
-<p>The code may look a bit complex but this is mostly due to the fact that we
-resolve namespaces and attach metatables. There is only one public function:</p>
-
-<typing>
-local x = xml.convert(somestring)
-</typing>
-
-<p>An optional second boolean argument tells this function not to create a root
-element.</p>
---ldx]]--
-
-xml.strip_cm_and_dt = false -- an extra global flag, in case we have many includes
-
-do
-
- -- not just one big nested table capture (lpeg overflow)
-
- local nsremap, resolvens = xml.xmlns, xml.resolvens
-
- local stack, top, dt, at, xmlns, errorstr, entities = {}, {}, {}, {}, {}, nil, {}
-
- local mt = { __tostring = xml.text }
-
- function xml.check_error(top,toclose)
- return ""
- end
-
- local strip = false
- local cleanup = false
-
- function xml.set_text_cleanup(fnc)
- cleanup = fnc
- end
-
- local function add_attribute(namespace,tag,value)
- if cleanup and #value > 0 then
- value = cleanup(value) -- new
- end
- if tag == "xmlns" then
- xmlns[#xmlns+1] = resolvens(value)
- at[tag] = value
- elseif namespace == "xmlns" then
- xml.checkns(tag,value)
- at["xmlns:" .. tag] = value
- else
- at[tag] = value
- end
- end
- local function add_begin(spacing, namespace, tag)
- if #spacing > 0 then
- dt[#dt+1] = spacing
- end
- local resolved = (namespace == "" and xmlns[#xmlns]) or nsremap[namespace] or namespace
- top = { ns=namespace or "", rn=resolved, tg=tag, at=at, dt={}, __p__ = stack[#stack] }
- setmetatable(top, mt)
- dt = top.dt
- stack[#stack+1] = top
- at = { }
- end
- local function add_end(spacing, namespace, tag)
- if #spacing > 0 then
- dt[#dt+1] = spacing
- end
- local toclose = remove(stack)
- top = stack[#stack]
- if #stack < 1 then
- errorstr = format("nothing to close with %s %s", tag, xml.check_error(top,toclose) or "")
- elseif toclose.tg ~= tag then -- no namespace check
- errorstr = format("unable to close %s with %s %s", toclose.tg, tag, xml.check_error(top,toclose) or "")
- end
- dt = top.dt
- dt[#dt+1] = toclose
-dt[0] = top
- if toclose.at.xmlns then
- remove(xmlns)
- end
- end
- local function add_empty(spacing, namespace, tag)
- if #spacing > 0 then
- dt[#dt+1] = spacing
- end
- local resolved = (namespace == "" and xmlns[#xmlns]) or nsremap[namespace] or namespace
- top = stack[#stack]
- dt = top.dt
- local t = { ns=namespace or "", rn=resolved, tg=tag, at=at, dt={}, __p__ = top }
- dt[#dt+1] = t
- setmetatable(t, mt)
- if at.xmlns then
- remove(xmlns)
- end
- at = { }
- end
- local function add_text(text)
- if cleanup and #text > 0 then
- dt[#dt+1] = cleanup(text)
- else
- dt[#dt+1] = text
- end
- end
- local function add_special(what, spacing, text)
- if #spacing > 0 then
- dt[#dt+1] = spacing
- end
- if strip and (what == "@cm@" or what == "@dt@") then
- -- forget it
- else
- dt[#dt+1] = { special=true, ns="", tg=what, dt={text} }
- end
- end
- local function set_message(txt)
- errorstr = "garbage at the end of the file: " .. gsub(txt,"([ \n\r\t]*)","")
- end
-
- local P, S, R, C, V = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V
-
- local space = S(' \r\n\t')
- local open = P('<')
- local close = P('>')
- local squote = S("'")
- local dquote = S('"')
- local equal = P('=')
- local slash = P('/')
- local colon = P(':')
- local valid = R('az', 'AZ', '09') + S('_-.')
- local name_yes = C(valid^1) * colon * C(valid^1)
- local name_nop = C(P(true)) * C(valid^1)
- local name = name_yes + name_nop
-
- local utfbom = P('\000\000\254\255') + P('\255\254\000\000') +
- P('\255\254') + P('\254\255') + P('\239\187\191') -- no capture
-
- local spacing = C(space^0)
- local justtext = C((1-open)^1)
- local somespace = space^1
- local optionalspace = space^0
-
- local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote)
- local attribute = (somespace * name * optionalspace * equal * optionalspace * value) / add_attribute
- local attributes = attribute^0
-
- local text = justtext / add_text
- local balanced = P { "[" * ((1 - S"[]") + V(1))^0 * "]" } -- taken from lpeg manual, () example
-
- 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 begincomment = open * P("!--")
- local endcomment = P("--") * close
- local begininstruction = open * P("?")
- local endinstruction = P("?") * close
- local begincdata = open * P("![CDATA[")
- local endcdata = P("]]") * close
-
- local someinstruction = C((1 - endinstruction)^0)
- local somecomment = C((1 - endcomment )^0)
- local somecdata = C((1 - endcdata )^0)
-
- local function entity(k,v) entities[k] = v end
-
- local begindoctype = open * P("!DOCTYPE")
- local enddoctype = close
- local beginset = P("[")
- local endset = P("]")
- local doctypename = C((1-somespace)^0)
- local elementdoctype = optionalspace * P("<!ELEMENT") * (1-close)^0 * close
- local entitydoctype = optionalspace * P("<!ENTITY") * somespace * (doctypename * somespace * value)/entity * optionalspace * close
- local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * value * somespace * value * somespace
- local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace
- local definitiondoctype= doctypename * somespace * beginset * P(elementdoctype + entitydoctype)^0 * optionalspace * endset
- local simpledoctype = (1-close)^1 -- * balanced^0
- local somedoctype = C((somespace * (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
- local cdata = (spacing * begincdata * somecdata * endcdata ) / function(...) add_special("@cd@",...) end
- local doctype = (spacing * begindoctype * somedoctype * enddoctype ) / function(...) add_special("@dt@",...) end
-
- -- nicer but slower:
- --
- -- local instruction = (lpeg.Cc("@pi@") * spacing * begininstruction * someinstruction * endinstruction) / add_special
- -- local comment = (lpeg.Cc("@cm@") * spacing * begincomment * somecomment * endcomment ) / add_special
- -- local cdata = (lpeg.Cc("@cd@") * spacing * begincdata * somecdata * endcdata ) / add_special
- -- local doctype = (lpeg.Cc("@dt@") * spacing * begindoctype * somedoctype * enddoctype ) / add_special
-
- local trailer = space^0 * (justtext/set_message)^0
-
- -- comment + emptyelement + text + cdata + instruction + V("parent"), -- 6.5 seconds on 40 MB database file
- -- text + comment + emptyelement + cdata + instruction + V("parent"), -- 5.8
- -- text + V("parent") + emptyelement + comment + cdata + instruction, -- 5.5
-
- local grammar = P { "preamble",
- preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer,
- parent = beginelement * V("children")^0 * endelement,
- children = text + V("parent") + emptyelement + comment + cdata + instruction,
- }
-
- -- todo: xml.new + properties like entities and strip and such (store in root)
-
- function xml.convert(data, no_root, strip_cm_and_dt, given_entities) -- maybe use table met k/v (given_entities may disapear)
- strip = strip_cm_and_dt or xml.strip_cm_and_dt
- stack, top, at, xmlns, errorstr, result, entities = {}, {}, {}, {}, nil, nil, given_entities or {}
- stack[#stack+1] = top
- top.dt = { }
- dt = top.dt
- if not data or data == "" then
- errorstr = "empty xml file"
- elseif not grammar:match(data) then
- errorstr = "invalid xml file"
- else
- errorstr = ""
- end
- if errorstr and errorstr ~= "" then
- result = { dt = { { ns = "", tg = "error", dt = { errorstr }, at={}, er = true } }, error = true }
- setmetatable(stack, mt)
- if xml.error_handler then xml.error_handler("load",errorstr) end
- else
- result = stack[1]
- end
- if not no_root then
- result = { special = true, ns = "", tg = '@rt@', dt = result.dt, at={}, entities = entities }
- setmetatable(result, mt)
- local rdt = result.dt
- for k=1,#rdt do
- local v = rdt[k]
- if type(v) == "table" and not v.special then -- always table -)
- result.ri = k -- rootindex
- break
- end
- end
- end
- return result
- end
-
- --[[ldx--
- <p>Packaging data in an xml like table is done with the following
- function. Maybe it will go away (when not used).</p>
- --ldx]]--
-
- function xml.is_valid(root)
- return root and root.dt and root.dt[1] and type(root.dt[1]) == "table" and not root.dt[1].er
- end
-
- function xml.package(tag,attributes,data)
- local ns, tg = tag:match("^(.-):?([^:]+)$")
- local t = { ns = ns, tg = tg, dt = data or "", at = attributes or {} }
- setmetatable(t, mt)
- return t
- end
-
- function xml.is_valid(root)
- return root and not root.error
- end
-
- xml.error_handler = (logs and logs.report) or (input and logs.report) or print
-
-end
-
---[[ldx--
-<p>We cannot load an <l n='lpeg'/> from a filehandle so we need to load
-the whole file first. The function accepts a string representing
-a filename or a file handle.</p>
---ldx]]--
-
-function xml.load(filename)
- if type(filename) == "string" then
- local f = io.open(filename,'r')
- if f then
- local root = xml.convert(f:read("*all"))
- f:close()
- return root
- else
- return xml.convert("")
- end
- elseif filename then -- filehandle
- return xml.convert(filename:read("*all"))
- else
- return xml.convert("")
- end
-end
-
---[[ldx--
-<p>When we inject new elements, we need to convert strings to
-valid trees, which is what the next function does.</p>
---ldx]]--
-
-function xml.toxml(data)
- if type(data) == "string" then
- local root = { xml.convert(data,true) }
- return (#root > 1 and root) or root[1]
- else
- return data
- end
-end
-
---[[ldx--
-<p>For copying a tree we use a dedicated function instead of the
-generic table copier. Since we know what we're dealing with we
-can speed up things a bit. The second argument is not to be used!</p>
---ldx]]--
-
-do
-
- local function copy(old,tables)
- if old then
- tables = tables or { }
- local new = { }
- if not tables[old] then
- tables[old] = new
- end
- for k,v in pairs(old) do
- new[k] = (type(v) == "table" and (tables[v] or copy(v, tables))) or v
- end
- local mt = getmetatable(old)
- if mt then
- setmetatable(new,mt)
- end
- return new
- else
- return { }
- end
- end
-
- xml.copy = copy
-
-end
-
---[[ldx--
-<p>In <l n='context'/> serializing the tree or parts of the tree is a major
-actitivity which is why the following function is pretty optimized resulting
-in a few more lines of code than needed. The variant that uses the formatting
-function for all components is about 15% slower than the concatinating
-alternative.</p>
---ldx]]--
-
-do
-
- -- todo: add <?xml version='1.0' standalone='yes'?> when not present
-
- local fallbackhandle = (tex and tex.sprint) or io.write
-
- local function serialize(e, handle, textconverter, attributeconverter, specialconverter, nocommands)
- if not e then
- return
- elseif not nocommands then
- local ec = e.command
- if ec ~= nil then -- we can have all kind of types
- if e.special then
- local etg, edt = e.tg, e.dt
- local spc = specialconverter and specialconverter[etg]
- if spc then
- local result = spc(edt[1])
- if result then
- handle(result)
- return
- else
- -- no need to handle any further
- end
- end
- end
- local xc = xml.command
- if xc then
- xc(e,ec)
- return
- end
- end
- end
- handle = handle or fallbackhandle
- local etg = e.tg
- if etg then
- if e.special then
- local edt = e.dt
- local spc = specialconverter and specialconverter[etg]
- if spc then
- local result = spc(edt[1])
- if result then
- handle(result)
- else
- -- no need to handle any further
- end
- elseif etg == "@pi@" then
- -- handle(format("<?%s?>",edt[1]))
- handle("<?" .. edt[1] .. "?>")
- elseif etg == "@cm@" then
- -- handle(format("<!--%s-->",edt[1]))
- handle("<!--" .. edt[1] .. "-->")
- elseif etg == "@cd@" then
- -- handle(format("<![CDATA[%s]]>",edt[1]))
- handle("<![CDATA[" .. edt[1] .. "]]>")
- elseif etg == "@dt@" then
- -- handle(format("<!DOCTYPE %s>",edt[1]))
- handle("<!DOCTYPE " .. edt[1] .. ">")
- elseif etg == "@rt@" then
- serialize(edt,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- else
- local ens, eat, edt, ern = e.ns, e.at, e.dt, e.rn
- local ats = eat and next(eat) and { } -- type test maybe faster
- if ats then
- if attributeconverter then
- for k,v in next, eat do
- ats[#ats+1] = format('%s=%q',k,attributeconverter(v))
- end
- else
- for k,v in next, eat do
- ats[#ats+1] = format('%s=%q',k,v)
- end
- end
- end
- if ern and trace_remap and ern ~= ens then
- ens = ern
- end
- if ens ~= "" then
- if edt and #edt > 0 then
- if ats then
- -- handle(format("<%s:%s %s>",ens,etg,concat(ats," ")))
- handle("<" .. ens .. ":" .. etg .. " " .. concat(ats," ") .. ">")
- else
- -- handle(format("<%s:%s>",ens,etg))
- handle("<" .. ens .. ":" .. etg .. ">")
- end
- for i=1,#edt do
- local e = edt[i]
- if type(e) == "string" then
- if textconverter then
- handle(textconverter(e))
- else
- handle(e)
- end
- else
- serialize(e,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- end
- -- handle(format("</%s:%s>",ens,etg))
- handle("</" .. ens .. ":" .. etg .. ">")
- else
- if ats then
- -- handle(format("<%s:%s %s/>",ens,etg,concat(ats," ")))
- handle("<" .. ens .. ":" .. etg .. " " .. concat(ats," ") .. "/>")
- else
- -- handle(format("<%s:%s/>",ens,etg))
- handle("<" .. ens .. ":" .. etg .. "/>")
- end
- end
- else
- if edt and #edt > 0 then
- if ats then
- -- handle(format("<%s %s>",etg,concat(ats," ")))
- handle("<" .. etg .. " " .. concat(ats," ") .. ">")
- else
- -- handle(format("<%s>",etg))
- handle("<" .. etg .. ">")
- end
- for i=1,#edt do
- local ei = edt[i]
- if type(ei) == "string" then
- if textconverter then
- handle(textconverter(ei))
- else
- handle(ei)
- end
- else
- serialize(ei,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- end
- -- handle(format("</%s>",etg))
- handle("</" .. etg .. ">")
- else
- if ats then
- -- handle(format("<%s %s/>",etg,concat(ats," ")))
- handle("<" .. etg .. " " .. concat(ats," ") .. "/>")
- else
- -- handle(format("<%s/>",etg))
- handle("<" .. etg .. "/>")
- end
- end
- end
- end
- elseif type(e) == "string" then
- if textconverter then
- handle(textconverter(e))
- else
- handle(e)
- end
- else
- for i=1,#e do
- local ei = e[i]
- if type(ei) == "string" then
- if textconverter then
- handle(textconverter(ei))
- else
- handle(ei)
- end
- else
- serialize(ei,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- end
- end
- end
-
- xml.serialize = serialize
-
- function xml.checkbom(root) -- can be made faster
- if root.ri then
- local dt, found = root.dt, false
- for k=1,#dt do
- local v = dt[k]
- if type(v) == "table" and v.special and v.tg == "@pi" and v.dt:find("xml.*version=") then
- found = true
- break
- end
- end
- if not found then
- insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } )
- insert(dt, 2, "\n" )
- end
- end
- end
-
- --[[ldx--
- <p>At the cost of some 25% runtime overhead you can first convert the tree to a string
- and then handle the lot.</p>
- --ldx]]--
-
- function xml.tostring(root) -- 25% overhead due to collecting
- if root then
- if type(root) == 'string' then
- return root
- elseif next(root) then -- next is faster than type (and >0 test)
- local result = { }
- serialize(root,function(s) result[#result+1] = s end)
- return concat(result,"")
- end
- end
- return ""
- end
-
-end
-
---[[ldx--
-<p>The next function operated on the content only and needs a handle function
-that accepts a string.</p>
---ldx]]--
-
-function xml.string(e,handle)
- if not handle or (e.special and e.tg ~= "@rt@") then
- -- nothing
- elseif e.tg then
- local edt = e.dt
- if edt then
- for i=1,#edt do
- xml.string(edt[i],handle)
- end
- end
- else
- handle(e)
- end
-end
-
---[[ldx--
-<p>How you deal with saving data depends on your preferences. For a 40 MB database
-file the timing on a 2.3 Core Duo are as follows (time in seconds):</p>
-
-<lines>
-1.3 : load data from file to string
-6.1 : convert string into tree
-5.3 : saving in file using xmlsave
-6.8 : converting to string using xml.tostring
-3.6 : saving converted string in file
-</lines>
-
-<p>The save function is given below.</p>
---ldx]]--
-
-function xml.save(root,name)
- local f = io.open(name,"w")
- if f then
- xml.serialize(root,function(s) f:write(s) end)
- f:close()
- end
-end
-
---[[ldx--
-<p>A few helpers:</p>
---ldx]]--
-
-function xml.body(root)
- return (root.ri and root.dt[root.ri]) or root
-end
-
-function xml.text(root)
- return (root and xml.tostring(root)) or ""
-end
-
-function xml.content(root) -- bugged
- return (root and root.dt and xml.tostring(root.dt)) or ""
+if not trackers then
+ require('trac-tra')
end
-function xml.isempty(root, pattern)
- if pattern == "" or pattern == "*" then
- pattern = nil
- end
- if pattern then
- -- todo
- return false
- else
- return not root or not root.dt or #root.dt == 0 or root.dt == ""
- end
+if not xml then
+ require('lxml-tab')
+ require('lxml-lpt')
+ require('lxml-mis')
+ require('lxml-aux')
+ require('lxml-xml')
end
-
---[[ldx--
-<p>The next helper erases an element but keeps the table as it is,
-and since empty strings are not serialized (effectively) it does
-not harm. Copying the table would take more time. Usage:</p>
-
-<typing>
-dt[k] = xml.empty() or xml.empty(dt,k)
-</typing>
---ldx]]--
-
-function xml.empty(dt,k)
- if dt and k then
- dt[k] = ""
- return dt[k]
- else
- return ""
- end
-end
-
---[[ldx--
-<p>The next helper assigns a tree (or string). Usage:</p>
-
-<typing>
-dt[k] = xml.assign(root) or xml.assign(dt,k,root)
-</typing>
---ldx]]--
-
-function xml.assign(dt,k,root)
- if dt and k then
- dt[k] = (type(root) == "table" and xml.body(root)) or root
- return dt[k]
- else
- return xml.body(root)
- end
-end
-
---[[ldx--
-<p>We've now arrived at an intersting part: accessing the tree using a subset
-of <l n='xpath'/> and since we're not compatible we call it <l n='lpath'/>. We
-will explain more about its usage in other documents.</p>
---ldx]]--
-
-local lpathcalls = 0 -- statisctics
-local lpathcached = 0 -- statisctics
-
-do
-
- xml.functions = xml.functions or { }
- xml.expressions = xml.expressions or { }
-
- local functions = xml.functions
- local expressions = xml.expressions
-
- local actions = {
- [10] = "stay",
- [11] = "parent",
- [12] = "subtree root",
- [13] = "document root",
- [14] = "any",
- [15] = "many",
- [16] = "initial",
- [20] = "match",
- [21] = "match one of",
- [22] = "match and attribute eq",
- [23] = "match and attribute ne",
- [24] = "match one of and attribute eq",
- [25] = "match one of and attribute ne",
- [27] = "has attribute",
- [28] = "has value",
- [29] = "fast match",
- [30] = "select",
- [31] = "expression",
- [40] = "processing instruction",
- }
-
- -- a rather dumb lpeg
-
- local P, S, R, C, V, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc
-
- -- instead of using functions we just parse a few names which saves a call
- -- later on
-
- local lp_position = P("position()") / "ps"
- local lp_index = P("index()") / "id"
- local lp_text = P("text()") / "tx"
- local lp_name = P("name()") / "(ns~='' and ns..':'..tg)" -- "((rt.ns~='' and rt.ns..':'..rt.tg) or '')"
- local lp_tag = P("tag()") / "tg" -- (rt.tg or '')
- local lp_ns = P("ns()") / "ns" -- (rt.ns or '')
- local lp_noequal = P("!=") / "~=" + P("<=") + P(">=") + P("==")
- local lp_doequal = P("=") / "=="
- local lp_attribute = P("@") / "" * Cc("(at['") * R("az","AZ","--","__")^1 * Cc("'] or '')")
-
- local lp_lua_function = C(R("az","AZ","--","__")^1 * (P(".") * R("az","AZ","--","__")^1)^1) * P("(") / function(t) -- todo: better . handling
- return t .. "("
- end
-
- local lp_function = C(R("az","AZ","--","__")^1) * P("(") / function(t) -- todo: better . handling
- if expressions[t] then
- return "expressions." .. t .. "("
- else
- return "expressions.error("
- end
- end
-
- local lparent = lpeg.P("(")
- local rparent = lpeg.P(")")
- local noparent = 1 - (lparent+rparent)
- local nested = lpeg.P{lparent * (noparent + lpeg.V(1))^0 * rparent}
- local value = lpeg.P(lparent * lpeg.C((noparent + nested)^0) * rparent) -- lpeg.P{"("*C(((1-S("()"))+V(1))^0)*")"}
-
- -- if we use a dedicated namespace then we don't need to pass rt and k
-
- local lp_special = (C(P("name")+P("text")+P("tag"))) * value / function(t,s)
- if expressions[t] then
- if s then
- return "expressions." .. t .. "(r,k," .. s ..")"
- else
- return "expressions." .. t .. "(r,k)"
- end
- else
- return "expressions.error(" .. t .. ")"
- end
- end
-
- local converter = lpeg.Cs ( (
- lp_position +
- lp_index +
- lp_text + lp_name + -- fast one
- lp_special +
- lp_noequal + lp_doequal +
- lp_attribute +
- lp_lua_function +
- lp_function +
- 1 )^1 )
-
- -- expressions,root,rootdt,k,e,edt,ns,tg,idx,hsh[tg] or 1
-
- local template = [[
- return function(expressions,r,d,k,e,dt,ns,tg,id,ps)
- local at, tx = e.at or { }, dt[1] or ""
- return %s
- end
- ]]
-
- local function make_expression(str)
- str = converter:match(str)
- return str, loadstring(format(template,str))()
- end
-
- local map = { }
-
- local space = S(' \r\n\t')
- local squote = S("'")
- local dquote = S('"')
- local lparent = P('(')
- local rparent = P(')')
- local atsign = P('@')
- local lbracket = P('[')
- local rbracket = P(']')
- local exclam = P('!')
- local period = P('.')
- local eq = P('==') + P('=')
- local ne = P('<>') + P('!=')
- local star = P('*')
- local slash = P('/')
- local colon = P(':')
- local bar = P('|')
- local hat = P('^')
- local valid = R('az', 'AZ', '09') + S('_-')
- local name_yes = C(valid^1 + star) * colon * C(valid^1 + star) -- permits ns:* *:tg *:*
- local name_nop = Cc("*") * C(valid^1)
- local name = name_yes + name_nop
- local number = C((S('+-')^0 * R('09')^1)) / tonumber
- local names = (bar^0 * name)^1
- local morenames = name * (bar^0 * name)^1
- local instructiontag = P('pi::')
- local spacing = C(space^0)
- local somespace = space^1
- local optionalspace = space^0
- local text = C(valid^0)
- local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote)
- local empty = 1-slash
-
- local is_eq = lbracket * atsign * name * eq * value * rbracket
- local is_ne = lbracket * atsign * name * ne * value * rbracket
- local is_attribute = lbracket * atsign * name * rbracket
- local is_value = lbracket * value * rbracket
- local is_number = lbracket * number * rbracket
-
- local nobracket = 1-(lbracket+rbracket) -- must be improved
- local is_expression = lbracket * C(((C(nobracket^1))/make_expression)) * rbracket
-
- local is_expression = lbracket * (C(nobracket^1))/make_expression * rbracket
-
- local is_one = name
- local is_none = exclam * name
- local is_one_of = ((lparent * names * rparent) + morenames)
- local is_none_of = exclam * ((lparent * names * rparent) + morenames)
-
- local stay = (period )
- local parent = (period * period ) / function( ) map[#map+1] = { 11 } end
- local subtreeroot = (slash + hat ) / function( ) map[#map+1] = { 12 } end
- local documentroot = (hat * hat ) / function( ) map[#map+1] = { 13 } end
- local any = (star ) / function( ) map[#map+1] = { 14 } end
- local many = (star * star ) / function( ) map[#map+1] = { 15 } end
- local initial = (hat * hat * hat ) / function( ) map[#map+1] = { 16 } end
-
- local match = (is_one ) / function(...) map[#map+1] = { 20, true , ... } end
- local match_one_of = (is_one_of ) / function(...) map[#map+1] = { 21, true , ... } end
- local dont_match = (is_none ) / function(...) map[#map+1] = { 20, false, ... } end
- local dont_match_one_of = (is_none_of ) / function(...) map[#map+1] = { 21, false, ... } end
-
- local match_and_eq = (is_one * is_eq ) / function(...) map[#map+1] = { 22, true , ... } end
- local match_and_ne = (is_one * is_ne ) / function(...) map[#map+1] = { 23, true , ... } end
- local dont_match_and_eq = (is_none * is_eq ) / function(...) map[#map+1] = { 22, false, ... } end
- local dont_match_and_ne = (is_none * is_ne ) / function(...) map[#map+1] = { 23, false, ... } end
-
- local match_one_of_and_eq = (is_one_of * is_eq ) / function(...) map[#map+1] = { 24, true , ... } end
- local match_one_of_and_ne = (is_one_of * is_ne ) / function(...) map[#map+1] = { 25, true , ... } end
- local dont_match_one_of_and_eq = (is_none_of * is_eq ) / function(...) map[#map+1] = { 24, false, ... } end
- local dont_match_one_of_and_ne = (is_none_of * is_ne ) / function(...) map[#map+1] = { 25, false, ... } end
-
- local has_attribute = (is_one * is_attribute) / function(...) map[#map+1] = { 27, true , ... } end
- local has_value = (is_one * is_value ) / function(...) map[#map+1] = { 28, true , ... } end
- local dont_has_attribute = (is_none * is_attribute) / function(...) map[#map+1] = { 27, false, ... } end
- local dont_has_value = (is_none * is_value ) / function(...) map[#map+1] = { 28, false, ... } end
- local position = (is_one * is_number ) / function(...) map[#map+1] = { 30, true, ... } end
- local dont_position = (is_none * is_number ) / function(...) map[#map+1] = { 30, false, ... } end
-
- local expression = (is_one * is_expression)/ function(...) map[#map+1] = { 31, true, ... } end
- local dont_expression = (is_none * is_expression)/ function(...) map[#map+1] = { 31, false, ... } end
-
- local self_expression = ( is_expression) / function(...) if #map == 0 then map[#map+1] = { 11 } end
- map[#map+1] = { 31, true, "*", "*", ... } end
- local dont_self_expression = (exclam * is_expression) / function(...) if #map == 0 then map[#map+1] = { 11 } end
- map[#map+1] = { 31, false, "*", "*", ... } end
-
- local instruction = (instructiontag * text ) / function(...) map[#map+1] = { 40, ... } end
- local nothing = (empty ) / function( ) map[#map+1] = { 15 } end -- 15 ?
- local crap = (1-slash)^1
-
- -- a few ugly goodies:
-
- local docroottag = P('^^') / function( ) map[#map+1] = { 12 } end
- local subroottag = P('^') / function( ) map[#map+1] = { 13 } end
- local roottag = P('root::') / function( ) map[#map+1] = { 12 } end
- local parenttag = P('parent::') / function( ) map[#map+1] = { 11 } end
- local childtag = P('child::')
- local selftag = P('self::')
-
- -- there will be more and order will be optimized
-
- local selector = (
- instruction +
---~ many + any + -- brrr, not here !
- parent + stay +
- dont_position + position +
- dont_match_one_of_and_eq + dont_match_one_of_and_ne +
- match_one_of_and_eq + match_one_of_and_ne +
- dont_match_and_eq + dont_match_and_ne +
- match_and_eq + match_and_ne +
- dont_expression + expression +
- dont_self_expression + self_expression +
- has_attribute + has_value +
- dont_match_one_of + match_one_of +
- dont_match + match +
- many + any +
- crap + empty
- )
-
- local grammar = P { "startup",
- startup = (initial + documentroot + subtreeroot + roottag + docroottag + subroottag)^0 * V("followup"),
- followup = ((slash + parenttag + childtag + selftag)^0 * selector)^1,
- }
-
- local function compose(str)
- if not str or str == "" then
- -- wildcard
- return true
- elseif str == '/' then
- -- root
- return false
- else
- map = { }
- grammar:match(str)
- if #map == 0 then
- return true
- else
- local m = map[1][1]
- if #map == 1 then
- if m == 14 or m == 15 then
- -- wildcard
- return true
- elseif m == 12 then
- -- root
- return false
- end
- elseif #map == 2 and m == 12 and map[2][1] == 20 then
- -- return { { 29, map[2][2], map[2][3], map[2][4], map[2][5] } }
- map[2][1] = 29
- return { map[2] }
- end
- if m ~= 11 and m ~= 12 and m ~= 13 and m ~= 14 and m ~= 15 and m ~= 16 then
- insert(map, 1, { 16 })
- end
- -- print(gsub(table.serialize(map),"[ \n]+"," "))
- return map
- end
- end
- end
-
- local cache = { }
-
- function xml.lpath(pattern,trace)
- lpathcalls = lpathcalls + 1
- if type(pattern) == "string" then
- local result = cache[pattern]
- if result == nil then -- can be false which is valid -)
- result = compose(pattern)
- cache[pattern] = result
- lpathcached = lpathcached + 1
- end
- if trace or trace_lpath then
- xml.lshow(result)
- end
- return result
- else
- return pattern
- end
- end
-
- function xml.cached_patterns()
- return cache
- end
-
--- we run out of locals (limited to 200)
---
--- local fallbackreport = (texio and texio.write) or io.write
-
- function xml.lshow(pattern,report)
--- report = report or fallbackreport
- report = report or (texio and texio.write) or io.write
- local lp = xml.lpath(pattern)
- if lp == false then
- report(" -: root\n")
- elseif lp == true then
- report(" -: wildcard\n")
- else
- if type(pattern) == "string" then
- report(format("pattern: %s\n",pattern))
- end
- for k=1,#lp do
- local v = lp[k]
- if #v > 1 then
- local t = { }
- for i=2,#v do
- local vv = v[i]
- if type(vv) == "string" then
- t[#t+1] = (vv ~= "" and vv) or "#"
- elseif type(vv) == "boolean" then
- t[#t+1] = (vv and "==") or "<>"
- end
- end
- report(format("%2i: %s %s -> %s\n", k,v[1],actions[v[1]],concat(t," ")))
- else
- report(format("%2i: %s %s\n", k,v[1],actions[v[1]]))
- end
- end
- end
- end
-
- function xml.xshow(e,...) -- also handy when report is given, use () to isolate first e
- local t = { ... }
--- local report = (type(t[#t]) == "function" and t[#t]) or fallbackreport
- local report = (type(t[#t]) == "function" and t[#t]) or (texio and texio.write) or io.write
- if e == nil then
- report("<!-- no element -->\n")
- elseif type(e) ~= "table" then
- report(tostring(e))
- elseif e.tg then
- report(tostring(e) .. "\n")
- else
- for i=1,#e do
- report(tostring(e[i]) .. "\n")
- end
- end
- end
-
-end
-
---[[ldx--
-<p>An <l n='lpath'/> is converted to a table with instructions for traversing the
-tree. Hoever, simple cases are signaled by booleans. Because we don't know in
-advance what we want to do with the found element the handle gets three arguments:</p>
-
-<lines>
-<t>r</t> : the root element of the data table
-<t>d</t> : the data table of the result
-<t>t</t> : the index in the data table of the result
-</lines>
-
-<p> Access to the root and data table makes it possible to construct insert and delete
-functions.</p>
---ldx]]--
-
-do
-
- local functions = xml.functions
- local expressions = xml.expressions
-
- expressions.contains = string.find
- expressions.find = string.find
- expressions.upper = string.upper
- expressions.lower = string.lower
- expressions.number = tonumber
- expressions.boolean = toboolean
-
- expressions.oneof = function(s,...) -- slow
- local t = {...} for i=1,#t do if s == t[i] then return true end end return false
- end
-
- expressions.error = function(str)
- xml.error_handler("unknown function in lpath expression",str or "?")
- return false
- end
-
- functions.text = function(root,k,n) -- unchecked, maybe one deeper
- local t = type(t)
- if t == "string" then
- return t
- else -- todo n
- local rdt = root.dt
- return (rdt and rdt[k]) or root[k] or ""
- end
- end
-
- functions.name = function(d,k,n) -- ns + tg
- local found = false
- n = n or 0
- if not k then
- -- not found
- elseif n == 0 then
- local dk = d[k]
- found = dk and (type(dk) == "table") and dk
- elseif n < 0 then
- for i=k-1,1,-1 do
- local di = d[i]
- if type(di) == "table" then
- if n == -1 then
- found = di
- break
- else
- n = n + 1
- end
- end
- end
- else
- for i=k+1,#d,1 do
- local di = d[i]
- if type(di) == "table" then
- if n == 1 then
- found = di
- break
- else
- n = n - 1
- end
- end
- end
- end
- if found then
- local ns, tg = found.rn or found.ns or "", found.tg
- if ns ~= "" then
- return ns .. ":" .. tg
- else
- return tg
- end
- else
- return ""
- end
- end
-
- functions.tag = function(d,k,n) -- only tg
- local found = false
- n = n or 0
- if not k then
- -- not found
- elseif n == 0 then
- local dk = d[k]
- found = dk and (type(dk) == "table") and dk
- elseif n < 0 then
- for i=k-1,1,-1 do
- local di = d[i]
- if type(di) == "table" then
- if n == -1 then
- found = di
- break
- else
- n = n + 1
- end
- end
- end
- else
- for i=k+1,#d,1 do
- local di = d[i]
- if type(di) == "table" then
- if n == 1 then
- found = di
- break
- else
- n = n - 1
- end
- end
- end
- end
- return (found and found.tg) or ""
- end
-
- expressions.text = functions.text
- expressions.name = functions.name
- expressions.tag = functions.tag
-
- local function traverse(root,pattern,handle,reverse,index,parent,wildcard) -- multiple only for tags, not for namespaces
- if not root then -- error
- return false
- elseif pattern == false then -- root
- handle(root,root.dt,root.ri)
- return false
- elseif pattern == true then -- wildcard
- local rootdt = root.dt
- if rootdt then
- local start, stop, step = 1, #rootdt, 1
- if reverse then
- start, stop, step = stop, start, -1
- end
- for k=start,stop,step do
- if handle(root,rootdt,root.ri or k) then return false end
- if not traverse(rootdt[k],true,handle,reverse) then return false end
- end
- end
- return false
- elseif root.dt then
- index = index or 1
- local action = pattern[index]
- local command = action[1]
- if command == 29 then -- fast case /oeps
- local rootdt = root.dt
- for k=1,#rootdt do
- local e = rootdt[k]
- local tg = e.tg
- if e.tg then
- local ns = e.rn or e.ns
- local ns_a, tg_a = action[3], action[4]
- local matched = (ns_a == "*" or ns == ns_a) and (tg_a == "*" or tg == tg_a)
- if not action[2] then matched = not matched end
- if matched then
- if handle(root,rootdt,k) then return false end
- end
- end
- end
- elseif command == 11 then -- parent
- local ep = root.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- else
- if (command == 16 or command == 12) and index == 1 then -- initial
- -- wildcard = true
- wildcard = command == 16 -- ok?
- index = index + 1
- action = pattern[index]
- command = action and action[1] or 0 -- something is wrong
- end
- if command == 11 then -- parent
- local ep = root.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- else
- local rootdt = root.dt
- local start, stop, step, n, dn = 1, #rootdt, 1, 0, 1
- if command == 30 then
- if action[5] < 0 then
- start, stop, step = stop, start, -1
- dn = -1
- end
- elseif reverse and index == #pattern then
- start, stop, step = stop, start, -1
- end
- local idx = 0
- local hsh = { } -- this will slooow down the lot
- for k=start,stop,step do -- we used to have functions for all but a case is faster
- local e = rootdt[k]
- local ns, tg = e.rn or e.ns, e.tg
- if tg then
- -- we can optimize this for simple searches, but it probably does not pay off
- hsh[tg] = (hsh[tg] or 0) + 1
- idx = idx + 1
- if command == 30 then
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- if matched then
- n = n + dn
- if n == action[5] then
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- break
- end
- elseif wildcard then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- end
- else
- local matched, multiple = false, false
- if command == 20 then -- match
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- elseif command == 21 then -- match one of
- multiple = true
- for i=3,#action,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- elseif command == 22 then -- eq
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- matched = matched and e.at[action[6]] == action[7]
- elseif command == 23 then -- ne
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = mached and e.at[action[6]] ~= action[7]
- elseif command == 24 then -- one of eq
- multiple = true
- for i=3,#action-2,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[#action-1]] == action[#action]
- elseif command == 25 then -- one of ne
- multiple = true
- for i=3,#action-2,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[#action-1]] ~= action[#action]
- elseif command == 27 then -- has attribute
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[5]]
- elseif command == 28 then -- has value
- local edt, ns_a, tg_a = e.dt, action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = matched and edt and edt[1] == action[5]
- elseif command == 31 then
- local edt, ns_a, tg_a = e.dt, action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- if matched then
- matched = action[6](expressions,root,rootdt,k,e,edt,ns,tg,idx,hsh[tg] or 1)
- end
- end
- if matched then -- combine tg test and at test
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- if wildcard then
- if multiple then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- else
- -- maybe or multiple; anyhow, check on (section|title) vs just section and title in example in lxml
- if not traverse(e,pattern,handle,reverse,index,root) then return false end
- end
- end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- elseif command == 14 then -- any
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- elseif command == 15 then -- many
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root,true) then return false end
- end
- -- not here : 11
- elseif command == 11 then -- parent
- local ep = e.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,root,index+1) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- elseif command == 40 and e.special and tg == "@pi@" then -- pi
- local pi = action[2]
- if pi ~= "" then
- local pt = e.dt[1]
- if pt and pt:find(pi) then
- if handle(root,rootdt,k) then
- return false
- end
- end
- elseif handle(root,rootdt,k) then
- return false
- end
- elseif wildcard then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- end
- end
- else
- -- not here : 11
- if command == 11 then -- parent
- local ep = e.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- break -- else loop
- end
- end
- end
- end
- end
- end
- return true
- end
-
- xml.traverse = traverse
-
-end
-
---[[ldx--
-<p>Next come all kind of locators and manipulators. The most generic function here
-is <t>xml.filter(root,pattern)</t>. All registers functions in the filters namespace
-can be path of a search path, as in:</p>
-
-<typing>
-local r, d, k = xml.filter(root,"/a/b/c/position(4)"
-</typing>
---ldx]]--
-
-do
-
- local traverse, lpath, convert = xml.traverse, xml.lpath, xml.convert
-
- xml.filters = { }
-
- function xml.filters.default(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end)
- return dt and dt[dk], rt, dt, dk
- end
- function xml.filters.attributes(root,pattern,arguments)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk = r, d, k return true end)
- local ekat = (dt and dt[dk] and dt[dk].at) or (rt and rt.at)
- if ekat then
- if arguments then
- return ekat[arguments] or "", rt, dt, dk
- else
- return ekat, rt, dt, dk
- end
- else
- return { }, rt, dt, dk
- end
- end
- function xml.filters.reverse(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end, 'reverse')
- return dt and dt[dk], rt, dt, dk
- end
- function xml.filters.count(root,pattern,everything)
- local n = 0
- traverse(root, lpath(pattern), function(r,d,t)
- if everything or type(d[t]) == "table" then
- n = n + 1
- end
- end)
- return n
- end
- function xml.filters.elements(root, pattern) -- == all
- local t = { }
- traverse(root, lpath(pattern), function(r,d,k)
- local e = d[k]
- if e then
- t[#t+1] = e
- end
- end)
- return t
- end
- function xml.filters.texts(root, pattern)
- local t = { }
- traverse(root, lpath(pattern), function(r,d,k)
- local e = d[k]
- if e and e.dt then
- t[#t+1] = e.dt
- end
- end)
- return t
- end
- function xml.filters.first(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end)
- return dt and dt[dk], rt, dt, dk
- end
- function xml.filters.last(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end, 'reverse')
- return dt and dt[dk], rt, dt, dk
- end
- function xml.filters.index(root,pattern,arguments)
- local rt, dt, dk, reverse, i = nil, nil, nil, false, tonumber(arguments or '1') or 1
- if i and i ~= 0 then
- if i < 0 then
- reverse, i = true, -i
- end
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk, i = r, d, k, i-1 return i == 0 end, reverse)
- if i == 0 then
- return dt and dt[dk], rt, dt, dk
- end
- end
- return nil, nil, nil, nil
- end
- function xml.filters.attribute(root,pattern,arguments)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk = r, d, k return true end)
- local ekat = (dt and dt[dk] and dt[dk].at) or (rt and rt.at)
- return (ekat and (ekat[arguments] or ekat[gsub(arguments,"^([\"\'])(.*)%1$","%2")])) or ""
- end
- function xml.filters.text(root,pattern,arguments) -- ?? why index, tostring slow
- local dtk, rt, dt, dk = xml.filters.index(root,pattern,arguments)
- if dtk then -- n
- local dtkdt = dtk.dt
- if not dtkdt then
- return "", rt, dt, dk
- elseif #dtkdt == 1 and type(dtkdt[1]) == "string" then
- return dtkdt[1], rt, dt, dk
- else
- return xml.tostring(dtkdt), rt, dt, dk
- end
- else
- return "", rt, dt, dk
- end
- end
- function xml.filters.tag(root,pattern,n)
- local tag = ""
- traverse(root, lpath(pattern), function(r,d,k)
- tag = xml.functions.tag(d,k,n and tonumber(n))
- return true
- end)
- return tag
- end
- function xml.filters.name(root,pattern,n)
- local tag = ""
- traverse(root, lpath(pattern), function(r,d,k)
- tag = xml.functions.name(d,k,n and tonumber(n))
- return true
- end)
- return tag
- end
-
- --[[ldx--
- <p>For splitting the filter function from the path specification, we can
- use string matching or lpeg matching. Here the difference in speed is
- neglectable but the lpeg variant is more robust.</p>
- --ldx]]--
-
- -- not faster but hipper ... although ... i can't get rid of the trailing / in the path
-
- local P, S, R, C, V, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc
-
- local slash = P('/')
- local name = (R("az","AZ","--","__"))^1
- local path = C(((1-slash)^0 * slash)^1)
- local argument = P { "(" * C(((1 - S("()")) + V(1))^0) * ")" }
- local action = Cc(1) * path * C(name) * argument
- local attribute = Cc(2) * path * P('@') * C(name)
- local direct = Cc(3) * Cc("../*") * slash^0 * C(name) * argument
-
- local parser = direct + action + attribute
-
- local filters = xml.filters
- local attribute_filter = xml.filters.attributes
- local default_filter = xml.filters.default
-
- -- todo: also hash, could be gc'd
-
- function xml.filter(root,pattern)
- local kind, a, b, c = parser:match(pattern)
- if kind == 1 or kind == 3 then
- return (filters[b] or default_filter)(root,a,c)
- elseif kind == 2 then
- return attribute_filter(root,a,b)
- else
- return default_filter(root,pattern)
- end
- end
-
- --~ slightly faster, but first we need a proper test file
- --~
- --~ local hash = { }
- --~
- --~ function xml.filter(root,pattern)
- --~ local h = hash[pattern]
- --~ if not h then
- --~ local kind, a, b, c = parser:match(pattern)
- --~ if kind == 1 then
- --~ h = { kind, filters[b] or default_filter, a, b, c }
- --~ elseif kind == 2 then
- --~ h = { kind, attribute_filter, a, b, c }
- --~ else
- --~ h = { kind, default_filter, a, b, c }
- --~ end
- --~ hash[pattern] = h
- --~ end
- --~ local kind = h[1]
- --~ if kind == 1 then
- --~ return h[2](root,h[2],h[4])
- --~ elseif kind == 2 then
- --~ return h[2](root,h[2],h[3])
- --~ else
- --~ return h[2](root,pattern)
- --~ end
- --~ end
-
- --[[ldx--
- <p>The following functions collect elements and texts.</p>
- --ldx]]--
-
- -- still somewhat bugged
-
- function xml.collect_elements(root, pattern, ignorespaces)
- local rr, dd = { }, { }
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d and d[k]
- if dk then
- if ignorespaces and type(dk) == "string" and dk:find("[^%S]") then
- -- ignore
- else
- local n = #rr+1
- rr[n], dd[n] = r, dk
- end
- end
- end)
- return dd, rr
- end
-
- function xml.collect_texts(root, pattern, flatten)
- local t = { } -- no r collector
- traverse(root, lpath(pattern), function(r,d,k)
- if d then
- local ek = d[k]
- local tx = ek and ek.dt
- if flatten then
- if tx then
- t[#t+1] = xml.tostring(tx) or ""
- else
- t[#t+1] = ""
- end
- else
- t[#t+1] = tx or ""
- end
- else
- t[#t+1] = ""
- end
- end)
- return t
- end
-
- function xml.collect_tags(root, pattern, nonamespace)
- local t = { }
- xml.traverse(root, xml.lpath(pattern), function(r,d,k)
- local dk = d and d[k]
- if dk and type(dk) == "table" then
- local ns, tg = e.ns, e.tg
- if nonamespace then
- t[#t+1] = tg -- if needed we can return an extra table
- elseif ns == "" then
- t[#t+1] = tg
- else
- t[#t+1] = ns .. ":" .. tg
- end
- end
- end)
- return #t > 0 and {}
- end
-
- --[[ldx--
- <p>Often using an iterators looks nicer in the code than passing handler
- functions. The <l n='lua'/> book describes how to use coroutines for that
- purpose (<url href='http://www.lua.org/pil/9.3.html'/>). This permits
- code like:</p>
-
- <typing>
- for r, d, k in xml.elements(xml.load('text.xml'),"title") do
- print(d[k])
- end
- </typing>
-
- <p>Which will print all the titles in the document. The iterator variant takes
- 1.5 times the runtime of the function variant which is due to the overhead in
- creating the wrapper. So, instead of:</p>
-
- <typing>
- function xml.filters.first(root,pattern)
- for rt,dt,dk in xml.elements(root,pattern)
- return dt and dt[dk], rt, dt, dk
- end
- return nil, nil, nil, nil
- end
- </typing>
-
- <p>We use the function variants in the filters.</p>
- --ldx]]--
-
- local wrap, yield = coroutine.wrap, coroutine.yield
-
- function xml.elements(root,pattern,reverse)
- return wrap(function() traverse(root, lpath(pattern), yield, reverse) end)
- end
-
- function xml.elements_only(root,pattern,reverse)
- return wrap(function() traverse(root, lpath(pattern), function(r,d,k) yield(d[k]) end, reverse) end)
- end
-
- function xml.each_element(root, pattern, handle, reverse)
- local ok
- traverse(root, lpath(pattern), function(r,d,k) ok = true handle(r,d,k) end, reverse)
- return ok
- end
-
- function xml.process_elements(root, pattern, handle)
- traverse(root, lpath(pattern), function(r,d,k)
- local dkdt = d[k].dt
- if dkdt then
- for i=1,#dkdt do
- local v = dkdt[i]
- if v.tg then handle(v) end
- end
- end
- end)
- end
-
- function xml.process_attributes(root, pattern, handle)
- traverse(root, lpath(pattern), function(r,d,k)
- local ek = d[k]
- local a = ek.at or { }
- handle(a)
- if next(a) then -- next is faster than type (and >0 test)
- ek.at = a
- else
- ek.at = nil
- end
- end)
- end
-
- --[[ldx--
- <p>We've now arrives at the functions that manipulate the tree.</p>
- --ldx]]--
-
- function xml.inject_element(root, pattern, element, prepend)
- if root and element then
- local matches, collect = { }, nil
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element then
- collect = function(r,d,k) matches[#matches+1] = { r, d, k, element } end
- traverse(root, lpath(pattern), collect)
- for i=1,#matches do
- local m = matches[i]
- local r, d, k, element, edt = m[1], m[2], m[3], m[4], nil
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
- if r.ri then
- edt = r.dt[r.ri].dt
- else
- edt = d and d[k] and d[k].dt
- end
- if edt then
- local be, af
- if prepend then
- be, af = xml.copy(element), edt
- else
- be, af = edt, xml.copy(element)
- end
- for i=1,#af do
- be[#be+1] = af[i]
- end
- if r.ri then
- r.dt[r.ri].dt = be
- else
- d[k].dt = be
- end
- else
- -- r.dt = element.dt -- todo
- end
- end
- end
- end
- end
-
- -- todo: copy !
-
- function xml.insert_element(root, pattern, element, before) -- todo: element als functie
- if root and element then
- if pattern == "/" then
- xml.inject_element(root, pattern, element, before)
- else
- local matches, collect = { }, nil
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element and element.ri then
- element = element.dt[element.ri]
- end
- if element then
- collect = function(r,d,k) matches[#matches+1] = { r, d, k, element } end
- traverse(root, lpath(pattern), collect)
- for i=#matches,1,-1 do
- local m = matches[i]
- local r, d, k, element = m[1], m[2], m[3], m[4]
- if not before then k = k + 1 end
- if element.tg then
- insert(d,k,element) -- untested
---~ elseif element.dt then
---~ for _,v in ipairs(element.dt) do -- i added
---~ insert(d,k,v)
---~ k = k + 1
---~ end
---~ end
- else
- local edt = element.dt
- if edt then
- for i=1,#edt do
- insert(d,k,edt[i])
- k = k + 1
- end
- end
- end
- end
- end
- end
- end
- end
-
- xml.insert_element_after = xml.insert_element
- xml.insert_element_before = function(r,p,e) xml.insert_element(r,p,e,true) end
- xml.inject_element_after = xml.inject_element
- xml.inject_element_before = function(r,p,e) xml.inject_element(r,p,e,true) end
-
- function xml.delete_element(root, pattern)
- local matches, deleted = { }, { }
- local collect = function(r,d,k) matches[#matches+1] = { r, d, k } end
- traverse(root, lpath(pattern), collect)
- for i=#matches,1,-1 do
- local m = matches[i]
- deleted[#deleted+1] = table.remove(m[2],m[3])
- end
- return deleted
- end
-
- function xml.replace_element(root, pattern, element)
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element and element.ri then
- element = element.dt[element.ri]
- end
- if element then
- traverse(root, lpath(pattern), function(rm, d, k)
- d[k] = element.dt -- maybe not clever enough
- end)
- end
- end
-
- local function load_data(name) -- == io.loaddata
- local f, data = io.open(name), ""
- if f then
- data = f:read("*all",'b') -- 'b' ?
- f:close()
- end
- return data
- end
-
- function xml.include(xmldata,pattern,attribute,recursive,loaddata)
- -- parse="text" (default: xml), encoding="" (todo)
- -- attribute = attribute or 'href'
- pattern = pattern or 'include'
- loaddata = loaddata or load_data
- local function include(r,d,k)
- local ek, name = d[k], nil
- if not attribute or attribute == "" then
- local ekdt = ek.dt
- name = (type(ekdt) == "table" and ekdt[1]) or ekdt
- end
- if not name then
- if ek.at then
- for a in gmatch(attribute or "href","([^|]+)") do
- name = ek.at[a]
- if name then break end
- end
- end
- end
- local data = (name and name ~= "" and loaddata(name)) or ""
- if data == "" then
- xml.empty(d,k)
- elseif ek.at["parse"] == "text" then -- for the moment hard coded
- d[k] = xml.escaped(data)
- else
- local xi = xml.convert(data)
- if not xi then
- xml.empty(d,k)
- else
- if recursive then
- xml.include(xi,pattern,attribute,recursive,loaddata)
- end
- xml.assign(d,k,xi)
- end
- end
- end
- xml.each_element(xmldata, pattern, include)
- end
-
- function xml.strip_whitespace(root, pattern, nolines) -- strips all leading and trailing space !
- traverse(root, lpath(pattern), function(r,d,k)
- local dkdt = d[k].dt
- if dkdt then -- can be optimized
- local t = { }
- for i=1,#dkdt do
- local str = dkdt[i]
- if type(str) == "string" then
-
- if str == "" then
- -- stripped
- else
- if nolines then
- str = gsub(str,"[ \n\r\t]+"," ")
- end
- if str == "" then
- -- stripped
- else
- t[#t+1] = str
- end
- end
- else
- t[#t+1] = str
- end
- end
- d[k].dt = t
- end
- end)
- end
-
- local function rename_space(root, oldspace, newspace) -- fast variant
- local ndt = #root.dt
- for i=1,ndt or 0 do
- local e = root[i]
- if type(e) == "table" then
- if e.ns == oldspace then
- e.ns = newspace
- if e.rn then
- e.rn = newspace
- end
- end
- local edt = e.dt
- if edt then
- rename_space(edt, oldspace, newspace)
- end
- end
- end
- end
-
- xml.rename_space = rename_space
-
- function xml.remap_tag(root, pattern, newtg)
- traverse(root, lpath(pattern), function(r,d,k)
- d[k].tg = newtg
- end)
- end
- function xml.remap_namespace(root, pattern, newns)
- traverse(root, lpath(pattern), function(r,d,k)
- d[k].ns = newns
- end)
- end
- function xml.check_namespace(root, pattern, newns)
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d[k]
- if (not dk.rn or dk.rn == "") and dk.ns == "" then
- dk.rn = newns
- end
- end)
- end
- function xml.remap_name(root, pattern, newtg, newns, newrn)
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d[k]
- dk.tg = newtg
- dk.ns = newns
- dk.rn = newrn
- end)
- end
-
- function xml.filters.found(root,pattern,check_content)
- local found = false
- traverse(root, lpath(pattern), function(r,d,k)
- if check_content then
- local dk = d and d[k]
- found = dk and dk.dt and next(dk.dt) and true
- else
- found = true
- end
- return true
- end)
- return found
- end
-
-end
-
---[[ldx--
-<p>Here are a few synonyms.</p>
---ldx]]--
-
-xml.filters.position = xml.filters.index
-
-xml.count = xml.filters.count
-xml.index = xml.filters.index
-xml.position = xml.filters.index
-xml.first = xml.filters.first
-xml.last = xml.filters.last
-xml.found = xml.filters.found
-
-xml.each = xml.each_element
-xml.process = xml.process_element
-xml.strip = xml.strip_whitespace
-xml.collect = xml.collect_elements
-xml.all = xml.collect_elements
-
-xml.insert = xml.insert_element_after
-xml.inject = xml.inject_element_after
-xml.after = xml.insert_element_after
-xml.before = xml.insert_element_before
-xml.delete = xml.delete_element
-xml.replace = xml.replace_element
-
---[[ldx--
-<p>The following helper functions best belong to the <t>lmxl-ini</t>
-module. Some are here because we need then in the <t>mk</t>
-document and other manuals, others came up when playing with
-this module. Since this module is also used in <l n='mtxrun'/> we've
-put them here instead of loading mode modules there then needed.</p>
---ldx]]--
-
-function xml.gsub(t,old,new)
- local dt = t.dt
- if dt then
- for k=1,#dt do
- local v = dt[k]
- if type(v) == "string" then
- dt[k] = gsub(v,old,new)
- else
- xml.gsub(v,old,new)
- end
- end
- end
-end
-
-function xml.strip_leading_spaces(dk,d,k) -- cosmetic, for manual
- if d and k and d[k-1] and type(d[k-1]) == "string" then
- local s = d[k-1]:match("\n(%s+)")
- xml.gsub(dk,"\n"..string.rep(" ",#s),"\n")
- end
-end
-
-function xml.serialize_path(root,lpath,handle)
- local dk, r, d, k = xml.first(root,lpath)
- dk = xml.copy(dk)
- xml.strip_leading_spaces(dk,d,k)
- xml.serialize(dk,handle)
-end
-
---~ xml.escapes = { ['&'] = '&amp;', ['<'] = '&lt;', ['>'] = '&gt;', ['"'] = '&quot;' }
---~ xml.unescapes = { } for k,v in pairs(xml.escapes) do xml.unescapes[v] = k end
-
---~ function xml.escaped (str) return (gsub(str,"(.)" , xml.escapes )) end
---~ function xml.unescaped(str) return (gsub(str,"(&.-;)", xml.unescapes)) end
---~ function xml.cleansed (str) return (gsub(str,"<.->" , '' )) end -- "%b<>"
-
-do
-
- local P, S, R, C, V, Cc, Cs = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Cs
-
- -- 100 * 2500 * "oeps< oeps> oeps&" : gsub:lpeg|lpeg|lpeg
- --
- -- 1021:0335:0287:0247
-
- -- 10 * 1000 * "oeps< oeps> oeps& asfjhalskfjh alskfjh alskfjh alskfjh ;al J;LSFDJ"
- --
- -- 1559:0257:0288:0190 (last one suggested by roberto)
-
- -- escaped = Cs((S("<&>") / xml.escapes + 1)^0)
- -- escaped = Cs((S("<")/"&lt;" + S(">")/"&gt;" + S("&")/"&amp;" + 1)^0)
- local normal = (1 - S("<&>"))^0
- local special = P("<")/"&lt;" + P(">")/"&gt;" + P("&")/"&amp;"
- local escaped = Cs(normal * (special * normal)^0)
-
- -- 100 * 1000 * "oeps&lt; oeps&gt; oeps&amp;" : gsub:lpeg == 0153:0280:0151:0080 (last one by roberto)
-
- -- unescaped = Cs((S("&lt;")/"<" + S("&gt;")/">" + S("&amp;")/"&" + 1)^0)
- -- unescaped = Cs((((P("&")/"") * (P("lt")/"<" + P("gt")/">" + P("amp")/"&") * (P(";")/"")) + 1)^0)
- local normal = (1 - S"&")^0
- local special = P("&lt;")/"<" + P("&gt;")/">" + P("&amp;")/"&"
- local unescaped = Cs(normal * (special * normal)^0)
-
- -- 100 * 5000 * "oeps <oeps bla='oeps' foo='bar'> oeps </oeps> oeps " : gsub:lpeg == 623:501 msec (short tags, less difference)
-
- local cleansed = Cs(((P("<") * (1-P(">"))^0 * P(">"))/"" + 1)^0)
-
- xml.escaped_pattern = escaped
- xml.unescaped_pattern = unescaped
- xml.cleansed_pattern = cleansed
-
- function xml.escaped (str) return escaped :match(str) end
- function xml.unescaped(str) return unescaped:match(str) end
- function xml.cleansed (str) return cleansed :match(str) end
-
-end
-
-function xml.join(t,separator,lastseparator)
- if #t > 0 then
- local result = { }
- for k,v in pairs(t) do
- result[k] = xml.tostring(v)
- end
- if lastseparator then
- return concat(result,separator or "",1,#result-1) .. (lastseparator or "") .. result[#result]
- else
- return concat(result,separator)
- end
- else
- return ""
- end
-end
-
-
---[[ldx--
-<p>We provide (at least here) two entity handlers. The more extensive
-resolver consults a hash first, tries to convert to <l n='utf'/> next,
-and finaly calls a handler when defines. When this all fails, the
-original entity is returned.</p>
---ldx]]--
-
-do if unicode and unicode.utf8 then
-
- xml.entities = xml.entities or { } -- xml.entity_handler == function
-
- function xml.entity_handler(e)
- return format("[%s]",e)
- end
-
- local char = unicode.utf8.char
-
- local function toutf(s)
- return char(tonumber(s,16))
- end
-
- local function utfize(root)
- local d = root.dt
- for k=1,#d do
- local dk = d[k]
- if type(dk) == "string" then
- -- test prevents copying if no match
- if find(dk,"&#x.-;") then
- d[k] = gsub(dk,"&#x(.-);",toutf)
- end
- else
- utfize(dk)
- end
- end
- end
-
- xml.utfize = utfize
-
- local function resolve(e) -- hex encoded always first, just to avoid mkii fallbacks
- if find(e,"^#x") then
- return char(tonumber(e:sub(3),16))
- elseif find(e,"^#") then
- return char(tonumber(e:sub(2)))
- else
- local ee = xml.entities[e] -- we cannot shortcut this one (is reloaded)
- if ee then
- return ee
- else
- local h = xml.entity_handler
- return (h and h(e)) or "&" .. e .. ";"
- end
- end
- end
-
- local function resolve_entities(root)
- if not root.special or root.tg == "@rt@" then
- local d = root.dt
- for k=1,#d do
- local dk = d[k]
- if type(dk) == "string" then
- if find(dk,"&.-;") then
- d[k] = gsub(dk,"&(.-);",resolve)
- end
- else
- resolve_entities(dk)
- end
- end
- end
- end
-
- xml.resolve_entities = resolve_entities
-
- function xml.utfize_text(str)
- if find(str,"&#") then
- return (gsub(str,"&#x(.-);",toutf))
- else
- return str
- end
- end
-
- function xml.resolve_text_entities(str) -- maybe an lpeg. maybe resolve inline
- if find(str,"&") then
- return (gsub(str,"&(.-);",resolve))
- else
- return str
- end
- end
-
- function xml.show_text_entities(str)
- if find(str,"&") then
- return (gsub(str,"&(.-);","[%1]"))
- else
- return str
- end
- end
-
- -- experimental, this will be done differently
-
- function xml.merge_entities(root)
- local documententities = root.entities
- local allentities = xml.entities
- if documententities then
- for k, v in next, documententities do
- allentities[k] = v
- end
- end
- end
-
-end end
-
-function xml.statistics()
- return {
- lpathcalls = lpathcalls,
- lpathcached = lpathcached,
- }
-end
-
--- xml.set_text_cleanup(xml.show_text_entities)
--- xml.set_text_cleanup(xml.resolve_text_entities)
-
---~ xml.lshow("/../../../a/(b|c)[@d='e']/f")
---~ xml.lshow("/../../../a/!(b|c)[@d='e']/f")
---~ xml.lshow("/../../../a/!b[@d!='e']/f")
-
---~ x = xml.convert([[
---~ <a>
---~ <b n='01'>01</b>
---~ <b n='02'>02</b>
---~ <b n='03'>03</b>
---~ <b n='04'>OK</b>
---~ <b n='05'>05</b>
---~ <b n='06'>06</b>
---~ <b n='07'>ALSO OK</b>
---~ </a>
---~ ]])
-
---~ xml.settrace("lpath",true)
-
---~ xml.xshow(xml.first(x,"b[position() > 2 and position() < 5 and text() == 'ok']"))
---~ xml.xshow(xml.first(x,"b[position() > 2 and position() < 5 and text() == upper('ok')]"))
---~ xml.xshow(xml.first(x,"b[@n=='03' or @n=='08']"))
---~ xml.xshow(xml.all (x,"b[number(@n)>2 and number(@n)<6]"))
---~ xml.xshow(xml.first(x,"b[find(text(),'ALSO')]"))
-
---~ str = [[
---~ <?xml version="1.0" encoding="utf-8"?>
---~ <story line='mojca'>
---~ <windows>my secret</mouse>
---~ </story>
---~ ]]
-
---~ x = xml.convert([[
---~ <a><b n='01'>01</b><b n='02'>02</b><x>xx</x><b n='03'>03</b><b n='04'>OK</b></a>
---~ ]])
---~ xml.xshow(xml.first(x,"b[tag(2) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(1) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(-1) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(-2) == 'x']"))
-
---~ print(xml.filter(x,"b/tag(2)"))
---~ print(xml.filter(x,"b/tag(1)"))
diff --git a/Master/texmf-dist/tex/context/base/lang-alt.tex b/Master/texmf-dist/tex/context/base/lang-alt.tex
index e45748eadab..f65acbda3ba 100644
--- a/Master/texmf-dist/tex/context/base/lang-alt.tex
+++ b/Master/texmf-dist/tex/context/base/lang-alt.tex
@@ -23,6 +23,8 @@
% 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
@@ -38,54 +40,113 @@
\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!tr] [\v!graphic=Grafik ]
+\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!tr] [\v!january=ocak]
+\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!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!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!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/lang-bal.tex b/Master/texmf-dist/tex/context/base/lang-bal.tex
index 9b0528a27bb..394e9d93c1f 100644
--- a/Master/texmf-dist/tex/context/base/lang-bal.tex
+++ b/Master/texmf-dist/tex/context/base/lang-bal.tex
@@ -1,9 +1,9 @@
%D \module
-%D [ file=lang--bal,
-%D version=1997.09.03,
+%D [ file=lang-bal,
+%D version=2010.01.21,
%D title=\CONTEXT\ Language Macros,
%D subtitle=Baltic Languages,
-%D author=Hans Hagen / Tobias Burnus,
+%D author=Marius Aleknevičius,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
@@ -14,13 +14,105 @@
\writestatus{loading}{ConTeXt Language Macros / Baltic 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 all the translations were done by Marius Aleknevičius. If
+%D you have suggestions, don't hesitate to send us an email.
-% Lettish/Latvian, Lithuanian
+%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/lang-cjk.mkiv b/Master/texmf-dist/tex/context/base/lang-cjk.mkiv
index 138f6d2632a..5f736d4a165 100644
--- a/Master/texmf-dist/tex/context/base/lang-cjk.mkiv
+++ b/Master/texmf-dist/tex/context/base/lang-cjk.mkiv
@@ -133,13 +133,13 @@
\setuplabeltext [\s!ja] [\v!november=11]
\setuplabeltext [\s!ja] [\v!december=12]
-\setuplabeltext [\s!ja] [\v!sunday=月曜日]
-\setuplabeltext [\s!ja] [\v!monday=火曜日]
-\setuplabeltext [\s!ja] [\v!tuesday=水曜日]
-\setuplabeltext [\s!ja] [\v!wednesday=木曜日]
-\setuplabeltext [\s!ja] [\v!thursday=金曜日]
-\setuplabeltext [\s!ja] [\v!friday=土曜日]
-\setuplabeltext [\s!ja] [\v!saturday=日曜日]
+\setuplabeltext [\s!ja] [\v!monday=月曜日]
+\setuplabeltext [\s!ja] [\v!tuesday=火曜日]
+\setuplabeltext [\s!ja] [\v!wednesday=水曜日]
+\setuplabeltext [\s!ja] [\v!thursday=木曜日]
+\setuplabeltext [\s!ja] [\v!friday=金曜日]
+\setuplabeltext [\s!ja] [\v!saturday=土曜日]
+\setuplabeltext [\s!ja] [\v!sunday=日曜日]
%D Korean
diff --git a/Master/texmf-dist/tex/context/base/lang-ger.tex b/Master/texmf-dist/tex/context/base/lang-ger.tex
index b9717ce9af6..1ffbb33e68c 100644
--- a/Master/texmf-dist/tex/context/base/lang-ger.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ger.tex
@@ -315,6 +315,15 @@
\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 ]
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.lua b/Master/texmf-dist/tex/context/base/lang-ini.lua
index e188ad36cc9..239e5390c55 100644
--- a/Master/texmf-dist/tex/context/base/lang-ini.lua
+++ b/Master/texmf-dist/tex/context/base/lang-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lang-ini'] = {
version = 1.001,
- comment = "companion to lang-ini.tex",
+ comment = "companion to lang-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -9,11 +9,12 @@ if not modules then modules = { } end modules ['lang-ini'] = {
-- needs a cleanup (share locals)
local utf = unicode.utf8
-
-local find, lower, format, utfchar = string.find, string.lower, string.format, utf.char
+local utfbyte = utf.byte
+local format = string.format
local concat = table.concat
+local lpegmatch = lpeg.match
-if lang.use_new then lang.use_new(true) end
+local trace_patterns = false trackers.register("languages.patterns", function(v) trace_patterns = v end)
languages = languages or {}
languages.version = 1.009
@@ -31,18 +32,13 @@ local langdata = languages.hyphenation.data
--~ string =lang:hyphenation()
--~ lang:clear_hyphenation()
-
-- we can consider hiding data (faster access too)
---~ local function filter(filename,what)
---~ local data = io.loaddata(resolvers.find_file(filename))
---~ local data = data:match(string.format("\\%s%%s*(%%b{})",what or "patterns"))
---~ return data:match("{%s*(.-)%s*}") or ""
---~ end
-
-- loading the 26 languages that we normally load in mkiv, the string based variant
-- takes .84 seconds (probably due to the sub's) while the lpeg variant takes .78
-- seconds
+--
+-- the following lpeg can probably be improved (it was one of the first I made)
local leftbrace = lpeg.P("{")
local rightbrace = lpeg.P("}")
@@ -56,10 +52,10 @@ local command = lpeg.P("\\patterns")
local parser = (1-command)^0 * command * content
local function filterpatterns(filename)
- if find(filename,"%.rpl") then
+ if file.extname(filename) == "rpl" then
return io.loaddata(resolvers.find_file(filename)) or ""
else
- return parser:match(io.loaddata(resolvers.find_file(filename)) or "")
+ return lpegmatch(parser,io.loaddata(resolvers.find_file(filename)) or "")
end
end
@@ -67,10 +63,10 @@ local command = lpeg.P("\\hyphenation")
local parser = (1-command)^0 * command * content
local function filterexceptions(filename)
- if find(filename,"%.rhl") then
+ if file.extname(filename) == "rhl" then
return io.loaddata(resolvers.find_file(filename)) or ""
else
- return parser:match(io.loaddata(resolvers.find_file(filename)) or {}) -- "" ?
+ return lpegmatch(parser,io.loaddata(resolvers.find_file(filename)) or {}) -- "" ?
end
end
@@ -95,14 +91,22 @@ function languages.hyphenation.number(tag)
return (d and d:id()) or 0
end
+lang.exceptions = lang.hyphenation
+
local function loadthem(tag, filename, filter, target)
statistics.starttiming(languages)
local data = record(tag)
- filename = (filename and filename ~= "" and resolvers.find_file(filename)) or ""
- local ok = filename ~= ""
+ local fullname = (filename and filename ~= "" and resolvers.find_file(filename)) or ""
+ local ok = fullname ~= ""
if ok then
- lang[target](data,filterpatterns(filename))
+ if trace_patterns then
+ logs.report("languages","filtering %s for language '%s' from '%s'",target,tag,fullname)
+ end
+ lang[target](data,filterpatterns(fullname))
else
+ if trace_patterns then
+ logs.report("languages","no %s for language '%s' in '%s'",target,tag,filename or "?")
+ end
lang[target](data,"")
end
langdata[tag] = data
@@ -115,7 +119,7 @@ function languages.hyphenation.loadpatterns(tag, patterns)
end
function languages.hyphenation.loadexceptions(tag, exceptions)
- return loadthem(tag, patterns, filterexceptions, "hyphenation")
+ return loadthem(tag, patterns, filterexceptions, "exceptions")
end
function languages.hyphenation.exceptions(tag, ...)
@@ -142,12 +146,24 @@ function languages.hyphenation.n()
return table.count(langdata)
end
+languages.registered = languages.registered or { }
+languages.associated = languages.associated or { }
+languages.numbers = languages.numbers or { }
+
+storage.register("languages/registered",languages.registered,"languages.registered")
+storage.register("languages/associated",languages.associated,"languages.associated")
+
+local numbers = languages.numbers
+local registered = languages.registered
+local associated = languages.associated
+
-- we can speed this one up with locals if needed
local function tolang(what)
local kind = type(what)
if kind == "number" then
- return langdata[languages.numbers[what]]
+ local w = what >= 0 and what <= 0x7FFF and numbers[what]
+ return (w and langdata[w]) or 0
elseif kind == "string" then
return langdata[what]
else
@@ -155,6 +171,20 @@ local function tolang(what)
end
end
+function languages.setup(what,settings)
+ what = languages.tolang(what or tex.language)
+ local lefthyphen = settings.lefthyphen
+ local righthyphen = settings.righthyphen
+ lefthyphen = lefthyphen ~= "" and lefthyphen or nil
+ righthyphen = righthyphen ~= "" and righthyphen or nil
+ lefthyphen = lefthyphen and utfbyte(lefthyphen) or 0
+ righthyphen = righthyphen and utfbyte(righthyphen) or 0
+ lang.posthyphenchar(what,lefthyphen)
+ lang.prehyphenchar (what,righthyphen)
+ lang.postexhyphenchar(what,lefthyphen)
+ lang.preexhyphenchar (what,righthyphen)
+end
+
function languages.prehyphenchar(what)
return lang.prehyphenchar(tolang(what))
end
@@ -164,16 +194,9 @@ end
languages.tolang = tolang
-languages.registered = languages.registered or { }
-languages.associated = languages.associated or { }
-languages.numbers = languages.numbers or { }
-
-storage.register("languages/registered",languages.registered,"languages.registered")
-storage.register("languages/associated",languages.associated,"languages.associated")
-
function languages.register(tag,parent,patterns,exceptions)
parent = parent or tag
- languages.registered[tag] = {
+ registered[tag] = {
parent = parent,
patterns = patterns or format("lang-%s.pat",parent),
exceptions = exceptions or format("lang-%s.hyp",parent),
@@ -183,14 +206,14 @@ function languages.register(tag,parent,patterns,exceptions)
end
function languages.associate(tag,script,language)
- languages.associated[tag] = { script, language }
+ associated[tag] = { script, language }
end
function languages.association(tag)
if type(tag) == "number" then
- tag = languages.numbers[tag]
+ tag = numbers[tag]
end
- local lat = tag and languages.associated[tag]
+ local lat = tag and associated[tag]
if lat then
return lat[1], lat[2]
else
@@ -199,7 +222,7 @@ function languages.association(tag)
end
function languages.loadable(tag)
- local l = languages.registered[tag]
+ local l = registered[tag]
if l and l.patterns and resolvers.find_file(patterns) then
return true
else
@@ -213,8 +236,8 @@ function languages.enable(tags)
-- beware: we cannot set tex.language, but need tex.normallanguage
for i=1,#tags do
local tag = tags[i]
- local l = languages.registered[tag]
- if l then
+ local l = registered[tag]
+ if l and l ~= "" then
if not l.loaded then
local tag = l.parent
local number = languages.hyphenation.number(tag)
@@ -225,9 +248,12 @@ function languages.enable(tags)
l.number = languages.hyphenation.define(tag)
languages.hyphenation.loadpatterns(tag,l.patterns)
languages.hyphenation.loadexceptions(tag,l.exceptions)
- languages.numbers[l.number] = tag
+ numbers[l.number] = tag
end
l.loaded = true
+ if trace_patterns then
+ logs.report("languages","assigning number %s",l.number)
+ end
end
if l.number > 0 then
return l.number
@@ -261,9 +287,11 @@ languages.hyphenation.loadexceptions("zerolanguage") -- else bug
languages.logger = languages.logger or { }
function languages.logger.report()
- local result = {}
- for _, tag in ipairs(table.sortedkeys(languages.registered)) do
- local l = languages.registered[tag]
+ local result = { }
+ local sorted = table.sortedkeys(registered)
+ for i=1,#sorted do
+ local tag = sorted[i]
+ local l = registered[tag]
if l.loaded then
local p = (l.patterns and "pat") or '-'
local e = (l.exceptions and "exc") or '-'
@@ -273,179 +301,6 @@ function languages.logger.report()
return (#result > 0 and concat(result," ")) or "none"
end
-languages.words = languages.words or {}
-languages.words.data = languages.words.data or {}
-languages.words.enable = false
-languages.words.threshold = 4
-
-languages.words.colors = {
- ["known"] = "green",
- ["unknown"] = "red",
-}
-
-do
-
- local spacing = lpeg.S(" \n\r\t")
- local markup = lpeg.S("-=")
- local lbrace = lpeg.P("{")
- local rbrace = lpeg.P("}")
- local disc = (lbrace * (1-rbrace)^0 * rbrace)^1 -- or just 3 times, time this
- local word = lpeg.Cs((markup/"" + disc/"" + (1-spacing))^1)
-
- function languages.words.load(tag, filename)
- local filename = resolvers.find_file(filename,'other text file') or ""
- if filename ~= "" then
- statistics.starttiming(languages)
- local data = io.loaddata(filename) or ""
- local words = languages.words.data[tag] or {}
- parser = (spacing + word/function(s) words[s] = true end)^0
- parser:match(data)
- languages.words.data[tag] = words
- statistics.stoptiming(languages)
- end
- end
-
-end
-
-function languages.words.found(id, str)
- local tag = languages.numbers[id]
- if tag then
- local data = languages.words.data[tag]
- return data and (data[str] or data[lower(str)])
- else
- return false
- end
-end
-
--- The following code is an adaption of experimental code for
--- hyphenating and spell checking.
-
-do
-
- local glyph, disc, kern = node.id('glyph'), node.id('disc'), node.id('kern')
-
- local bynode = node.traverse
- local chardata = characters.data
-
- local function mark_words(head,found) -- can be optimized
- local current, start, str, language, n = head, nil, "", nil, 0
- local function action()
- if #str > 0 then
- local f = found(language,str)
- if f then
- for i=1,n do
- f(start)
- start = start.next
- end
- end
- end
- str, start, n = "", nil, 0
- end
- while current do
- local id = current.id
- if id == glyph then
- local a = current.lang
- if a then
- if a ~= language then
- if start then
- action()
- end
- language = a
- end
- elseif start then
- action()
- language = a
- end
- local components = current.components
- if components then
- start = start or current
- n = n + 1
- for g in bynode(components) do
- str = str .. utfchar(g.char)
- end
- else
- local code = current.char
- if chardata[code].uccode or chardata[code].lccode then
- start = start or current
- n = n + 1
- str = str .. utfchar(code)
- elseif start then
- action()
- end
- end
- elseif id == disc then
- if n > 0 then n = n + 1 end
- -- ok
- elseif id == kern and current.subtype == 0 and start then
- -- ok
- elseif start then
- action()
- end
- current = current.next
- end
- if start then
- action()
- end
- return head
- end
-
- languages.words.methods = { }
- languages.words.method = 1
-
- local lw = languages.words
-
- languages.words.methods[1] = function(head, attribute, yes, nop)
- local set = node.set_attribute
- local unset = node.unset_attribute
- local right, wrong = false, false
- if yes then right = function(n) set(n,attribute,yes) end end
- if nop then wrong = function(n) set(n,attribute,nop) end end
- for n in node.traverse(head) do
- unset(n,attribute) -- hm
- end
- local found, done = languages.words.found, false
- mark_words(head, function(language,str)
- if #str < lw.threshold then
- return false
- elseif found(language,str) then
- done = true
- return right
- else
- done = true
- return wrong
- end
- end)
- return head, done
- end
-
- local color = attributes.private('color')
-
- function languages.words.check(head)
- if lw.enable and head.next then
- local colors = lw.colors
- local alc = attributes.list[color]
- return lw.methods[lw.method](head, color, alc[colors.known], alc[colors.unknown])
- else
- return head, false
- end
- end
-
-end
-
--- for the moment we hook it into the attribute handler
-
---~ languagehacks = { }
-
---~ function languagehacks.process(namespace,attribute,head)
---~ return languages.check(head)
---~ end
-
---~ chars.plugins[chars.plugins+1] = {
---~ name = "language",
---~ namespace = languagehacks,
---~ processor = languagehacks.process
---~ }
-
-- must happen at the tex end
languages.associate('en','latn','eng')
@@ -462,7 +317,5 @@ statistics.register("loaded patterns", function()
end)
statistics.register("language load time", function()
- if statistics.elapsedindeed(languages) then
- return format("%s seconds, n=%s", statistics.elapsedtime(languages), languages.hyphenation.n())
- end
+ return statistics.elapsedseconds(languages, format(", n=%s",languages.hyphenation.n()))
end)
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.mkii b/Master/texmf-dist/tex/context/base/lang-ini.mkii
index a55748a78fb..91ac5984767 100644
--- a/Master/texmf-dist/tex/context/base/lang-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/lang-ini.mkii
@@ -397,33 +397,39 @@
% \def\synchronizepatterns{\setnormallanguage
% {\csname\??la\currentlanguage\s!patterns\endcsname}}% called often
% of even better pre-expand in an ugly way:
-% \@EA\def\@EA\synchronizepatterns\@EA{\@EA\dosetnormallanguage
-% \csname\??la\currentlanguage\s!patterns\endcsname}%
-\edef\synchronizepatterns{\noexpand\dosetnormallanguage{\languageparameter\s!patterns}}%
- \donefalse
- \synchronizepatterns
- \ifdone\else
- \def\synchronizepatterns{\dosetnormallanguage\currentlanguage}%
+ \ifnum\normallanguage<\zerocount
+ % we've blocked hyphenation (e.g. verbatim)
+ \else
+ \edef\synchronizepatterns{\noexpand\dosetnormallanguage{\languageparameter\s!patterns}}%
+ \donefalse
\synchronizepatterns
\ifdone\else
- \ifx\currentdefaultlanguage\empty\else
-% \@EA\def\@EA\synchronizepatterns\@EA{\@EA\dosetnormallanguage
-% \csname\??la\currentdefaultlanguage\s!patterns\endcsname}%
-\edef\synchronizepatterns{\noexpand\dosetnormallanguage{\specificlanguageparameter\currentdefaultlanguage\s!patterns}}%
- \synchronizepatterns
- \ifdone\else
- \dosetnormallanguage\currentdefaultlanguage
+ \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)
- {\dodosetnormallanguage{:\currentencoding:\currentmapping:}{#1}{%
- \dodosetnormallanguage{:\currentencoding:\s!default :}{#1}{%
- \dodosetnormallanguage{:\s!default :\currentmapping:}{#1}{%
- \dodosetnormallanguage{:\s!default :\s!default :}{#1}\empty}}}}
+ {\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
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.mkiv b/Master/texmf-dist/tex/context/base/lang-ini.mkiv
index f88281a609f..45bb71b85d9 100644
--- a/Master/texmf-dist/tex/context/base/lang-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/lang-ini.mkiv
@@ -73,7 +73,7 @@
\let\currentlanguage \empty
\let\currentmainlanguage\empty
-\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}}
+\unexpanded\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}}
\def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current)
{\edef\xaskedlanguage{#1}% otherwise clash with \askedlanguage
@@ -199,7 +199,7 @@
%D
%D Beware, this command can only be used when a language is installed.
-\unprotected \def\setuplanguage
+\unexpanded\def\setuplanguage
{\dodoubleempty\dosetuplanguage}
\def\dosetuplanguage[#1][#2]% handy patch for testing
@@ -241,8 +241,8 @@
\setuplanguage
[\s!default]
[\c!compoundhyphen=\compoundhyphen,
- \c!leftcompoundhyphen=\compoundhyphen,
- \c!rightcompoundhyphen=]
+ \c!rightcompoundhyphen=\compoundhyphen,
+ \c!leftcompoundhyphen=]
%D The values \type {leftsentence} and \type
%D {rightsentence} can be (and are) used to implement
@@ -303,7 +303,7 @@
\def\dosetnormallanguage#1#2% current default
{\edef\askedlanguagepatterns{\specificlanguageparameter{#1}\s!patterns}%
- \normallanguage=\ctxlua{tex.sprint(languages.enable({"\askedlanguagepatterns","#1","\askedlanguagepatterns","#2"}))}%
+ \normallanguage=\ctxlua{tex.sprint(languages.enable({"\askedlanguagepatterns","#1","#2"}))}%
\ifproductionrun
\setxvalue{\??la\??la#1#2}{\number\normallanguage}%
\fi}
@@ -317,11 +317,13 @@
\newtoks \everylanguage
-\def\sethyphenationvariables
- {\lefthyphenmin 0\languageparameter\s!lefthyphenmin \relax
- \righthyphenmin0\languageparameter\s!righthyphenmin\relax
- \lefthyphenmin \numexpr\lefthyphenmin +\hyphenminoffset\relax
- \righthyphenmin\numexpr\righthyphenmin+\hyphenminoffset\relax}
+\def\sethyphenationvariables % as we can have cloning we need to set it each time, unless we move all to lua
+ {\ctxlua{languages.setup(tex.language, {
+ lefthyphen = "\languageparameter\c!lefthyphen",
+ righthyphen = "\languageparameter\c!righthyphen",
+ } )}%
+ \lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax
+ \righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax}
\def\docomplexlanguage% assumes that \currentlanguage is set
{\edef\currentdefaultlanguage{\defaultlanguage\currentlanguage}%
@@ -332,6 +334,11 @@
% will be definable and move to core-spa !
\doifelse{\languageparameter\c!spacing}\v!broad\nonfrenchspacing\frenchspacing}
+% \mainlanguage[nl] \setuplanguage[nl][lefthyphen=,righthyphen=?]
+%
+% \dorecurse{100}{dit is toch wel een heel\normalhyphendiscretionary lang\normalhyphendiscretionary woord \recurselevel\ }
+% \dorecurse{100}{dit is toch wel een heellangwoord \recurselevel\ }
+
% The following may be a solution for the fact that one cannot
% change catcodes of characters like : and ; inside an environment.
@@ -546,33 +553,6 @@
\let\preloadallpatterns\relax % just for old times sake
\let\preloadlanguages \relax % just for old times sake
-%D This might bexcome a seperate file:
-
-% mkiv only -- todo: internationalize command names
-
-% \loadspellchecklist[en][words-en.txt]
-% \loadspellchecklist[us][words-en.txt]
-% \loadspellchecklist[nl][words-nl.txt]
-% \setupspellchecking[state=start]
-
-\def\loadspellchecklist
- {\dodoubleempty\doloadspellchecklist}
-
-\def\doloadspellchecklist[#1][#2]%
- {\ctxlua{languages.words.load("#1","#2")}}
-
-\def\setupspellchecking
- {\dosingleargument\dosetupspellchecking}
-
-\def\setupspellchecking[#1]% todo colors
- {\getparameters[\??wl][#1]%
- \doifelse\@@wlstate\v!start
- {\ctxlua{languages.words.enable=true }}
- {\ctxlua{languages.words.enable=false}}}
-
-\setupspellchecking
- [\c!state=\v!stop]
-
\uchyph=1
\exhyphenchar=45 % to permit breaking at explicit hyphens
diff --git a/Master/texmf-dist/tex/context/base/lang-ita.tex b/Master/texmf-dist/tex/context/base/lang-ita.tex
index c714be7758a..03efb0614fe 100644
--- a/Master/texmf-dist/tex/context/base/lang-ita.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ita.tex
@@ -186,8 +186,8 @@
\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!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]
@@ -202,7 +202,7 @@
\setupheadtext [\s!ro] [\v!index=Index]
\setupheadtext [\s!fr] [\v!abbreviations=Abr\'eviations]
-\setupheadtext [\s!es] [\v!abbreviations=Abreviaciones]
+\setupheadtext [\s!es] [\v!abbreviations=Abreviaturas]
\setupheadtext [\s!ca] [\v!abbreviations=Abreviacions]
\setupheadtext [\s!it] [\v!abbreviations=Abbreviazioni]
\setupheadtext [\s!la] [\v!abbreviations=Notae]
@@ -225,6 +225,14 @@
\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 ]
@@ -242,7 +250,7 @@
\setuplabeltext [\s!ro] [\v!figure=Figura ]
\setuplabeltext [\s!fr] [\v!intermezzo=Interm\`ede ]
-\setuplabeltext [\s!es] [\v!intermezzo=intermedio ]
+\setuplabeltext [\s!es] [\v!intermezzo=Intermedio ]
\setuplabeltext [\s!ca] [\v!intermezzo=Intermedi ]
\setuplabeltext [\s!it] [\v!intermezzo=Intermezzo ]
\setuplabeltext [\s!la] [\v!intermezzo=Intermissum ]
@@ -257,49 +265,49 @@
\setuplabeltext [\s!pt] [\v!graphic=Gr\'afico ]
\setuplabeltext [\s!ro] [\v!graphic=Graficul ]
-\setuplabeltext [\s!fr] [\v!chapter=]
-\setuplabeltext [\s!es] [\v!chapter=Cap\'\itulo]
-\setuplabeltext [\s!ca] [\v!chapter=Cap\'\itol]
+\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=]
-\setuplabeltext [\s!es] [\v!section=Secci\'on]
-\setuplabeltext [\s!ca] [\v!section=Secci\'o]
+\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=]
-\setuplabeltext [\s!es] [\v!subsection=Subsecci\'on]
-\setuplabeltext [\s!ca] [\v!subsection=Subsecci\'o]
+\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=]
-\setuplabeltext [\s!es] [\v!subsubsection=Subsubsecci\'on]
-\setuplabeltext [\s!ca] [\v!subsubsection=Subsubsecci\'o]
+\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=]
-\setuplabeltext [\s!es] [\v!subsubsubsection=Subsubsubsecci\'on]
-\setuplabeltext [\s!ca] [\v!subsubsubsection=Subsubsubsecci\'o]
+\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=]
-\setuplabeltext [\s!es] [\v!appendix=Ap\'endice]
-\setuplabeltext [\s!ca] [\v!appendix=Ap\`endix]
+\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=]
diff --git a/Master/texmf-dist/tex/context/base/lang-lab.mkiv b/Master/texmf-dist/tex/context/base/lang-lab.mkiv
index 61884ab50bd..42f2db8ff45 100644
--- a/Master/texmf-dist/tex/context/base/lang-lab.mkiv
+++ b/Master/texmf-dist/tex/context/base/lang-lab.mkiv
@@ -46,8 +46,9 @@
\let\currenttextprefixtag \s!unknown
\let\currenttextprefixclass\s!unknown
-\def\setupheadtext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix}
-\def\setuplabeltext{\setfalse\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix}
+\unexpanded\def\setupheadtext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix}
+\unexpanded\def\setuplabeltext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix}
+\unexpanded\def\setupmathlabeltext{\setfalse\protecttextprefixes\let\currenttextprefixclass\??mm\dodoubleempty\dosetupsometextprefix}
\def\dosetupsometextprefix[#1][#2]%
{\ifsecondargument
@@ -124,15 +125,17 @@
%D
%D The latter one has an upcased alternative \type{\LABELTEXT}.
-\def\labellanguage{\reallanguagetag{\defaultlanguage\currentmainlanguage}}
-\def\headlanguage {\reallanguagetag{\defaultlanguage\currentmainlanguage}}
+\def\labellanguage {\reallanguagetag{\defaultlanguage\currentmainlanguage}}
+\def\headlanguage {\reallanguagetag{\defaultlanguage\currentmainlanguage}}
+\def\mathlabellanguage{\reallanguagetag{\defaultlanguage\currentmainlanguage}}
\appendtoks \let\labellanguage\currentlanguage \to \everycurrentdate
\def\dummytextprefix{\empty\empty}
-\def\dogetupsomelabeltext{\dodogetupsomelabeltext\labellanguage} % second argument is textlabel
-\def\dogetupsomeheadtext {\dodogetupsomeheadtext \headlanguage } % second argument is headlabel
+\def\dogetupsomelabeltext {\dodogetupsomelabeltext \labellanguage } % second argument is textlabel
+\def\dogetupsomeheadtext {\dodogetupsomeheadtext \headlanguage } % second argument is headlabel
+\def\dogetupsomemathlabeltext{\dodogetupsomemathlabeltext\mathlabellanguage } % second argument is headlabel
\def\dodogetupsomelabeltext#1#2%
{\ifcsname\??ml#1#2\endcsname
@@ -160,28 +163,45 @@
\let\thetextprefix\dummytextprefix
\fi\fi\fi\fi}
+\def\dodogetupsomemathlabeltext#1#2%
+ {\ifcsname\??mm#1#2\endcsname
+ \expandafter\let\expandafter\thetextprefix\csname\??mm#1#2\endcsname
+ \else\ifcsname\??la\mathlabellanguage\s!default\endcsname
+ \expandafter\dodogetupsomemathlabeltext\csname\??la\mathlabellanguage\s!default\endcsname{#2}%
+ \else\ifcsname\??mm#2\endcsname
+ \expandafter\let\expandafter\thetextprefix\csname\??mm#2\endcsname
+ \else\ifcsname\??mm\s!en#2\endcsname
+ \expandafter\let\expandafter\thetextprefix\csname\??mm\s!en#2\endcsname
+ \else
+ \let\thetextprefix\dummytextprefix
+ \fi\fi\fi\fi}
+
% The WORD variants are a bit inefficient when #1/#2 are empty but they are
% seldom used (one can better set the style).
-\let\flushleftlabeltext \firstoftwoarguments
-\let\flushrightlabeltext\secondoftwoarguments
-
-\def\flushleftlabelWORD #1#2{\WORD{#1}}
-\def\flushrightlabelWORD#1#2{\WORD{#2}}
-
-\def\flushbothlabeltexts#1#2#3{#1#3#2}
-\def\flushbothlabelTEXTS#1#2#3{\WORD{#1}#3\WORD{#2}}
-
-\unexpanded\def\headtext #1{\dogetupsomeheadtext {#1}\expandafter\flushleftlabeltext \thetextprefix}
-\unexpanded\def\leftlabeltext #1{\dogetupsomelabeltext{#1}\expandafter\flushleftlabeltext \thetextprefix}
-\unexpanded\def\rightlabeltext#1{\dogetupsomelabeltext{#1}\expandafter\flushrightlabeltext\thetextprefix}
-\unexpanded\def\LEFTLABELTEXT #1{\dogetupsomelabeltext{#1}\expandafter\flushleftlabelWORD \thetextprefix}
-\unexpanded\def\RIGHTLABELTEXT#1{\dogetupsomelabeltext{#1}\expandafter\flushrightlabelWORD\thetextprefix}
-\unexpanded\def\labeltexts #1{\dogetupsomelabeltext{#1}\expandafter\flushbothlabeltexts\thetextprefix} % #2
-\unexpanded\def\LABELTEXTS #1{\dogetupsomelabeltext{#1}\expandafter\flushbothlabelTEXTS\thetextprefix} % #2
-
-\let\labeltext\leftlabeltext
-\let\LABELTEXT\LEFTLABELTEXT
+\let\flushleftlabeltext \firstoftwoarguments
+\let\flushrightlabeltext \secondoftwoarguments
+\let\flushleftmathlabeltext \firstoftwoarguments
+\let\flushrightmathlabeltext\secondoftwoarguments
+
+\def\flushleftlabelWORD #1#2{\WORD{#1}}
+\def\flushrightlabelWORD #1#2{\WORD{#2}}
+\def\flushbothlabeltexts #1#2#3{#1#3#2}
+\def\flushbothlabelTEXTS #1#2#3{\WORD{#1}#3\WORD{#2}}
+
+\unexpanded\def\headtext #1{\dogetupsomeheadtext {#1}\expandafter\flushleftlabeltext \thetextprefix}
+\unexpanded\def\leftlabeltext #1{\dogetupsomelabeltext {#1}\expandafter\flushleftlabeltext \thetextprefix}
+\unexpanded\def\rightlabeltext #1{\dogetupsomelabeltext {#1}\expandafter\flushrightmathlabeltext\thetextprefix}
+\unexpanded\def\LEFTLABELTEXT #1{\dogetupsomelabeltext {#1}\expandafter\flushleftlabelWORD \thetextprefix}
+\unexpanded\def\RIGHTLABELTEXT #1{\dogetupsomelabeltext {#1}\expandafter\flushrightlabelWORD \thetextprefix}
+\unexpanded\def\labeltexts #1{\dogetupsomelabeltext {#1}\expandafter\flushbothlabeltexts \thetextprefix} % #2
+\unexpanded\def\LABELTEXTS #1{\dogetupsomelabeltext {#1}\expandafter\flushbothlabelTEXTS \thetextprefix} % #2
+\unexpanded\def\leftmathlabeltext #1{\dogetupsomemathlabeltext{#1}\expandafter\flushleftmathlabeltext \thetextprefix}
+\unexpanded\def\rightmathlabeltext#1{\dogetupsomemathlabeltext{#1}\expandafter\flushrightlabeltext \thetextprefix}
+
+\let\labeltext \leftlabeltext
+\let\LABELTEXT \LEFTLABELTEXT
+\let\mathlabeltext\leftmathlabeltext
\ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi
@@ -194,6 +214,7 @@
\let \LABELTEXT \firstofoneargument
\let \LEFTLABELTEXT \firstofoneargument
\let \RIGHTLABELTEXT \firstofoneargument
+ \let \mathlabeltext \firstofoneargument
\to \simplifiedcommands
%D \macros
@@ -203,8 +224,9 @@
%D head and label texts without replacing predefined ones.
%D These are internal macros.
-\def\presetheadtext {\settrue\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix}
-\def\presetlabeltext{\settrue\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix}
+\def\presetheadtext {\settrue\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix}
+\def\presetlabeltext {\settrue\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix}
+\def\presetmathlabeltext{\settrue\protecttextprefixes\let\currenttextprefixclass\??mm\dodoubleempty\dosetupsometextprefix}
%D \macros
%D {translate}
diff --git a/Master/texmf-dist/tex/context/base/lang-mis.mkiv b/Master/texmf-dist/tex/context/base/lang-mis.mkiv
index eb7bb1a04dc..0df45877b0d 100644
--- a/Master/texmf-dist/tex/context/base/lang-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/lang-mis.mkiv
@@ -363,7 +363,7 @@
\unexpanded\def\doindirectdiscretionary#1%
{\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\allowbreak\postwordbreak}
-\def\definetextmodediscretionary #1
+\unexpanded\def\definetextmodediscretionary #1
{\setvalue{\@tmd@action@\detokenize{#1}}}
% \start \hsize 1mm
@@ -377,6 +377,12 @@
% test|^|test
% \stop
+% x\discretionary{1}{2}{3}xxxxxxx
+% xxxxxxx\discretionary{1}{2}{3}x
+%
+% xxx3xxx
+% xxx1<newline>2xxx
+
\def\hyphenliketextmodediscretionary#1#2%
{\ifconditional\spaceafterdiscretionary
\prewordbreak\hbox{#1}\relax
diff --git a/Master/texmf-dist/tex/context/base/lang-sla.tex b/Master/texmf-dist/tex/context/base/lang-sla.tex
index cd3c75b61c5..2c645af5a6f 100644
--- a/Master/texmf-dist/tex/context/base/lang-sla.tex
+++ b/Master/texmf-dist/tex/context/base/lang-sla.tex
@@ -82,7 +82,7 @@
\installlanguage
[\s!cs]
- [\c!spacing=\v!packed,
+ [\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,
@@ -193,19 +193,19 @@
\setupheadtext [\s!sl] [\v!content=Kazalo]
\setupheadtext [\s!pl] [\v!tables=Tabele]
-\setupheadtext [\s!cs] [\v!tables=Tabulek]
+\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 zk\uring]
+\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=Graf]
+\setupheadtext [\s!cs] [\v!graphics=Grafy]
\setupheadtext [\s!sk] [\v!graphics=Graf]
\setupheadtext [\s!hr] [\v!graphics=Slike]
\setupheadtext [\s!sl] [\v!graphics=Slike]
@@ -240,6 +240,12 @@
\setupheadtext [\s!hr] [\v!units=Jednostki]
\setupheadtext [\s!sl] [\v!units=Enote]
+%setupheadtext [\s!pl] [pubs=?]
+\setupheadtext [\s!cs] [pubs=Literatura]
+%setupheadtext [\s!sk] [pubs=?]
+%setupheadtext [\s!hr] [pubs=?]
+\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 ]
diff --git a/Master/texmf-dist/tex/context/base/lang-url.lua b/Master/texmf-dist/tex/context/base/lang-url.lua
index 3d93a046a21..b0a71ec679e 100644
--- a/Master/texmf-dist/tex/context/base/lang-url.lua
+++ b/Master/texmf-dist/tex/context/base/lang-url.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lang-url'] = {
version = 1.001,
- comment = "companion to lang-url.tex",
+ 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"
@@ -11,7 +11,7 @@ local utf = unicode.utf8
local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
local utfbyte, utfgsub = utf.byte, utf.gsub
-local ctxcatcodes = tex.ctxcatcodes
+local ctxcatcodes, texsprint = tex.ctxcatcodes, tex.sprint
commands = commands or { }
@@ -22,80 +22,80 @@ parsing, but the following solution suits as well. After all, we're mostly
dealing with <l n='ascii'/> characters.</p>
]]--
-do
-
- commands.hyphenatedurl = commands.hyphenatedurl or { }
-
- commands.hyphenatedurl.characters = {
- ["!"] = 1,
- ["\""] = 1,
- ["#"] = 1,
- ["$"] = 1,
- ["%"] = 1,
- ["&"] = 1,
- ["("] = 1,
- ["*"] = 1,
- ["+"] = 1,
- [","] = 1,
- ["-"] = 1,
- ["."] = 1,
- ["/"] = 1,
- [":"] = 1,
- [";"] = 1,
- ["<"] = 1,
- ["="] = 1,
- [">"] = 1,
- ["?"] = 1,
- ["@"] = 1,
- ["["] = 1,
- ["\\"] = 1,
- ["^"] = 1,
- ["_"] = 1,
- ["`"] = 1,
- ["{"] = 1,
- ["|"] = 1,
- ["~"] = 1,
-
- ["'"] = 2,
- [")"] = 2,
- ["]"] = 2,
- ["}"] = 2
- }
-
- commands.hyphenatedurl.lefthyphenmin = 2
- commands.hyphenatedurl.righthyphenmin = 3
-
- local chars = commands.hyphenatedurl.characters
+commands.hyphenatedurl = commands.hyphenatedurl or { }
+
+local hyphenatedurl = commands.hyphenatedurl
+
+hyphenatedurl.characters = {
+ ["!"] = 1,
+ ["\""] = 1,
+ ["#"] = 1,
+ ["$"] = 1,
+ ["%"] = 1,
+ ["&"] = 1,
+ ["("] = 1,
+ ["*"] = 1,
+ ["+"] = 1,
+ [","] = 1,
+ ["-"] = 1,
+ ["."] = 1,
+ ["/"] = 1,
+ [":"] = 1,
+ [";"] = 1,
+ ["<"] = 1,
+ ["="] = 1,
+ [">"] = 1,
+ ["?"] = 1,
+ ["@"] = 1,
+ ["["] = 1,
+ ["\\"] = 1,
+ ["^"] = 1,
+ ["_"] = 1,
+ ["`"] = 1,
+ ["{"] = 1,
+ ["|"] = 1,
+ ["~"] = 1,
+
+ ["'"] = 2,
+ [")"] = 2,
+ ["]"] = 2,
+ ["}"] = 2
+}
- function commands.hyphenatedurl.convert(str, left, right)
- local n = 0
- local b = math.max(left or commands.hyphenatedurl.lefthyphenmin,2)
- local e = math.min(#str-(right or commands.hyphenatedurl.righthyphenmin)+2,#str)
- str = utfgsub(str,"(.)",function(s)
- n = n + 1
+hyphenatedurl.lefthyphenmin = 2
+hyphenatedurl.righthyphenmin = 3
+hyphenatedurl.discretionary = nil
+
+local chars = hyphenatedurl.characters
+
+function hyphenatedurl.action(str, left, right, disc)
+ local n = 0
+ local b = math.max( left or hyphenatedurl.lefthyphenmin, 2)
+ local e = math.min(#str-(right or hyphenatedurl.righthyphenmin)+2,#str)
+ local d = disc or hyphenatedurl.discretionary
+ for s in utfcharacters(str) do
+ n = n + 1
+ if s == d then
+ texsprint(ctxcatcodes,"\\d{",utfbyte(s),"}")
+ else
local c = chars[s]
if not c or n<=b or n>=e then
- return "\\n{" .. utfbyte(s) .. "}"
+ texsprint(ctxcatcodes,"\\n{",utfbyte(s),"}")
elseif c == 1 then
- return "\\b{" .. utfbyte(s) .. "}"
+ texsprint(ctxcatcodes,"\\b{",utfbyte(s),"}")
elseif c == 2 then
- return "\\a{" .. utfbyte(s) .. "}"
+ texsprint(ctxcatcodes,"\\a{",utfbyte(s),"}")
end
- end )
- return str
- end
- function commands.hyphenatedurl.action(str, left, right)
- tex.sprint(ctxcatcodes,commands.hyphenatedurl.convert(str, left, right))
- end
-
- -- todo, no interface in mkiv yet
-
- function commands.hyphenatedurl.setcharacters(str,value) -- 1, 2 == before, after
- for s in utfcharacters(str) do
- chars[s] = value or 1
end
end
+end
- -- commands.hyphenatedurl.setcharacters("')]}",2)
+-- todo, no interface in mkiv yet
+function hyphenatedurl.setcharacters(str,value) -- 1, 2 == before, after
+ for s in utfcharacters(str) do
+ chars[s] = value or 1
+ end
end
+
+-- .hyphenatedurl.setcharacters("')]}",2)
diff --git a/Master/texmf-dist/tex/context/base/lang-url.mkiv b/Master/texmf-dist/tex/context/base/lang-url.mkiv
index 392a0285b10..0f6b23d0552 100644
--- a/Master/texmf-dist/tex/context/base/lang-url.mkiv
+++ b/Master/texmf-dist/tex/context/base/lang-url.mkiv
@@ -62,10 +62,13 @@
\def\dohyphenatedurlafter #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}}%
\def\dohyphenatedurlbefore#1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax}%
\def\dohyphenatedurlnormal#1{\char#1\relax}%
+\def\dohyphenatedurldisc #1{\discretionary{}{}{}}
-\def\sethyphenatedurlnormal#1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}}
-\def\sethyphenatedurlbefore#1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}}
-\def\sethyphenatedurlafter #1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}}
+\def\sethyphenatedurlnormal #1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}}
+\def\sethyphenatedurlbefore #1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}}
+\def\sethyphenatedurlafter #1{\ctxlua{commands.hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}}
+
+\def\hyphenatedurldiscretionary{}
% \sethyphenatedurlafter{ABCDEF}
@@ -79,10 +82,12 @@
\let\n\dohyphenatedurlnormal
\let\b\dohyphenatedurlbefore
\let\a\dohyphenatedurlafter
+ \let\d\dohyphenatedurldisc
\normalexpanded{\noexpand\ctxlua{commands.hyphenatedurl.action(
\!!bs\noexpand\detokenize{#1}\!!es,
\number\hyphenatedurllefthyphenmin,
- \number\hyphenatedurlrighthyphenmin
+ \number\hyphenatedurlrighthyphenmin,
+ "\hyphenatedurldiscretionary"
)}}%
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/lang-wrd.lua b/Master/texmf-dist/tex/context/base/lang-wrd.lua
new file mode 100644
index 00000000000..095e44443d9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-wrd.lua
@@ -0,0 +1,225 @@
+if not modules then modules = { } end modules ['lang-ini'] = {
+ version = 1.001,
+ comment = "companion to lang-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local utf = unicode.utf8
+local lower, utfchar = string.lower, utf.char
+local lpegmatch = lpeg.match
+
+languages.words = languages.words or { }
+
+local words = languages.words
+
+words.data = words.data or { }
+words.enables = false
+words.threshold = 4
+
+local set_attribute = node.set_attribute
+local unset_attribute = node.unset_attribute
+local traverse_nodes = node.traverse
+local node_id = node.id
+local wordsdata = words.data
+local chardata = characters.data
+
+local glyph_node = node_id('glyph')
+local disc_node = node_id('disc')
+local kern_node = node_id('kern')
+
+words.colors = {
+ ["known"] = "green",
+ ["unknown"] = "red",
+}
+
+local spacing = lpeg.S(" \n\r\t")
+local markup = lpeg.S("-=")
+local lbrace = lpeg.P("{")
+local rbrace = lpeg.P("}")
+local disc = (lbrace * (1-rbrace)^0 * rbrace)^1 -- or just 3 times, time this
+local word = lpeg.Cs((markup/"" + disc/"" + (1-spacing))^1)
+
+local loaded = { } -- we share lists
+
+function words.load(tag,filename)
+ local fullname = resolvers.find_file(filename,'other text file') or ""
+ if fullname ~= "" then
+ statistics.starttiming(languages)
+ local list = loaded[fullname]
+ if not list then
+ list = wordsdata[tag] or { }
+ local parser = (spacing + word/function(s) list[s] = true end)^0
+ lpegmatch(parser,io.loaddata(fullname) or "")
+ loaded[fullname] = list
+ end
+ wordsdata[tag] = list
+ statistics.stoptiming(languages)
+ else
+ logs.report("languages","missing words file '%s'",filename)
+ end
+end
+
+function words.found(id, str)
+ local tag = languages.numbers[id]
+ if tag then
+ local data = wordsdata[tag]
+ return data and (data[str] or data[lower(str)])
+ else
+ return false
+ end
+end
+
+-- The following code is an adaption of experimental code for
+-- hyphenating and spell checking.
+
+local function mark_words(head,whenfound) -- can be optimized
+ local current, start, str, language, n = head, nil, "", nil, 0
+ local function action()
+ if #str > 0 then
+ local f = whenfound(language,str)
+ if f then
+ for i=1,n do
+ f(start)
+ start = start.next
+ end
+ end
+ end
+ str, start, n = "", nil, 0
+ end
+ while current do
+ local id = current.id
+ if id == glyph_node then
+ local a = current.lang
+ if a then
+ if a ~= language then
+ if start then
+ action()
+ end
+ language = a
+ end
+ elseif start then
+ action()
+ language = a
+ end
+ local components = current.components
+ if components then
+ start = start or current
+ n = n + 1
+ for g in traverse_nodes(components) do
+ str = str .. utfchar(g.char)
+ end
+ else
+ local code = current.char
+ if chardata[code].uccode or chardata[code].lccode then
+ start = start or current
+ n = n + 1
+ str = str .. utfchar(code)
+ elseif start then
+ action()
+ end
+ end
+ elseif id == disc_node then
+ if n > 0 then
+ n = n + 1
+ end
+ elseif id == kern_node and current.subtype == 0 and start then
+ -- ok
+ elseif start then
+ action()
+ end
+ current = current.next
+ end
+ if start then
+ action()
+ end
+ return head
+end
+
+words.methods = { }
+words.method = 1
+
+local methods = words.methods
+
+methods[1] = function(head, attribute, yes, nop)
+ local right, wrong = false, false
+ if yes then right = function(n) set_attribute(n,attribute,yes) end end
+ if nop then wrong = function(n) set_attribute(n,attribute,nop) end end
+ for n in traverse_nodes(head) do
+ unset_attribute(n,attribute) -- hm, not that selective (reset color)
+ end
+ local found, done = words.found, false
+ mark_words(head, function(language,str)
+ if #str < words.threshold then
+ return false
+ elseif found(language,str) then
+ done = true
+ return right
+ else
+ done = true
+ return wrong
+ end
+ end)
+ return head, done
+end
+
+local list, dump = { }, false -- todo: per language
+
+local lower = characters.lower
+
+methods[2] = function(head, attribute)
+ dump = true
+ mark_words(head, function(language,str)
+ if #str >= words.threshold then
+ str = lower(str)
+ list[str] = (list[str] or 0) + 1
+ end
+ end)
+ return head, true
+end
+
+words.used = list
+
+function words.dump_used_words(name)
+ if dump then
+ logs.report("languages","saving list of used words in '%s'",name)
+ io.savedata(name,table.serialize(list))
+ end
+end
+
+local color = attributes.private('color')
+
+function words.check(head)
+ if words.enabled and head.next then
+ local colors = words.colors
+ local alc = attributes.list[color]
+ return methods[words.method](head, color, alc[colors.known], alc[colors.unknown])
+ else
+ return head, false
+ end
+end
+
+function words.enable(method)
+ tasks.enableaction("processors","languages.words.check")
+ words.method = method or words.method or 1
+ words.enabled = true
+end
+
+function words.disable()
+ words.enabled = false
+end
+
+-- for the moment we hook it into the attribute handler
+
+--~ languagehacks = { }
+
+--~ function languagehacks.process(namespace,attribute,head)
+--~ return languages.check(head)
+--~ end
+
+--~ chars.plugins[chars.plugins+1] = {
+--~ name = "language",
+--~ namespace = languagehacks,
+--~ processor = languagehacks.process
+--~ }
diff --git a/Master/texmf-dist/tex/context/base/lang-wrd.mkiv b/Master/texmf-dist/tex/context/base/lang-wrd.mkiv
new file mode 100644
index 00000000000..b6fc6a9d30f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-wrd.mkiv
@@ -0,0 +1,54 @@
+%D \module
+%D [ file=lang-wrd,
+%D version=2006.XX.XX,
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Checking,
+%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 Experimental.
+
+\writestatus{loading}{ConTeXt Language Macros / Checking}
+
+\registerctxluafile{lang-wrd}{1.001}
+
+\unprotect
+
+% \loadspellchecklist[en][words-en.txt]
+% \loadspellchecklist[us][words-en.txt]
+% \loadspellchecklist[nl][words-nl.txt]
+% \setupspellchecking[state=start,method=1]
+%
+% \setupspellchecking[state=start,method=2]
+% ...
+% \typefile{\jobname.words}
+
+\def\loadspellchecklist
+ {\dodoubleempty\doloadspellchecklist}
+
+\def\doloadspellchecklist[#1][#2]%
+ {\ctxlua{languages.words.load("#1","#2")}}
+
+\unexpanded\def\setupspellchecking
+ {\dosingleargument\dosetupspellchecking}
+
+\unexpanded\def\setupspellchecking[#1]% todo colors
+ {\getparameters[\??wl][#1]%
+ \doifelse\@@wlstate\v!start
+ {\ctxlua{languages.words.enable(\@@wlmethod)}}
+ {\ctxlua{languages.words.disable()}}}
+
+\setupspellchecking
+ [\c!state=\v!stop,
+ \c!method=1]
+
+\appendtoks
+ \ctxlua{languages.words.dump_used_words("\jobname.words")}%
+\to \everybye
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ano.lua b/Master/texmf-dist/tex/context/base/lpdf-ano.lua
index 87014365b39..e9e67e16319 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ano.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-ano.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-ano'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -31,18 +31,17 @@ local specials = jobreferences.specials
local handlers = jobreferences.handlers
local executers = jobreferences.executers
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfreference = lpdf.reference
-local pdfunicode = lpdf.unicode
-local pdfconstant = lpdf.constant
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfunicode = lpdf.unicode
+local pdfconstant = lpdf.constant
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfannotation = nodes.pdfannotation
+local pdfdestination = nodes.pdfdestination
-local pdfreserveobj = pdf.reserveobj
-local pdfimmediateobj = pdf.immediateobj
-local pdfpageref = tex.pdfpageref
-
-local pdfannot = nodes.pdfannot
-local pdfdest = nodes.pdfdest
+local pdfpagereference = tex.pdfpageref
local pdf_uri = pdfconstant("URI")
local pdf_gotor = pdfconstant("GoToR")
@@ -60,10 +59,10 @@ local function pagedest(n)
local pd = cache[n]
if not pd then
local a = pdfarray {
- pdfreference(pdfpageref(n)),
+ pdfreference(pdfpagereference(n)),
pdfconstant("Fit")
}
- pd = pdfreference(pdfimmediateobj(tostring(a)))
+ pd = pdfreference(pdfflushobject(a))
cache[n] = pd
end
return pd
@@ -71,6 +70,8 @@ end
lpdf.pagedest = pagedest
+local defaultdestination = pdfarray { 0, pdfconstant("Fit") }
+
local function link(url,filename,destination,page,actions)
if filename and filename ~= "" then
if file.basename(filename) == tex.jobname then
@@ -93,9 +94,9 @@ local function link(url,filename,destination,page,actions)
}
elseif filename and filename ~= "" then
return pdfdictionary {
- S = pdf_gotor,
+ S = pdf_gotor, -- can also be pdf_launch
F = filename,
- D = destination and destination ~= "" and destination,
+ D = (destination and destination ~= "" and destination), -- or defaultdestination,
NewWindow = (actions.newwindow and true) or nil,
}
elseif destination and destination ~= "" then
@@ -221,7 +222,7 @@ end
-- }
-- local cm = cache[main]
-- if not cm then
--- cm = "/A ".. tostring(pdfreference(pdfimmediateobj(tostring(main))))
+-- cm = "/A ".. tostring(pdfreference(pdfflushobject(main))
-- cache[main] = cm
-- end
-- return cm
@@ -236,7 +237,7 @@ function nodeinjections.reference(width,height,depth,prerolled)
if trace_references then
logs.report("references","w=%s, h=%s, d=%s, a=%s",width,height,depth,prerolled)
end
- return pdfannot(width,height,depth,prerolled)
+ return pdfannotation(width,height,depth,prerolled)
end
end
@@ -247,7 +248,7 @@ function nodeinjections.destination(width,height,depth,name,view)
if trace_destinations then
logs.report("destinations","w=%s, h=%s, d=%s, n=%s, v=%s",width,height,depth,name,view or "no view")
end
- return pdfdest(width,height,depth,name,view)
+ return pdfdestination(width,height,depth,name,view)
end
-- runners and specials
@@ -266,23 +267,27 @@ runners["inner"] = function(var,actions)
end
runners["inner with arguments"] = function(var,actions)
+ logs.report("references","todo: inner with arguments")
return false
end
runners["outer"] = function(var,actions)
- return link(nil,var.o,nil,nil,actions) -- var.o ?
+ local file, url = jobreferences.checkedfileorurl(var.outer,var.outer)
+ return link(url,file,var.arguments,nil,actions)
end
runners["outer with inner"] = function(var,actions)
- -- todo: resolve url/file name
- return link(nil,var.f,var.inner,var.r,actions)
+ local file = jobreferences.checkedfile(var.f)
+ return link(nil,file,var.inner,var.r,actions)
end
runners["special outer with operation"] = function(var,actions)
- return false
+ local handler = specials[var.special]
+ return handler and handler(var,actions)
end
runners["special outer"] = function(var,actions)
+ logs.report("references","todo: special outer")
return false
end
@@ -292,25 +297,29 @@ runners["special"] = function(var,actions)
end
runners["outer with inner with arguments"] = function(var,actions)
+ logs.report("references","todo: outer with inner with arguments")
return false
end
runners["outer with special and operation and arguments"] = function(var,actions)
+ logs.report("references","todo: outer with special and operation and arguments")
return false
end
runners["outer with special"] = function(var,actions)
+ logs.report("references","todo: outer with special")
return false
end
runners["outer with special and operation"] = function(var,actions)
+ logs.report("references","todo: outer with special and operation")
return false
end
runners["special operation"] = runners["special"]
runners["special operation with arguments"] = runners["special"]
-function specials.internal(var,actions)
+function specials.internal(var,actions) -- better resolve in strc-ref
local i = tonumber(var.operation)
local v = jobreferences.internals[i]
if not v then
@@ -326,49 +335,56 @@ end
specials.i = specials.internal
-function specials.page(var,actions)
- local p = jobreferences.pages[var.operation]
- if type(p) == "function" then
- p = p()
+function specials.page(var,actions) -- better resolve in strc-ref
+ local file = var.f
+ if file then
+ file = jobreferences.checkedfile(file)
+ return link(nil,file,nil,p or var.operation,actions)
+ else
+ local p = jobreferences.pages[var.operation]
+ if type(p) == "function" then
+ p = p()
+ end
+ return link(nil,nil,nil,p or var.operation,actions)
end
- return link(nil,nil,nil,p or var.operation,actions)
end
-function specials.url(var,actions)
- local url = var.operation
- if url then
- local u = jobreferences.urls[url]
- if u then
- local u, f = u[1], u[2]
- if f and f ~= "" then
- url = u .. "/" .. f
- else
- url = u
- end
+-- todo, do this in references namespace ordered instead (this is an experiment)
+
+local splitter = lpeg.splitat(":")
+
+function specials.order(var,actions) -- jobreferences.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
+ var.operation = r -- brrr, but test anyway
+ return specials.page(var,actions)
end
end
+end
+
+function specials.url(var,actions)
+ local url = jobreferences.checkedurl(var.operation)
return link(url,nil,var.arguments,nil,actions)
end
function specials.file(var,actions)
- local file = var.operation
- if file then
- local f = jobreferences.files[file]
- if f then
- file = f[1] or file
- end
- end
+ local file = jobreferences.checkedfile(var.operation)
return link(nil,file,var.arguments,nil,actions)
end
+function specials.fileorurl(var,actions)
+ local file, url = jobreferences.checkedfileorurl(var.operation,var.operation)
+ return link(url,file,var.arguments,nil,actions)
+end
+
function specials.program(var,content)
- local program = var.operation
- if program then
- local p = jobreferences.programs[program]
- if p then
- program = p[1]
- end
- end
+ local program = jobreferences.checkedprogram(var.operation)
return lpdf.launch(program,var.arguments)
end
@@ -512,13 +528,13 @@ local function build(levels,start,parent,method)
local level, title, reference, open = li[1], li[2], li[3], li[4]
if level == startlevel then
if trace_bookmarks then
- logs.report("bookmark","%3i %s%s %s",realpage,rep(" ",level-1),(open and "+") or "-",title)
+ logs.report("bookmark","%3i %s%s %s",reference.realpage,rep(" ",level-1),(open and "+") or "-",title)
end
local prev = child
- child = pdfreserveobj()
+ child = pdfreserveobject()
if entry then
entry.Next = child and pdfreference(child)
- pdfimmediateobj(prev,tostring(entry))
+ pdfflushobject(prev,entry)
end
entry = pdfdictionary {
Title = pdfunicode(title),
@@ -536,7 +552,7 @@ local function build(levels,start,parent,method)
n = n + 1
i = i + 1
elseif level < startlevel then
- pdfimmediateobj(child,tostring(entry))
+ pdfflushobject(child,entry)
return i, n, first, last
elseif i < #levels and level > startlevel then
i, m, f, l = build(levels,i,pdfreference(child),method)
@@ -551,16 +567,16 @@ local function build(levels,start,parent,method)
if m > 0 then
entry.First, entry.Last = pdfreference(f), pdfreference(l)
end
- pdfimmediateobj(child,tostring(entry))
+ pdfflushobject(child,entry)
return i, n, first, last
end
end
- pdfimmediateobj(child,tostring(entry))
+ pdfflushobject(child,entry)
return nil, n, first, last
end
function codeinjections.addbookmarks(levels,method)
- local parent = pdfreserveobj()
+ local parent = pdfreserveobject()
local _, m, first, last = build(levels,1,pdfreference(parent),method or "internal")
local dict = pdfdictionary {
Type = pdfconstant("Outlines"),
@@ -568,6 +584,6 @@ function codeinjections.addbookmarks(levels,method)
Last = pdfreference(last),
Count = m,
}
- pdfimmediateobj(parent,tostring(dict))
+ pdfflushobject(parent,dict)
lpdf.addtocatalog("Outlines",lpdf.reference(parent))
end
diff --git a/Master/texmf-dist/tex/context/base/lpdf-col.lua b/Master/texmf-dist/tex/context/base/lpdf-col.lua
index 0e4f6e49588..18aa848ffea 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-col.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-col.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-mis'] = {
version = 1.001,
- comment = "companion to back-pdf.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/lpdf-fld.lua b/Master/texmf-dist/tex/context/base/lpdf-fld.lua
index 6bdfdd36c38..c034aec6c91 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-fld.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-fld.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-fld'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -11,6 +11,9 @@ if not modules then modules = { } end modules ['lpdf-fld'] = {
-- some optimizations removed (will come bakc if needed)
local gmatch, lower, format = string.gmatch, string.lower, string.format
+local lpegmatch = lpeg.match
+
+local trace_fields = false trackers.register("widgets.fields", function(v) trace_fields = v end)
local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
@@ -22,17 +25,17 @@ local registrations = backends.pdf.registrations
local registeredsymbol = codeinjections.registeredsymbol
-local pdfstream = lpdf.stream
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfreference = lpdf.reference
-local pdfunicode = lpdf.unicode
-local pdfstring = lpdf.string
-local pdfconstant = lpdf.constant
-local pdftoeight = lpdf.toeight
-
-local pdfimmediateobj = pdf.immediateobj
-local pdfreserveobj = pdf.reserveobj
+local pdfstream = lpdf.stream
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfunicode = lpdf.unicode
+local pdfstring = lpdf.string
+local pdfconstant = lpdf.constant
+local pdftoeight = lpdf.toeight
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfannotation = nodes.pdfannotation
local submitoutputformat = 0 -- 0=unknown 1=HTML 2=FDF 3=XML => not yet used, needs to be checked
@@ -141,30 +144,53 @@ end
-- fonts and color
local fontnames = {
- rmtf = "Times-Roman", rmbf = "Times-Bold",
- rmit = "Times-Italic", rmsl = "Times-Italic",
- rmbi = "Times-BoldItalic", rmbs = "Times-BoldItalic",
- sstf = "Helvetica", ssbf = "Helvetica-Bold",
- ssit = "Helvetica-Oblique", sssl = "Helvetica-Oblique",
- ssbi = "Helvetica-BoldOblique", ssbs = "Helvetica-BoldOblique",
- tttf = "Courier", ttbf = "Courier-Bold",
- ttit = "Courier-Oblique", ttsl = "Courier-Oblique",
- ttbi = "Courier-BoldOblique", ttbs = "Courier-BoldOblique",
+ rm = {
+ tf = "Times-Roman",
+ bf = "Times-Bold",
+ it = "Times-Italic",
+ sl = "Times-Italic",
+ bi = "Times-BoldItalic",
+ bs = "Times-BoldItalic",
+ },
+ ss = {
+ tf = "Helvetica",
+ bf = "Helvetica-Bold",
+ it = "Helvetica-Oblique",
+ sl = "Helvetica-Oblique",
+ bi = "Helvetica-BoldOblique",
+ bs = "Helvetica-BoldOblique",
+ },
+ tt = {
+ tf = "Courier",
+ bf = "Courier-Bold",
+ it = "Courier-Oblique",
+ sl = "Courier-Oblique",
+ bi = "Courier-BoldOblique",
+ bs = "Courier-BoldOblique",
+ }
}
local usedfonts = { }
local function fieldsurrounding(specification)
- local tag = (specification.fontstyle or "tt") .. (specification.fontalternative or "tf")
- if not fontnames[tag] then
- tag = "tttf"
- end
- local size = specification.fontsize
+ local size = specification.fontsize or "12pt"
+ local style = specification.fontstyle or "rm"
+ local alternative = specification.fontalternative or "tf"
+ local s = fontnames[style]
+ if not s then
+ style, s = "rm", fontnames.rm
+ end
+ local a = s[alternative]
+ if not a then
+ alternative, a = "tf", s.tf
+ end
+ local tag = style .. alternative
+ size = string.todimen(size)
local stream = pdfstream {
pdfconstant(tag),
- format("%s Tf",(size and (number.dimenfactors.bp * size)) or 12),
+ format("%0.4f Tf",(size and (number.dimenfactors.bp * size)) or 12),
}
- usedfonts[tag] = true
+ usedfonts[tag] = a -- the name
-- add color to stream: 0 g
-- move up with "x.y Ts"
return tostring(stream)
@@ -173,14 +199,14 @@ end
local function registerfonts()
if next(usedfonts) then
local d = pdfdictionary()
- for tag, _ in next, usedfonts do
+ for tag, name in next, usedfonts do
local f = pdfdictionary {
Type = pdfconstant("Font"),
Subtype = pdfconstant("Type1"), -- todo
Name = pdfconstant(tag),
- BaseFont = pdfconstant(fontnames[tag]),
+ BaseFont = pdfconstant(name),
}
- d[tag] = pdfreference(pdfimmediateobj(tostring(f)))
+ d[tag] = pdfreference(pdfflushobject(f))
end
return d
end
@@ -201,7 +227,7 @@ end
local function fieldappearances(specification)
-- todo: caching
local values = specification.values
- local default = specification.default
+ local default = specification.default -- todo
if not values then
-- error
return
@@ -221,9 +247,9 @@ local function fieldappearances(specification)
return lpdf.sharedobj(tostring(appearance))
end
-local function fieldstates(specification,forceyes)
+local function fieldstates(specification,forceyes,values,default)
-- we don't use Opt here (too messy for radio buttons)
- local values, default = specification.values, specification.default
+ local values, default = values or specification.values, default or specification.default
if not values then
-- error
return
@@ -235,12 +261,12 @@ local function fieldstates(specification,forceyes)
else
yes, off = v[1], v[2]
end
- local yesshown, yesvalue = splitter:match(yes)
+ local yesshown, yesvalue = lpegmatch(splitter,yes)
if not (yesshown and yesvalue) then
yesshown = yes, yes
end
yes = aux.settings_to_array(yesshown)
- local offshown, offvalue = splitter:match(off)
+ local offshown, offvalue = lpegmatch(splitter,off)
if not (offshown and offvalue) then
offshown = off, off
end
@@ -265,7 +291,11 @@ local function fieldstates(specification,forceyes)
if not offvalue then
offvalue = offn
end
- forceyes = forceyes and "On" -- spec likes Yes more but we've used On for ages now
+ if forceyes == true then
+ forceyes = forceyes and "On" -- spec likes Yes more but we've used On for ages now
+ else
+ -- false or string
+ end
if default == yesn then
default = pdfconstant(forceyes or yesn)
else
@@ -287,7 +317,7 @@ local function fieldoptions(specification)
local v = aux.settings_to_array(values)
for i=1,#v do
local vi = v[i]
- local shown, value = splitter:match(vi)
+ local shown, value = lpegmatch(splitter,vi)
if shown and value then
v[i] = pdfarray { pdfunicode(value), shown }
else
@@ -298,7 +328,7 @@ local function fieldoptions(specification)
end
end
-local function radiodefault(parent,field)
+local function radiodefault(parent,field,forceyes)
local default, values = parent.default, parent.values
if not default or default == "" then
values = aux.settings_to_array(values)
@@ -308,9 +338,9 @@ local function radiodefault(parent,field)
local fieldvalues = aux.settings_to_array(field.values)
local yes, off = fieldvalues[1], fieldvalues[2] or fieldvalues[1]
if not default then
- return pdfconstant(yes)
+ return pdfconstant((forceyes and "On") or yes)
elseif default == name then
- return pdfconstant(default)
+ return pdfconstant((forceyes and "On") or default)
else
return pdfconstant("Off")
end
@@ -325,7 +355,7 @@ end
-- defining
-local fields, radios, fieldsets, calculationset = { }, { }, { }, nil
+local fields, radios, clones, fieldsets, calculationset = { }, { }, { }, { }, nil
function codeinjections.definefieldset(tag,list)
fieldsets[tag] = list
@@ -358,8 +388,12 @@ end
local function predefinesymbols(specification)
local values = specification.values
if values then
- local a, b = splitter:match(values)
- codeinjections.presetsymbollist(a or values)
+ local symbols = aux.settings_to_array(values)
+ for i=1,#symbols do
+ local symbol = symbols[i]
+ local a, b = lpegmatch(splitter,symbol)
+ codeinjections.presetsymbol(a or symbol)
+ end
end
end
@@ -369,11 +403,11 @@ function codeinjections.getdefaultfieldvalue(name)
local values = f.values
local default = f.default
if not default or default == "" then
- local a, b = splitter:match(values)
- values = a or values
- for name in gmatch(list,"[^, ]+") do
- default = name
- break
+ local symbols = aux.settings_to_array(values)
+ local symbol = symbols[1]
+ if symbol then
+ local a, b = lpegmatch(splitter,symbol) -- splits at =>
+ default = a or symbol
end
end
if default then
@@ -382,14 +416,15 @@ function codeinjections.getdefaultfieldvalue(name)
end
end
-
function codeinjections.definefield(specification)
local n = specification.name
local f = fields[n]
if not f then
local kind = specification.kind
if not kind then
- -- name and kind are mandate
+ if trace_fields then
+ logs.report("fields","invalid definition of '%s': unknown type",n)
+ end
elseif kind == "radio" then
local values = specification.values
if values and values ~= "" then
@@ -398,8 +433,11 @@ function codeinjections.definefield(specification)
radios[values[v]] = { parent = n }
end
fields[n] = specification
- else
- -- invalid radio specification
+ if trace_fields then
+ logs.report("fields","defining '%s' as radio",n or "?")
+ end
+ elseif trace_fields then
+ logs.report("fields","invalid definition of radio '%s': missing values",n)
end
elseif kind == "sub" then
-- not in main field list !
@@ -409,38 +447,77 @@ function codeinjections.definefield(specification)
for key, value in next, specification do
radio[key] = value
end
+ if trace_fields then
+ local p = radios[n] and radios[n].parent
+ logs.report("fields","defining '%s' as sub of radio '%s'",n or "?",p or "?")
+ end
+ elseif trace_fields then
+ logs.report("fields","invalid definition of radio sub '%s': no parent",n)
end
predefinesymbols(specification)
+ elseif kind == "text" or kind == "line" then
+ fields[n] = specification
+ if trace_fields then
+ logs.report("fields","defining '%s' as %s",n,kind)
+ end
+ if specification.values ~= "" and specification.default == "" then
+ specification.default, specification.values = specification.values, nil
+ end
else
fields[n] = specification
+ if trace_fields then
+ logs.report("fields","defining '%s' as %s",n,kind)
+ end
predefinesymbols(specification)
end
- else
- -- already done
+ elseif trace_fields then
+ logs.report("fields","invalid definition of '%s': already defined",n)
end
end
function codeinjections.clonefield(specification)
- local p = specification.parent
- local c = specification.children
+ local p, c, v = specification.parent, specification.children, specification.variant
if not p or not c then
- -- parent and children are mandate
+ if trace_fields then
+ logs.report("fields","invalid clone: children: '%s', parent '%s', variant: '%s'",p or "?",c or "?", v or "?")
+ end
else
for n in gmatch(c,"[^, ]+") do
- local f = fields[n]
- if f and not f.done then
- -- already done
+ local f, r, c, x = fields[n], radios[n], clones[n], fields[p]
+ if f or r or c then
+ if trace_fields then
+ logs.report("fields","already cloned: child: '%s', parent '%s', variant: '%s'",p or "?",n or "?", v or "?")
+ end
+ elseif x then
+ if trace_fields then
+ logs.report("fields","invalid clone: child: '%s', variant: '%s', no parent",n or "?", v or "?")
+ end
else
- fields[n] = specification
+ if trace_fields then
+ logs.report("fields","cloning: child: '%s', parent '%s', variant: '%s'",p or "?",n or "?", v or "?")
+ end
+ clones[n] = specification
+ predefinesymbols(specification)
end
end
end
end
function codeinjections.getfieldgroup(name)
- local f = fields[name]
- if f and f.group then
- texsprint(ctxcatcodes,f.group)
+ local f = fields[name] or radios[name] or clones[name]
+ local g = f and f.group
+ if not g or g == "" then
+ local v, p, k = f.variant, f.parent, f.kind
+ if v == "clone" or v == "copy" then
+ f = fields[p] or radios[p]
+ g = f and f.group
+ elseif k == "sub" then
+ f = fields[p]
+ g = f and f.group
+ end
+ end
+ if g then
+ texsprint(ctxcatcodes,g)
end
end
@@ -480,33 +557,35 @@ end
local collected = pdfarray()
-function codeinjections.finishfields()
+local function finishfields()
for name, field in next, fields do
local kids = field.kids
if kids then
- pdfimmediateobj(field.kobj,tostring(kids))
+ pdfflushobject(field.kobj,kids)
end
local pobj = field.pobj
end
for name, field in next, radios do
local kids = field.kids
if kids then
- pdfimmediateobj(field.kobj,tostring(kids))
+ pdfflushobject(field.kobj,kids)
end
end
if #collected > 0 then
+ usedfonts.tttf = fontnames.tt.tf
local acroform = pdfdictionary {
NeedAppearances = true,
- Fields = pdfreference(pdfimmediateobj(tostring(collected))),
+ Fields = pdfreference(pdfflushobject(collected)),
DR = pdfdictionary { Font = registerfonts() },
CO = fieldsetlist(calculationset),
DA = "/tttf 12 Tf 0 g",
}
- lpdf.addtocatalog("AcroForm",pdfreference(pdfimmediateobj(tostring(acroform))))
+ lpdf.addtocatalog("AcroForm",pdfreference(pdfflushobject(acroform)))
end
- lpdf.finishfields = function() end
end
+lpdf.registerdocumentfinalizer(finishfields)
+
local pdf_widget = pdfconstant("Widget")
local pdf_tx = pdfconstant("Tx")
local pdf_ch = pdfconstant("Ch")
@@ -520,51 +599,64 @@ local pdf_no_rect = pdfarray { 0, 0, 0, 0 }
local methods = { }
function codeinjections.typesetfield(name,specification)
- local field = fields[name] or radios[name]
+ local field = fields[name] or radios[name] or clones[name]
if not field then
- tex.write("error: " .. name)
+ logs.report("fields", "unknown child '%s'",name)
-- unknown field
return
end
+ local variant, parent = field.variant, field.parent
+ if variant == "copy" or variant == "clone" then -- only in clones
+ field = fields[parent] or radios[parent]
+ end
local method = methods[field.kind]
if method then
- method(name,specification)
+ method(name,specification,variant)
+ else
+ logs.report("fields", "unknown method '%s' for child '%s'",field.kind,name)
end
end
-- can be optional multipass optimization (share objects)
local function save_parent(field,specification,d)
- local kn = pdfreserveobj()
+ local kn = pdfreserveobject()
d.Kids = pdfreference(kn)
field.kobj = kn
field.kids = pdfarray()
- local pn = pdfimmediateobj(tostring(d))
+ local pn = pdfflushobject(d)
field.pobj = pn
collected[#collected+1] = pdfreference(pn)
end
local function save_kid(field,specification,d)
- local kn = pdfreserveobj()
+ local kn = pdfreserveobject()
field.kids[#field.kids+1] = pdfreference(kn)
- node.write(nodes.pdfannot(specification.width,specification.height,0,d(),kn))
+ node.write(pdfannotation(specification.width,specification.height,0,d(),kn))
end
-function methods.line(name,specification,extras)
+function methods.line(name,specification,variant,extras)
local field = fields[name]
+ if variant == "copy" or variant == "clone" then
+ logs.report("fields","todo: clones of text fields")
+ end
local kind = field.kind
if not field.pobj then
+ if trace_fields then
+ logs.report("fields","using parent text '%s'",name)
+ end
if extras then
enhance(specification,extras)
end
- local text = pdfunicode(specification.default)
+ local text = pdfunicode(field.default)
local d = pdfdictionary {
Subtype = pdf_widget,
T = pdfunicode(specification.title),
F = fieldplus(specification),
Ff = fieldflag(specification),
OC = fieldlayer(specification),
- MK = fieldsurrounding(specification),
+ MK = fieldsurrounding(specification), -- needed ?
+ DA = fieldsurrounding(specification),
AA = fieldactions(specification),
FT = pdf_tx,
Q = fieldalignment(specification),
@@ -576,6 +668,9 @@ function methods.line(name,specification,extras)
field.specification = specification
end
specification = field.specification or { } -- todo: radio spec
+ if trace_fields then
+ logs.report("fields","using child text '%s'",name)
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
Parent = pdfreference(field.pobj),
@@ -583,21 +678,28 @@ function methods.line(name,specification,extras)
DA = fieldattributes(specification),
OC = fieldlayer(specification),
MK = fieldsurrounding(specification),
+ DA = fieldsurrounding(specification),
AA = fieldactions(specification),
- Q = fieldalignment(specification)
+ Q = fieldalignment(specification),
}
save_kid(field,specification,d)
end
-function methods.text(name,specification)
- methods.line(name,specification,"MultiLine")
+function methods.text(name,specification,variant)
+ methods.line(name,specification,variant,"MultiLine")
end
-function methods.choice(name,specification,extras)
+function methods.choice(name,specification,variant,extras)
local field = fields[name]
+ if variant == "copy" or variant == "clone" then
+ logs.report("fields","todo: clones of choice fields")
+ end
local kind = field.kind
local d
if not field.pobj then
+ if trace_fields then
+ logs.report("fields","using parent choice '%s'",name)
+ end
if extras then
enhance(specification,extras)
end
@@ -615,6 +717,9 @@ function methods.choice(name,specification,extras)
field.specification = specification
end
specification = field.specification or { }
+ if trace_fields then
+ logs.report("fields","using child choice '%s'",name)
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
Parent = pdfreference(field.pobj),
@@ -626,23 +731,29 @@ function methods.choice(name,specification,extras)
save_kid(field,specification,d)
end
-function methods.popup(name,specification)
- methods.choice(name,specification,"PopUp")
+function methods.popup(name,specification,variant)
+ methods.choice(name,specification,variant,"PopUp")
end
-function methods.combo(name,specification)
- methods.choice(name,specification,"PopUp,Edit")
+function methods.combo(name,specification,variant)
+ methods.choice(name,specification,variant,"PopUp,Edit")
end
-- Probably no default appearance needed for first kid and no javascripts for the
-- parent ... I will look into it when I have to make a complex document.
-function methods.check(name,specification)
+function methods.check(name,specification,variant)
-- no /Opt because (1) it's messy - see pdf spec, (2) it discouples kids and
-- contrary to radio there is no way to associate then
local field = fields[name]
+ if variant == "copy" or variant == "clone" then
+ logs.report("fields","todo: clones of check fields")
+ end
local kind = field.kind
local appearance, default = fieldstates(field,true)
if not field.pobj then
+ if trace_fields then
+ logs.report("fields","using parent check '%s'",name)
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
T = pdfunicode(specification.title),
@@ -661,6 +772,9 @@ function methods.check(name,specification)
field.specification = specification
end
specification = field.specification or { } -- todo: radio spec
+ if trace_fields then
+ logs.report("fields","using child check '%s'",name)
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
Parent = pdfreference(field.pobj),
@@ -677,10 +791,16 @@ function methods.check(name,specification)
save_kid(field,specification,d)
end
-function methods.push(name,specification)
+function methods.push(name,specification,variant)
local field = fields[name]
+ if variant == "copy" or variant == "clone" then
+ logs.report("fields","todo: clones of push fields")
+ end
local kind = field.kind
if not field.pobj then
+ if trace_fields then
+ logs.report("fields","using parent push '%s'",name)
+ end
enhance(specification,"PushButton")
local d = pdfdictionary {
Subtype = pdf_widget,
@@ -697,6 +817,9 @@ function methods.push(name,specification)
field.specification = specification
end
specification = field.specification or { } -- todo: radio spec
+ if trace_fields then
+ logs.report("fields","using child push '%s'",name)
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
Parent = pdfreference(field.pobj),
@@ -710,18 +833,29 @@ function methods.push(name,specification)
save_kid(field,specification,d)
end
-function methods.sub(name,specification)
- local field = radios[name]
- if not field then
- return
+function methods.sub(name,specification,variant)
+ local field = radios[name] or fields[name] or clones[name] -- fields in case of a clone, maybe use dedicated clones
+ local values
+ if variant == "copy" or variant == "clone" then
+ name = field.parent
+ values = field.values -- clone only, copy has nil so same as parent
+ field = radios[name]
+ else
+ values = field.values
end
local parent = fields[field.parent]
if not parent then
return
end
+ local appearance = fieldstates(field,name,values) -- we need to force the 'On' name
+ local default = radiodefault(parent,field)
if not parent.pobj then
+ if trace_fields then
+ logs.report("fields","using parent '%s' of radio '%s' with values '%s' and default '%s'",parent.name,name,parent.values or "?",parent.default or "?")
+ end
local specification = parent.specification or { }
- enhance(specification,"Radio,RadiosInUnison")
+ -- enhance(specification,"Radio,RadiosInUnison")
+ enhance(specification,"RadiosInUnison") -- maybe also PushButton as acrobat does
local d = pdfdictionary {
T = parent.name,
FT = pdf_btn,
@@ -729,11 +863,13 @@ function methods.sub(name,specification)
F = fieldplus(specification),
Ff = fieldflag(specification),
H = pdf_n,
+ V = default,
}
save_parent(parent,specification,d)
end
- local appearance = fieldstates(field)
- local default = radiodefault(parent,field)
+ if trace_fields then
+ logs.report("fields","using child radio '%s' with values '%s'",name,values or "?")
+ end
local d = pdfdictionary {
Subtype = pdf_widget,
Parent = pdfreference(parent.pobj),
@@ -741,8 +877,6 @@ function methods.sub(name,specification)
DA = fieldattributes(specification),
OC = fieldlayer(specification),
AA = fieldactions(specification),
- DV = default,
- V = default,
AS = default,
AP = appearance,
H = pdf_n,
diff --git a/Master/texmf-dist/tex/context/base/lpdf-grp.lua b/Master/texmf-dist/tex/context/base/lpdf-grp.lua
index 119d25ee45f..ad01e4d4f5a 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-grp.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-grp.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-grp'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -12,13 +12,11 @@ local nodeinjections = backends.pdf.nodeinjections
local codeinjections = backends.pdf.codeinjections
local registrations = backends.pdf.registrations
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfreference = lpdf.reference
-
-local pdfreserveobj = pdf.reserveobj
-local pdfimmediateobj = pdf.immediateobj
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfconstant = lpdf.constant
+local pdfreference = lpdf.reference
+local pdfflushobject = lpdf.flushobject
local function shade(stype,name,domain,color_a,color_b,n,colorspace,coordinates)
local f = pdfdictionary {
@@ -31,11 +29,11 @@ local function shade(stype,name,domain,color_a,color_b,n,colorspace,coordinates)
local s = pdfdictionary {
ShadingType = stype,
ColorSpace = pdfconstant(colorspace),
- Function = pdfreference(pdfimmediateobj(tostring(f))),
+ Function = pdfreference(pdfflushobject(f)),
Coords = pdfarray(coordinates),
Extend = pdfarray { true, true },
}
- lpdf.adddocumentshade(name,pdfreference(pdfimmediateobj(tostring(s))))
+ lpdf.adddocumentshade(name,pdfreference(pdfflushobject(s)))
end
function lpdf.circularshade(name,domain,color_a,color_b,n,colorspace,coordinates)
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ini.lua b/Master/texmf-dist/tex/context/base/lpdf-ini.lua
index 3335c623756..e0ffd40521b 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-ini.lua
@@ -1,20 +1,25 @@
-if not modules then modules = { } end modules ['back-pdf'] = {
+if not modules then modules = { } end modules ['lpdf-ini'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
}
--- This code is very experimental !
-
local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset
-local char, byte, format, gsub, concat = string.char, string.byte, string.format, string.gsub, table.concat
+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 utfvalues = string.utfvalues
-local texwrite = tex.write
+local texwrite, texset, texsprint, ctxcatcodes = tex.write, tex.set, tex.sprint, tex.ctxcatcodes
local sind, cosd = math.sind, math.cosd
+local lpegmatch = lpeg.match
+
+local pdfreserveobj = pdf and pdf.reserveobj or function() return 1 end -- for testing
+local pdfimmediateobj = pdf and pdf.immediateobj or function() return 2 end -- for testing
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)
+local trace_objects = false trackers.register("backend.objects", function(v) trace_objects = v end)
+local trace_detail = false trackers.register("backend.detail", function(v) trace_detail = v end)
lpdf = lpdf or { }
@@ -39,42 +44,41 @@ lpdf.tosixteen = tosixteen
-- lpeg is some 5 times faster than gsub (in test) on escaping
-local escapes = {
- ["\\"] = "\\\\",
- ["/"] = "\\/", ["#"] = "\\#",
- ["<"] = "\\<", [">"] = "\\>",
- ["["] = "\\[", ["]"] = "\\]",
- ["("] = "\\(", [")"] = "\\)",
-}
+-- local escapes = {
+-- ["\\"] = "\\\\",
+-- ["/"] = "\\/", ["#"] = "\\#",
+-- ["<"] = "\\<", [">"] = "\\>",
+-- ["["] = "\\[", ["]"] = "\\]",
+-- ["("] = "\\(", [")"] = "\\)",
+-- }
+--
+-- local escaped = lpeg.Cs(lpeg.Cc("(") * (lpeg.S("\\/#<>[]()")/escapes + lpeg.P(1))^0 * lpeg.Cc(")"))
+--
+-- local function toeight(str)
+-- if not str or str == "" then
+-- return "()"
+-- else
+-- return lpegmatch(escaped,str)
+-- end
+-- end
+--
+-- -- no need for escaping .. just use unicode instead
-local escaped = lpeg.Cs(lpeg.Cc("(") * (lpeg.S("\\/#<>[]()")/escapes + lpeg.P(1))^0 * lpeg.Cc(")"))
+-- \0 \t \n \r \f <space> ( ) [ ] { } / %
local function toeight(str)
- -- if not str or str == "" then
- -- return "()"
- -- else
- -- return escaped:match(str)
- -- end
- --
- -- no need for escaping .. just use unicode instead
return "(" .. str .. ")"
end
lpdf.toeight = toeight
-local escapes = "-"
-
-local escaped = lpeg.Cs(lpeg.Cc("(") * (lpeg.S("\\/#<>[]()")/escapes + lpeg.P(1))^0 * lpeg.Cc(")"))
-
-local function cleaned(str)
- if not str or str == "" then
- return "()"
- else
- return escaped:match(str)
- end
-end
-
-lpdf.cleaned = cleaned
+--~ local escaped = lpeg.Cs((lpeg.S("\0\t\n\r\f ()[]{}/%")/"#" + lpeg.P(1))^0)
+--~
+--~ local function cleaned(str)
+--~ return (str and str ~= "" and lpegmatch(escaped,str)) or ""
+--~ end
+--~
+--~ lpdf.cleaned = cleaned -- not public yet
local function merge_t(a,b)
local t = { }
@@ -140,7 +144,8 @@ tostring_a = function(t,contentonly,key)
r[#r+1] = tosixteen(v)
elseif tv == "table" then
local mv = getmetatable(v)
- if mv and mv.__lpdftype then
+ local mt = mv and mv.__lpdftype
+ if mt then
r[#r+1] = tostring(v)
elseif v[1] then
r[#r+1] = tostring_a(v)
@@ -170,7 +175,15 @@ local tostring_z = function() return "null" end
local tostring_t = function() return "true" end
local tostring_f = function() return "false" end
local tostring_r = function(t) return t[1] .. " 0 R" end
-local tostring_v = function(t) return concat(t[1],"") end
+
+local tostring_v = function(t)
+ local s = t[1]
+ if type(s) == "table" then
+ return concat(s,"")
+ else
+ return s
+ end
+end
local function value_x(t) return t end -- the call is experimental
local function value_s(t,key) return t[1] end -- the call is experimental
@@ -180,8 +193,8 @@ local function value_c(t) return sub(t[1],2) end -- the call is e
local function value_d(t) return tostring_d(t,true,key) end -- the call is experimental
local function value_a(t) return tostring_a(t,true,key) end -- the call is experimental
local function value_z() return nil end -- the call is experimental
-local function value_t() return true end -- the call is experimental
-local function value_b() return false end -- the call is experimental
+local function value_t(t) return t.value or true end -- the call is experimental
+local function value_f(t) return t.value or false end -- the call is experimental
local function value_r() return t[1] end -- the call is experimental
local function value_v() return t[1] end -- the call is experimental
@@ -200,7 +213,7 @@ local mt_f = { __lpdftype = "false", __tostring = tostring_f, __call = valu
local mt_r = { __lpdftype = "reference", __tostring = tostring_r, __call = value_r }
local mt_v = { __lpdftype = "verbose", __tostring = tostring_v, __call = value_v }
-function lpdf.stream(t)
+local function pdfstream(t) -- we need to add attrbutes
if t then
for i=1,#t do
t[i] = tostring(t[i])
@@ -209,29 +222,29 @@ function lpdf.stream(t)
return setmetatable(t or { },mt_x)
end
-function lpdf.dictionary(t)
+local function pdfdictionary(t)
return setmetatable(t or { },mt_d)
end
-function lpdf.array(t)
- if type(t) == "string"then
+local function pdfarray(t)
+ if type(t) == "string" then
return setmetatable({ t },mt_a)
else
return setmetatable(t or { },mt_a)
end
end
-function lpdf.string(str,default)
+local function pdfstring(str,default)
return setmetatable({ str or default or "" },mt_s)
end
-function lpdf.unicode(str,default)
+local function pdfunicode(str,default)
return setmetatable({ str or default or "" },mt_u)
end
local cache = { } -- can be weak
-function lpdf.number(n,default) -- 0-10
+local function pdfnumber(n,default) -- 0-10
n = n or default
local c = cache[n]
if not c then
@@ -241,15 +254,24 @@ function lpdf.number(n,default) -- 0-10
return c
end
-for i=-1,9 do cache[i] = lpdf.number(i) end
+for i=-1,9 do cache[i] = pdfnumber(i) end
local cache = { } -- can be weak
-function lpdf.constant(str,default)
+local forbidden, replacements = "\0\t\n\r\f ()[]{}/%%#\\", { } -- table faster than function
+
+for s in gmatch(forbidden,".") do
+ replacements[s] = format("#%02x",byte(s))
+end
+
+local escaped = lpeg.Cs(lpeg.Cc("/") * (lpeg.S(forbidden)/replacements + lpeg.P(1))^0)
+
+local function pdfconstant(str,default)
str = str or default or ""
local c = cache[str]
if not c then
- c = setmetatable({ "/" .. str },mt_c)
+ -- c = setmetatable({ "/" .. str },mt_c)
+ c = setmetatable({ lpegmatch(escaped,str) },mt_c)
cache[str] = c
end
return c
@@ -259,30 +281,114 @@ local p_null = { } setmetatable(p_null, mt_z)
local p_true = { } setmetatable(p_true, mt_t)
local p_false = { } setmetatable(p_false,mt_f)
-function lpdf.null()
+local function pdfnull()
return p_null
end
-function lpdf.boolean(b,default)
- if ((type(b) == boolean) and b) or default then
- return p_true
+--~ print(pdfboolean(false),pdfboolean(false,false),pdfboolean(false,true))
+--~ print(pdfboolean(true),pdfboolean(true,false),pdfboolean(true,true))
+--~ print(pdfboolean(nil,true),pdfboolean(nil,false))
+
+local function pdfboolean(b,default)
+ if type(b) == "boolean" then
+ return b and p_true or p_false
else
- return p_false
+ return default and p_true or p_false
end
end
-function lpdf.reference(r)
+local function pdfreference(r)
return setmetatable({ r or 0 },mt_r)
end
-function lpdf.verbose(t) -- maybe check for type
+local function pdfverbose(t) -- maybe check for type
return setmetatable({ t or "" },mt_v)
end
+lpdf.stream = pdfstream
+lpdf.dictionary = pdfdictionary
+lpdf.array = pdfarray
+lpdf.string = pdfstring
+lpdf.unicode = pdfunicode
+lpdf.number = pdfnumber
+lpdf.constant = pdfconstant
+lpdf.null = pdfnull
+lpdf.boolean = pdfboolean
+lpdf.reference = pdfreference
+lpdf.verbose = pdfverbose
+
+-- n = pdf.obj(n, str)
+-- n = pdf.obj(n, "file", filename)
+-- n = pdf.obj(n, "stream", streamtext, attrtext)
+-- n = pdf.obj(n, "streamfile", filename, attrtext)
+
+-- we only use immediate objects
+
+-- todo: tracing
+
+local names, cache = { }, { }
+
+function lpdf.reserveobject(name)
+ local r = pdfreserveobj()
+ if name then
+ names[name] = r
+ if trace_objects then
+ logs.report("backends", "reserving object number %s under name '%s'",r,name)
+ end
+ elseif trace_objects then
+ logs.report("backends", "reserving object number %s",r)
+ end
+ return r
+end
+
+--~ local pdfreserveobject = lpdf.reserveobject
+
+function lpdf.flushobject(name,data)
+ if data then
+ name = names[name] or name
+ if name then
+ if trace_objects then
+ if trace_detail then
+ logs.report("backends", "flushing object data to reserved object with name '%s' -> %s",name,tostring(data))
+ else
+ logs.report("backends", "flushing object data to reserved object with name '%s'",name)
+ end
+ end
+ return pdfimmediateobj(name,tostring(data))
+ else
+ if trace_objects then
+ if trace_detail then
+ logs.report("backends", "flushing object data to reserved object with number %s -> %s",name,tostring(data))
+ else
+ logs.report("backends", "flushing object data to reserved object with number %s",name)
+ end
+ end
+ return pdfimmediateobj(tostring(data))
+ end
+ else
+ if trace_objects and trace_detail then
+ logs.report("backends", "flushing object data -> %s",tostring(name))
+ end
+ return pdfimmediateobj(tostring(name))
+ end
+end
+
+function lpdf.sharedobj(content)
+ local r = cache[content]
+ if not r then
+ r = pdfreference(pdfimmediateobj(content))
+ cache[content] = r
+ end
+ return r
+end
+
--~ local d = lpdf.dictionary()
---~ local e = lpdf.dictionary { ["e"] = "abc" }
+--~ local e = lpdf.dictionary { ["e"] = "abc", x = lpdf.dictionary { ["f"] = "ABC" } }
--~ local f = lpdf.dictionary { ["f"] = "ABC" }
---~ local a = lpdf.array()
+--~ local a = lpdf.array { lpdf.array { lpdf.string("xxx") } }
+
+--~ print(a)
+--~ os.exit()
--~ d["test"] = lpdf.string ("test")
--~ d["more"] = "more"
@@ -296,11 +402,19 @@ end
--~ d.what = a
---~ print(d)
+--~ print(e)
--~ local d = lpdf.dictionary()
--~ d["abcd"] = { 1, 2, 3, "test" }
--~ print(d)
+--~ print(d())
+
+--~ local d = lpdf.array()
+--~ d[#d+1] = 1
+--~ d[#d+1] = 2
+--~ d[#d+1] = 3
+--~ d[#d+1] = "test"
+--~ print(d)
--~ local d = lpdf.array()
--~ d[#d+1] = { 1, 2, 3, "test" }
@@ -310,91 +424,14 @@ end
--~ d[#d+1] = { a=1, b=2, c=3, d="test" }
--~ print(d)
---~ local s = lpdf.boolean(false)
+--~ local s = lpdf.constant("xx")
+--~ print(s) -- fails somehow
--~ print(s()) -- fails somehow
-function lpdf.checkedkey(t,key,kind)
- local pn = t[key]
- if pn then
- local tn = type(pn)
- if tn == kind then
- if kind == "string" then
- return pn ~= "" and pn
- elseif kind == "table" then
- return next(pn) and pn
- else
- return pn
- end
- elseif tn == "string" and kind == "number" then
- return tonumber(pn)
- end
- end
-end
-
-function lpdf.checkedvalue(value,kind) -- code not shared
- if value then
- local tv = type(value)
- if tv == kind then
- if kind == "string" then
- return value ~= "" and value
- elseif kind == "table" then
- return next(value) and value
- else
- return value
- end
- elseif tv == "string" and kind == "number" then
- return tonumber(value)
- end
- end
-end
-
-function lpdf.limited(n,min,max,default)
- if not n then
- return default
- else
- n = tonumber(n)
- if not n then
- return default
- elseif n > max then
- return max
- elseif n < min then
- return min
- else
- return n
- end
- end
-end
-
--- there will be more of this
-
-local pdfreference = lpdf.reference
-local pdfdictionary = lpdf.dictionary
-local pdfreserveobj = pdf.reserveobj
-local pdfimmediateobj = pdf.immediateobj
-
-local texset, texsprint, ctxcatcodes = tex.set, tex.sprint, tex.ctxcatcodes
-
-local pdfobjcache = { }
-
-function lpdf.sharedobj(content)
- local r = pdfobjcache[content]
- if not r then
- r = pdfreference(pdfimmediateobj(content))
- pdfobjcache[content] = r
- end
- return r
-end
-
--- saves definitions later on
-
-backends = backends or { }
-backends.pdf = backends.pdf or {
- comment = "backend for directly generating pdf output",
- nodeinjections = { },
- codeinjections = { },
- registrations = { },
- helpers = { },
-}
+--~ local s = lpdf.boolean(false)
+--~ s.value = true
+--~ print(s)
+--~ print(s())
-- three priority levels, default=2
@@ -409,9 +446,12 @@ local function resetpageproperties()
end
local function setpageproperties()
- texset("global", "pdfpageresources", pageresources ())
- texset("global", "pdfpageattr", pageattributes ())
- texset("global", "pdfpagesattr", pagesattributes())
+--~ texset("global", "pdfpageresources", pageresources ())
+--~ texset("global", "pdfpageattr", pageattributes ())
+--~ texset("global", "pdfpagesattr", pagesattributes())
+ pdf.pageresources = pageresources ()
+ pdf.pageattributes = pageattributes ()
+ pdf.pagesattributes = pagesattributes()
end
function lpdf.addtopageresources (k,v) pageresources [k] = v end
@@ -458,16 +498,39 @@ end
function lpdf.finalizedocument()
if not environment.initex then
run(documentfinalizers,"document")
+ function lpdf.finalizedocument()
+ logs.report("backend","serious error: the document is finalized multiple times")
+ function lpdf.finalizedocument() end
+ end
end
end
-local c_template = "\\normalpdfcatalog{/%s %s}"
-local i_template = "\\normalpdfinfo{/%s %s}"
-local n_template = "\\normalpdfnames{/%s %s}"
+-- some minimal tracing, handy for checking the order
-function lpdf.addtocatalog(k,v) if not environment.initex then texsprint(ctxcatcodes,format(c_template,k,tostring(v))) end end
-function lpdf.addtoinfo (k,v) if not environment.initex then texsprint(ctxcatcodes,format(i_template,k,tostring(v))) end end
-function lpdf.addtonames (k,v) if not environment.initex then texsprint(ctxcatcodes,format(n_template,k,tostring(v))) end end
+local function trace_set(what,key)
+ if trace_resources then
+ logs.report("backend", "setting key '%s' in '%s'",key,what)
+ end
+end
+local function trace_flush(what)
+ if trace_resources then
+ logs.report("backend", "flushing '%s'",what)
+ end
+end
+
+lpdf.protectresources = true
+
+local catalog, info, names = pdfdictionary(), pdfdictionary(), pdfdictionary()
+
+local function flushcatalog() if not environment.initex then trace_flush("catalog") pdf.catalog = catalog() end end
+local function flushinfo () if not environment.initex then trace_flush("info") pdf.info = info () end end
+local function flushnames () if not environment.initex then trace_flush("names") pdf.names = names () end end
+
+function lpdf.addtocatalog(k,v) if not (lpdf.protectresources and catalog[k]) then trace_set("catalog",k) catalog[k] = v end end
+function lpdf.addtoinfo (k,v) if not (lpdf.protectresources and info [k]) then trace_set("info", k) info [k] = v end end
+function lpdf.addtonames (k,v) if not (lpdf.protectresources and names [k]) then trace_set("names", k) names [k] = v end end
+
+local dummy = pdfreserveobj() -- else bug in hvmd due so some internal luatex conflict
local r_extgstates, d_extgstates = pdfreserveobj(), pdfdictionary() local p_extgstates = pdfreference(r_extgstates)
local r_colorspaces, d_colorspaces = pdfreserveobj(), pdfdictionary() local p_colorspaces = pdfreference(r_colorspaces)
@@ -479,10 +542,10 @@ local function checkcolorspaces() if next(d_colorspaces) then lpdf.addtopagereso
local function checkpatterns () if next(d_patterns ) then lpdf.addtopageresources("Pattern", p_patterns ) end end
local function checkshades () if next(d_shades ) then lpdf.addtopageresources("Shading", p_shades ) end end
-local function flushextgstates () if next(d_extgstates ) then pdfimmediateobj(r_extgstates, tostring(d_extgstates )) end end
-local function flushcolorspaces() if next(d_colorspaces) then pdfimmediateobj(r_colorspaces,tostring(d_colorspaces)) end end
-local function flushpatterns () if next(d_patterns ) then pdfimmediateobj(r_patterns, tostring(d_patterns )) end end
-local function flushshades () if next(d_shades ) then pdfimmediateobj(r_shades, tostring(d_shades )) end end
+local function flushextgstates () if next(d_extgstates ) then trace_flush("extgstates") pdfimmediateobj(r_extgstates, tostring(d_extgstates )) end end
+local function flushcolorspaces() if next(d_colorspaces) then trace_flush("colorspaces") pdfimmediateobj(r_colorspaces,tostring(d_colorspaces)) end end
+local function flushpatterns () if next(d_patterns ) then trace_flush("patterns") pdfimmediateobj(r_patterns, tostring(d_patterns )) end end
+local function flushshades () if next(d_shades ) then trace_flush("shades") pdfimmediateobj(r_shades, tostring(d_shades )) end end
local collected = pdfdictionary {
ExtGState = p_extgstates,
@@ -505,15 +568,103 @@ lpdf.registerdocumentfinalizer(flushcolorspaces,3)
lpdf.registerdocumentfinalizer(flushpatterns,3)
lpdf.registerdocumentfinalizer(flushshades,3)
+lpdf.registerdocumentfinalizer(flushcatalog,3)
+lpdf.registerdocumentfinalizer(flushinfo,3)
+lpdf.registerdocumentfinalizer(flushnames,3)
+
lpdf.registerpagefinalizer(checkextgstates,3)
lpdf.registerpagefinalizer(checkcolorspaces,3)
lpdf.registerpagefinalizer(checkpatterns,3)
lpdf.registerpagefinalizer(checkshades,3)
---
+-- in strc-bkm: lpdf.registerdocumentfinalizer(function() structure.bookmarks.place() end,1)
function lpdf.rotationcm(a)
local s, c = sind(a), cosd(a)
texwrite(format("%s %s %s %s 0 0 cm",c,s,-s,c))
end
+-- ! -> universaltime
+
+local timestamp = os.date("%Y-%m-%dT%X") .. os.timezone(true)
+
+function lpdf.timestamp()
+ return timestamp
+end
+
+function lpdf.pdftimestamp(str)
+ 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)
+end
+
+function lpdf.id()
+ return format("%s.%s",tex.jobname,timestamp)
+end
+
+function lpdf.checkedkey(t,key,kind)
+ local pn = t[key]
+ if pn then
+ local tn = type(pn)
+ if tn == kind then
+ if kind == "string" then
+ return pn ~= "" and pn
+ elseif kind == "table" then
+ return next(pn) and pn
+ else
+ return pn
+ end
+ elseif tn == "string" and kind == "number" then
+ return tonumber(pn)
+ end
+ end
+end
+
+function lpdf.checkedvalue(value,kind) -- code not shared
+ if value then
+ local tv = type(value)
+ if tv == kind then
+ if kind == "string" then
+ return value ~= "" and value
+ elseif kind == "table" then
+ return next(value) and value
+ else
+ return value
+ end
+ elseif tv == "string" and kind == "number" then
+ return tonumber(value)
+ end
+ end
+end
+
+function lpdf.limited(n,min,max,default)
+ if not n then
+ return default
+ else
+ n = tonumber(n)
+ if not n then
+ return default
+ elseif n > max then
+ return max
+ elseif n < min then
+ return min
+ else
+ return n
+ end
+ end
+end
+
+-- lpdf.addtoinfo("ConTeXt.Version", tex.contextversiontoks)
+-- lpdf.addtoinfo("ConTeXt.Time", os.date("%Y.%m.%d %H:%M")) -- :%S
+-- lpdf.addtoinfo("ConTeXt.Jobname", tex.jobname)
+-- lpdf.addtoinfo("ConTeXt.Url", "www.pragma-ade.com")
+
+-- saves definitions later on
+
+backends = backends or { }
+backends.pdf = backends.pdf or {
+ comment = "backend for directly generating pdf output",
+ nodeinjections = { },
+ codeinjections = { },
+ registrations = { },
+ helpers = { },
+}
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ini.mkiv b/Master/texmf-dist/tex/context/base/lpdf-ini.mkiv
index 771ed3c5817..7c7dce3efb3 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/lpdf-ini.mkiv
@@ -14,6 +14,7 @@
\writestatus{loading}{ConTeXt Backend Macros / PDF}
\registerctxluafile{lpdf-ini}{1.001}
+\registerctxluafile{lpdf-xmp}{1.001}
\registerctxluafile{lpdf-nod}{1.001}
%registerctxluafile{lpdf-col}{1.001} % will be loaded later
\registerctxluafile{lpdf-mis}{1.001}
@@ -23,7 +24,7 @@
\registerctxluafile{lpdf-wid}{1.001}
\registerctxluafile{lpdf-fld}{1.001}
\registerctxluafile{lpdf-u3d}{1.001}
-
+\registerctxluafile{lpdf-swf}{1.001}
\unprotect
@@ -37,7 +38,8 @@
%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.
+%D implemented in the \POSTSCRIPT\ driver. This code is
+%D somewhat obsolete as we now have metapost embedded.
\def\doPDFovalcalc#1#2#3%
{\PointsToBigPoints{\dimexpr#1+#2\relax}#3}
@@ -257,4 +259,13 @@
\wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox
\egroup}
+\unexpanded\def\pdfactualtext#1#2%
+ {\pdfliteral direct{/Span <</ActualText \ctxlua{tex.write(lpdf.tosixteen("#2"))} >> BDC}%
+ #1%
+ \pdfliteral direct{EMC}}
+
+% \starttext
+% text \pdfactualtext{Meier}{Müller} text
+% \stoptext
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lpdf-mis.lua b/Master/texmf-dist/tex/context/base/lpdf-mis.lua
index 142b3257403..a68c7b4873d 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-mis.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-mis.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-mis'] = {
version = 1.001,
- comment = "companion to back-pdf.tex",
+ 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"
@@ -28,24 +28,21 @@ local copy_node = node.copy
local pdfliteral, register = nodes.pdfliteral, nodes.register
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfboolean = lpdf.boolean
-local pdfconstant = lpdf.constant
-local pdfreference = lpdf.reference
-local pdfunicode = lpdf.unicode
-local pdfstring = lpdf.string
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfboolean = lpdf.boolean
+local pdfconstant = lpdf.constant
+local pdfreference = lpdf.reference
+local pdfunicode = lpdf.unicode
+local pdfverbose = lpdf.verbose
+local pdfstring = lpdf.string
+local pdfflushobject = lpdf.flushobject
-local pdfreserveobj = pdf.reserveobj
local pdfimmediateobj = pdf.immediateobj
local tobasepoints = number.tobasepoints
-
local variables = interfaces.variables
-lpdf.addtoinfo ("Trapped", pdfboolean(false))
-lpdf.addtocatalog("Version", pdfconstant(format("1.%s",tex.pdfminorversion)))
-
--
local positive = register(pdfliteral("/GSpositive gs"))
@@ -63,8 +60,8 @@ local function initializenegative()
}
local negative = pdfdictionary { Type = g, TR = pdfreference(pdf.immediateobj("stream","1 exch sub",d())) }
local positive = pdfdictionary { Type = g, TR = pdfconstant("Identity") }
- lpdf.adddocumentextgstate("GSnegative", pdfreference(pdfimmediateobj(tostring(negative))))
- lpdf.adddocumentextgstate("GSPositive", pdfreference(pdfimmediateobj(tostring(positive))))
+ lpdf.adddocumentextgstate("GSnegative", pdfreference(pdfflushobject(negative)))
+ lpdf.adddocumentextgstate("GSPositive", pdfreference(pdfflushobject(positive)))
initializenegative = nil
end
@@ -72,8 +69,8 @@ local function initializeoverprint()
local g = pdfconstant("ExtGState")
local knockout = pdfdictionary { Type = g, OP = false, OPM = 0 }
local overprint = pdfdictionary { Type = g, OP = true, OPM = 1 }
- lpdf.adddocumentextgstate("GSknockout", pdfreference(pdfimmediateobj(tostring(knockout ))))
- lpdf.adddocumentextgstate("GSoverprint", pdfreference(pdfimmediateobj(tostring(overprint))))
+ lpdf.adddocumentextgstate("GSknockout", pdfreference(pdfflushobject(knockout)))
+ lpdf.adddocumentextgstate("GSoverprint", pdfreference(pdfflushobject(overprint)))
initializeoverprint = nil
end
@@ -147,26 +144,40 @@ lpdf.registerdocumentfinalizer(flushdocumentactions)
--- info
function codeinjections.setupidentity(specification)
- local title = specification.title or "" if title ~= "" then
- lpdf.addtoinfo("Title", pdfunicode(title))
+ local title = specification.title or ""
+ if title ~= "" then
+ lpdf.addtoinfo("Title", pdfunicode(title), title)
end
- local subject = specification.subject or "" if subject ~= "" then
- lpdf.addtoinfo("Subject", pdfunicode(subject))
+ local subject = specification.subject or ""
+ if subject ~= "" then
+ lpdf.addtoinfo("Subject", pdfunicode(subject), subject)
end
- local author = specification.author or "" if author ~= "" then
- lpdf.addtoinfo("Author", pdfunicode(author))
+ local author = specification.author or ""
+ if author ~= "" then
+ lpdf.addtoinfo("Author", pdfunicode(author), author) -- '/Author' in /Info, 'Creator' in XMP
end
- local creator = specification.creator or "" if creator ~= "" then
- lpdf.addtoinfo("Creator", pdfunicode(creator))
+ local creator = specification.creator or ""
+ if creator ~= "" then
+ lpdf.addtoinfo("Creator", pdfunicode(creator), creator) -- '/Creator' in /Info, 'CreatorTool' in XMP
end
- local date = specification.date or "" if date ~= "" then
- lpdf.addtoinfo("ModDate", pdfstring(date))
+ lpdf.addtoinfo("CreationDate", pdfstring(lpdf.pdftimestamp(lpdf.timestamp())))
+ local date = specification.date or ""
+ local pdfdate = lpdf.pdftimestamp(date)
+ if pdfdate then
+ lpdf.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
+ date = lpdf.timestamp()
+ lpdf.addtoinfo("ModDate", pdfstring(lpdf.pdftimestamp(date)), date)
end
- local keywords = specification.keywords or "" if keywords ~= "" then
+ local keywords = specification.keywords or ""
+ if keywords ~= "" then
keywords = string.gsub(keywords, "[%s,]+", " ")
- lpdf.addtoinfo("Keywords",pdfunicode(keywords))
+ lpdf.addtoinfo("Keywords",pdfunicode(keywords), keywords)
end
- lpdf.addtoinfo("ID", pdfstring(format("%s.%s",tex.jobname,os.date("%Y%m%d.%H%M")))) -- needed for pdf/x
+ local id = lpdf.id()
+ lpdf.addtoinfo("ID", pdfstring(id), id) -- needed for pdf/x
end
local function flushjavascripts()
@@ -181,9 +192,9 @@ local function flushjavascripts()
JS = pdfreference(pdfimmediateobj("stream",script)),
}
a[#a+1] = pdfstring(name)
- a[#a+1] = pdfreference(pdfimmediateobj(tostring(j)))
+ a[#a+1] = pdfreference(pdfflushobject(j))
end
- lpdf.addtonames("JavaScript",pdfreference(pdfimmediateobj(tostring(pdfdictionary{ Names = a }))))
+ lpdf.addtonames("JavaScript",pdfreference(pdfflushobject(pdfdictionary{ Names = a })))
end
end
@@ -226,38 +237,50 @@ end
local function documentspecification()
local spec = pagespecs[pagespec] or pagespecs[variables.default]
- local mode, layout, fit = spec[1], spec[2], spec[3]
- if layout == variables.auto then
- if doublesided then
- spec = pagespecs.doublesided
- mode, layout, fit = spec[1], spec[2], spec[3]
- else
- layout = false
+ if spec then
+ local mode, layout, fit = spec[1], spec[2], spec[3]
+ if layout == variables.auto then
+ if doublesided then
+ spec = pagespecs[variables.doublesided] -- to be checked voor interfaces
+ if spec then
+ mode, layout, fit = spec[1], spec[2], spec[3]
+ end
+ else
+ layout = false
+ end
end
- end
- mode = mode and pdfconstant(mode)
- layout = layout and pdfconstant(layout)
- fit = fit and pdfdictionary { FitWindow = true }
- if layout then
- lpdf.addtocatalog("PageLayout",layout)
- end
- if mode then
- lpdf.addtocatalog("PageMode",mode)
- end
- if fit then
- lpdf.addtocatalog("ViewerPreferences",fit)
+ mode = mode and pdfconstant(mode)
+ layout = layout and pdfconstant(layout)
+ fit = fit and pdfdictionary { FitWindow = true }
+ if layout then
+ lpdf.addtocatalog("PageLayout",layout)
+ end
+ if mode then
+ lpdf.addtocatalog("PageMode",mode)
+ end
+ if fit then
+ lpdf.addtocatalog("ViewerPreferences",fit)
+ end
+ lpdf.addtoinfo ("Trapped", pdfconstant("False")) -- '/Trapped' in /Info, 'Trapped' in XMP
+ lpdf.addtocatalog("Version", pdfconstant(format("1.%s",tex.pdfminorversion)))
end
end
+-- temp hack: the mediabox is not under our control and has a precision of 4 digits
+
local factor = number.dimenfactors.bp
+local function boxvalue(n) -- we could share them
+ return pdfverbose(format("%0.4f",factor * n))
+end
+
local function pagespecification()
local pageheight = tex.pdfpageheight
local box = pdfarray { -- can be cached
- factor * (leftoffset),
- factor * (pageheight-topoffset-height),
- factor * (width-leftoffset),
- factor * (pageheight-topoffset),
+ boxvalue(leftoffset),
+ boxvalue(pageheight-topoffset-height),
+ boxvalue(width-leftoffset),
+ boxvalue(pageheight-topoffset),
}
lpdf.addtopageattributes("CropBox",box) -- mandate for rendering
lpdf.addtopageattributes("TrimBox",box) -- mandate for pdf/x
diff --git a/Master/texmf-dist/tex/context/base/lpdf-nod.lua b/Master/texmf-dist/tex/context/base/lpdf-nod.lua
index f40039b9461..0ae9001232a 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-nod.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-nod.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-nod'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -20,7 +20,7 @@ local views = { -- beware, we do support the pdf keys but this is *not* official
fith = 2, [variables.width] = 2,
fitv = 3, [variables.height] = 3,
fitb = 4,
- fitbh = 5, [variables.minheight] = 5,
+ fitbh = 5, [variables.minwidth] = 5,
fitbv = 6, [variables.minheight] = 6,
fitr = 7,
}
@@ -31,7 +31,7 @@ function nodes.pdfliteral(str)
return t
end
-function nodes.pdfannot(w,h,d,data,n)
+function nodes.pdfannotation(w,h,d,data,n)
local t = copy_node(pdfannot)
if w and w ~= 0 then t.width = w end
if h and h ~= 0 then t.height = h end
@@ -41,7 +41,7 @@ function nodes.pdfannot(w,h,d,data,n)
return t
end
-function nodes.pdfdest(w,h,d,name,view,n)
+function nodes.pdfdestination(w,h,d,name,view,n)
local t = copy_node(pdfdest)
if w and w ~= 0 then t.width = w end
if h and h ~= 0 then t.height = h end
diff --git a/Master/texmf-dist/tex/context/base/lpdf-pdx.lua b/Master/texmf-dist/tex/context/base/lpdf-pdx.lua
new file mode 100644
index 00000000000..0a440c1e665
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lpdf-pdx.lua
@@ -0,0 +1,139 @@
+if not modules then modules = { } end modules ['lpdf-pdx'] = {
+ version = 1.001,
+ comment = "companion to lpdf-ini.mkiv",
+ author = "Peter Rold and Hans Hagen",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local codeinjections = backends.codeinjections -- normally it is registered
+local variables = interfaces.variables
+
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfconstant = lpdf.constant
+local pdfreference = lpdf.reference
+local pdfflushobject = lpdf.flushobject
+local pdfstring = lpdf.string
+local pdfverbose = lpdf.verbose
+
+local lower, gmatch = string.lower, string.gmatch
+
+local channels = {
+ gray = 1,
+ grey = 1,
+ rgb = 3,
+ cmyk = 4,
+}
+
+local prefixes = {
+ gray = "DefaultGray",
+ grey = "DefaultGray",
+ rgb = "DefaultRGB",
+ cmyk = "DefaultCMYK",
+}
+
+local profiles = { }
+local defaults = { }
+local intents = pdfarray()
+local lastprofile = nil
+
+function codeinjections.useinternalICCprofile(colorspace,filename)
+ local name = lower(file.basename(filename))
+ local profile = profiles[name]
+ if not profile then
+ local colorspace = lower(colorspace)
+ local filename = resolvers.findctxfile(filename) or ""
+ local channel = channels[colorspace]
+ if channel and filename ~= "" then
+ local a = pdfdictionary { N = channel }
+ profile = pdf.obj {
+ compresslevel = 0,
+ immediate = true,
+ type = "stream",
+ file = filename,
+ attr = a(),
+ }
+ profiles[name] = profile
+ end
+ end
+ lastprofile = profile
+ return profile
+end
+
+function codeinjections.useexternalICCprofile(colorspace,name,urls,checksum,version)
+ local profile = profiles[name]
+ if not profile then
+ local u = pdfarray()
+ for url in gmatch(urls,"([^, ]+)") do
+ u[#u+1] = pdfdictionary {
+ FS = pdfconstant("URL"),
+ F = pdfstring(url),
+ }
+ end
+ local d = pdfdictionary {
+ ProfileName = name, -- not file name!
+ ProfileCS = colorspace,
+ URLs = u, -- array containing at least one URL
+ CheckSum = pdfverbose { "<", checksum, ">" }, -- 16byte MD5 hash
+ ICCVersion = pdfverbose { "<", version, ">" }, -- bytes 8..11 from the header of the ICC profile, as a hex string
+ }
+ local n = pdfflushobject(d)
+ profiles[name] = n
+ lastprofile = n
+ return n
+ end
+end
+
+local function embedprofile(colorspace,filename)
+ local colorspace = lower(colorspace)
+ local n = codeinjections.useinternaliccprofile(colorspace,filename)
+ if n then
+ local a = pdfarray {
+ pdfconstant("ICCBased"),
+ pdfreference(n),
+ }
+ lpdf.adddocumentcolorspace(prefixes[colorspace],pdfreference(pdfflushobject(a))) -- part of page /Resources
+ defaults[lower(colorspace)] = filename
+ end
+end
+
+
+function codeinjections.useICCdefaultprofile(colorspace,filename)
+ defaults[lower(colorspace)] = filename
+end
+
+local function flushembeddedprofiles()
+ for colorspace, filename in next, defaults do
+ embedprofile(colorspace,filename)
+ end
+end
+
+function codeinjections.usePDFXoutputintent(id,name,reference,outputcondition,info)
+ local d = {
+ Type = pdfconstant("OutputIntent"),
+ S = pdfconstant("GTS_PDFX"),
+ OutputConditionIdentifier = id,
+ RegistryName = name,
+ OutputCondition = outputcondition,
+ Info = info,
+ }
+ local icc = lastprofile
+ if reference == variables.yes then
+ d["DestOutputProfileRef"] = pdfreference(icc)
+ else
+ d["DestOutputProfile"] = pdfreference(icc)
+ end
+ -- intents[#intents+1] = pdfdictionary(d)
+ intents[#intents+1] = pdfreference(pdfflushobject(pdfdictionary(d))) -- nicer as separate object
+end
+
+local function flushoutputintents()
+ if #intents > 0 then
+ lpdf.addtocatalog("OutputIntents",pdfreference(pdfflushobject(intents)))
+ end
+end
+
+
+lpdf.registerdocumentfinalizer(flushoutputintents,1)
+lpdf.registerdocumentfinalizer(flushembeddedprofiles,1)
diff --git a/Master/texmf-dist/tex/context/base/lpdf-pdx.mkiv b/Master/texmf-dist/tex/context/base/lpdf-pdx.mkiv
new file mode 100644
index 00000000000..ffb7f526976
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lpdf-pdx.mkiv
@@ -0,0 +1,71 @@
+%D \module
+%D [ file=lpdf-pdx,
+%D version=2010.02.11,
+%D title=\CONTEXT\ Backend Macros,
+%D subtitle=PDF-X,
+%D author=Peter Rolf \& Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA] % and peter
+%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 Backend Macros / PDF-X}
+
+\unprotect
+
+% declare default color space
+% all device based entries of the same CS are mapped to the defined ICCprofile then;
+% i.e. /DeviceRGB --> /ICCBased RGB profile
+% TODO: allow multiple default profiles (one per CS)
+%
+% external ICC profile dictionary (PDF/X-4p and PDF/X-5p)
+%
+% - ProfileName (not file name!)
+% - URLs (array containing at least one URL); the keyword FSA is wrong!
+% - CheckSum (16byte MD5 hash)
+% - ProfileCS (GRAY,RGB,CMYK)
+% - ICCVersion (bytes 8..11 from the header of the ICC profile, as a hex string)
+
+\registerctxluafile{lpdf-pdx} {}
+
+% \def\embedICCprofile#1#2% colorspace, name
+% {\ctxlua{backends.codeinjections.addiccprofile("#1","#2")}}
+
+\def\douseinternalICCprofile[#1]%
+ {\getparameters[\??ic][colorspace=,filename=,#1]%
+ \ctxlua{backends.codeinjections.useinternalICCprofile(
+ "\@@iccolorspace","\@@icfilename")}}
+
+% create a dictionary for an external ICC profile (PDF/X-4p and PDF/X-5pg only)
+% the referenced ICC profile is not embedded
+
+\def\douseexternalICCprofile[#1]%
+ {\getparameters[\??ic][colorspace=,name=,url=,checksum=,version=,#1]%
+ \ctxlua{backends.codeinjections.useexternalICCprofile(
+ "\@@iccolorspace","\@@icname","\@@icurl","\@@icchecksum","\@@icversion")}}
+
+% use an ICC profile as default colorspace for all device dependend colors;
+% all device based entries of the same CS are mapped to the defined ICCprofile then;
+% i.e. /DeviceRGB --> /ICCBased RGB profile always embed the profile!
+
+\def\douseICCdefaultprofile[#1]%
+ {\getparameters[\??ic][colorspace=,filename=,#1]%
+ \ctxlua{backends.codeinjections.useICCdefaultprofile(
+ "\@@iccolorspace","\@@icfilename")}}
+
+% embedding rules for output intent profile differ for the PDF/X versions
+
+\def\dousePDFXoutputintent[#1]%
+ {\getparameters[\??ic][reference=\v!yes,outputcondition=,info=,id=,name=,#1]%
+ \ctxlua{backends.codeinjections.usePDFXoutputintent(
+ "\@@icid","\@@icname","\@@icreference","\@@icoutputcondition","\@@icinfo")}}
+
+\def\useinternalICCprofile{\dosingleempty\douseinternalICCprofile}
+\def\useexternalICCprofile{\dosingleempty\douseexternalICCprofile}
+\def\useICCdefaultprofile {\dosingleempty\douseICCdefaultprofile }
+\def\usePDFXoutputintent {\dosingleempty\dousePDFXoutputintent }
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ren.lua b/Master/texmf-dist/tex/context/base/lpdf-ren.lua
index 746db7efd1a..e6bbd67fe2e 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ren.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-ren.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-ren'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -29,13 +29,11 @@ local executers = jobreferences.executers
local variables = interfaces.variables
-local pdfconstant = lpdf.constant
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfreference = lpdf.reference
-
-local pdfreserveobj = pdf.reserveobj
-local pdfimmediateobj = pdf.immediateobj
+local pdfconstant = lpdf.constant
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfflushobject = lpdf.flushobject
local pdf_ocg = pdfconstant("OCG")
local pdf_ocmd = pdfconstant("OCMD")
@@ -66,13 +64,13 @@ function codeinjections.defineviewerlayer(specification)
Intent = ((specification.kind > 0) and pdf_design) or nil, -- disable layer hiding by user
Usage = ((specification.printable == variables.no) and lpdf_usage) or nil , -- printable or not
}
- local nr = pdfreference(pdfimmediateobj(tostring(n)))
+ local nr = pdfreference(pdfflushobject(n))
pdfln[tag] = nr -- was n
local d = pdfdictionary {
Type = pdf_ocmd,
OCGs = pdfarray { nr },
}
- local dr = pdfreference(pdfimmediateobj(tostring(d)))
+ local dr = pdfreference(pdfflushobject(d))
pdfld[tag] = dr
textlayers[#textlayers+1] = nr
if specification.visible == variables.start then
diff --git a/Master/texmf-dist/tex/context/base/lpdf-swf.lua b/Master/texmf-dist/tex/context/base/lpdf-swf.lua
new file mode 100644
index 00000000000..9fe0cd09fc8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lpdf-swf.lua
@@ -0,0 +1,109 @@
+if not modules then modules = { } end modules ['lpdf-swf'] = {
+ 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"
+}
+
+-- The following code is based on tests by Luigi Scarso. His prototype
+-- was using tex code. This is the official implementation.
+
+local format = string.format
+
+local pdfconstant = lpdf.constant
+local pdfboolean = lpdf.boolean
+local pdfstring = lpdf.string
+local pdfunicode = lpdf.unicode
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfnull = lpdf.null
+local pdfreference = lpdf.reference
+
+function backends.pdf.helpers.insertswf(spec)
+
+ local width, height, filename = spec.width, spec.height, spec.foundname
+
+ local eref = backends.codeinjections.embedfile(filename)
+
+ local flash = pdfdictionary {
+ Subtype = pdfconstant("Flash"),
+ Instances = pdfarray {
+ pdfdictionary {
+ Asset = eref,
+ Params = pdfdictionary {
+ Binding = pdfconstant("Foreground")
+ }
+ },
+ },
+ }
+
+ local fref = pdfreference(pdf.immediateobj(tostring(flash)))
+
+ local configuration = pdfdictionary {
+ Configurations = pdfarray { fref },
+ Assets = pdfdictionary {
+ Names = pdfarray {
+ pdfstring(filename),
+ eref,
+ }
+ },
+ }
+
+ local cref = pdfreference(pdf.immediateobj(tostring(configuration)))
+
+ local activation = pdfdictionary {
+ Activation = pdfdictionary {
+ Type = pdfconstant("RichMediaActivation"),
+ Condition = pdfconstant("PO"),
+ Configuration = fref,
+ Animation = pdfdictionary {
+ Subtype = pdfconstant("Linear"),
+ Speed = 1,
+ Playcount = 1,
+ },
+ Deactivation = pdfdictionary {
+ Type = pdfconstant("RichMediaDeactivation"),
+ Condition = pdfconstant("XD"),
+ },
+ Presentation = pdfdictionary {
+ PassContextClick = false,
+ Style = pdfconstant("Embedded"),
+ Toolbar = false,
+ NavigationPane = false,
+ Transparent = true,
+ Window = pdfdictionary {
+ Type = pdfconstant("RichMediaWindow"),
+ Width = pdfdictionary {
+ Default = 100,
+ Min = 100,
+ Max = 100,
+ },
+ Height = pdfdictionary {
+ Default = 100,
+ Min = 100,
+ Max = 100,
+ },
+ Position = pdfdictionary {
+ Type = pdfconstant("RichMediaPosition"),
+ HAlign = pdfconstant("Near"),
+ VAlign = pdfconstant("Near"),
+ HOffset = 0,
+ VOffset = 0,
+ }
+ }
+ }
+ }
+ }
+
+ local aref = pdfreference(pdf.immediateobj(tostring(activation)))
+
+ local annotation = pdfdictionary {
+ Subtype = pdfconstant("RichMedia"),
+ RichMediaContent = cref,
+ RichMediaSettings = aref,
+ }
+
+ return annotation, nil, nil
+
+end
diff --git a/Master/texmf-dist/tex/context/base/lpdf-u3d.lua b/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
index 5f7a770b160..f7a62c6c904 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-u3d.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-u3d'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -13,19 +13,22 @@ if not modules then modules = { } end modules ['lpdf-u3d'] = {
-- an overhaul. There are some messy leftovers that will be
-- removed in future versions.
-local format = string.format
+local format, find = string.format, string.find
local cos, sin, sqrt, pi, atan2, abs = math.cos, math.sin, math.sqrt, math.pi, math.atan2, math.abs
-local pdfconstant = lpdf.constant
-local pdfboolean = lpdf.boolean
-local pdfunicode = lpdf.unicode
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfnull = lpdf.null
-local pdfreference = lpdf.reference
+local pdfconstant = lpdf.constant
+local pdfboolean = lpdf.boolean
+local pdfnumber = lpdf.number
+local pdfunicode = lpdf.unicode
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfnull = lpdf.null
+local pdfreference = lpdf.reference
-local checkedkey = lpdf.checkedkey
-local limited = lpdf.limited
+local pdfimmediateobj = pdf.immediateobj
+
+local checkedkey = lpdf.checkedkey
+local limited = lpdf.limited
local schemes = table.tohash {
"Artwork", "None", "White", "Day", "Night", "Hard",
@@ -62,13 +65,14 @@ end
local function make3dview(view)
- local name = viewname
- local name = pdfunicode((view.name ~= "" and name) or "unknown view")
+ local name = view.name
+ local name = pdfunicode(name ~= "" and name or "unknown view")
local viewdict = pdfdictionary {
- Type = pdfconstant("3DView"),
- XN = name,
- IN = name,
+ Type = pdfconstant("3DView"),
+ XN = name,
+ IN = name,
+ NR = true,
}
local bg = checkedkey(view,"bg","table")
@@ -312,25 +316,21 @@ local function make3dview(view)
local node = checkedkey(nodes,i,"table")
if node then
local position = checkedkey(node,"position","table")
- position = position and #position == 12 and pdfarray(position)
- if position then
- nodelist[#nodelist+1] = pdfdictionary {
- Type = pdfconstant("3DNode"),
- N = node.name or ("node_" .. i), -- pdfunicode ?
- V = node.visible or true,
- O = node.opacity or 0,
- RM = pdfdictionary {
- Type = pdfconstant("3DRenderMode"),
- Subtype = pdfconstant(node.rendermode or "Solid"),
- },
- M = position,
- }
- end
+ nodelist[#nodelist+1] = pdfdictionary {
+ Type = pdfconstant("3DNode"),
+ N = node.name or ("node_" .. i), -- pdfunicode ?
+ M = position and #position == 12 and pdfarray(position),
+ V = node.visible or true,
+ O = node.opacity or 0,
+ RM = pdfdictionary {
+ Type = pdfconstant("3DRenderMode"),
+ Subtype = pdfconstant(node.rendermode or "Solid"),
+ },
+ }
end
end
- viewdict.NR = true
viewdict.NA = nodelist
- end
+ end
return viewdict
@@ -349,14 +349,24 @@ function backends.pdf.helpers.insert3d(spec) -- width, height, factor, display,
local activationdict = pdfdictionary {
TB = pdfboolean(param.toolbar,true),
- NP = pdfboolean(param.tree,true),
+ NP = pdfboolean(param.tree,false),
}
local stream = streams[label]
if not stream then
+
+ local subtype, subdata = "U3D", io.loaddata(foundname) or ""
+ if find(subdata,"^PRC") then
+ subtype = "PRC"
+ elseif find(subdata,"^U3D") then
+ subtype = "U3D"
+ elseif file.extname(foundname) == "prc" then
+ subtype = "PRC"
+ end
+
local attr = pdfdictionary {
Type = pdfconstant("3D"),
- Subtype = pdfconstant("U3D"),
+ Subtype = pdfconstant(subtype),
}
local streamviews = checkedkey(streamparam, "views", "table")
if streamviews then
@@ -378,12 +388,12 @@ function backends.pdf.helpers.insert3d(spec) -- width, height, factor, display,
if js then
local jsref = stored_js[js]
if not jsref then
- jsref = pdf.immediateobj("streamfile",js)
+ jsref = pdfimmediateobj("streamfile",js)
stored_js[js] = jsref
end
attr.OnInstantiate = pdfreference(jsref)
end
- stored_3d[label] = pdf.immediateobj("streamfile",foundname,attr())
+ stored_3d[label] = pdfimmediateobj("streamfile",foundname,attr())
stream = 1
else
stream = stream + 1
@@ -412,13 +422,50 @@ function backends.pdf.helpers.insert3d(spec) -- width, height, factor, display,
local tag = format("%s:%s:%s",label,stream,preview)
local ref = stored_pr[tag]
if not ref then
- -- weird, has to be a /Form and not an /Image so we need a wrap = true key
- -- local figure = img.immediatewrite { filename = preview, width = width, height = height }
- local figure = img.immediatewrite { stream = ".5 .75 .75 rg 0 0 20 10 re f", bbox = {0,0,20,10 } }
+ local figure = img.immediatewrite {
+ filename = preview,
+ width = width,
+ height = height
+ }
+ -- local figure = img.immediatewrite {
+ -- stream = ".5 .75 .75 rg 0 0 20 10 re f",
+ -- bbox = { 0, 0, 20, 10 }
+ -- }
ref = figure.objnum
stored_pr[tag] = ref
end
- annot.AP = ref and pdfdictionary { N = pdfreference(ref) }
+ if ref then
+ local zero, one = pdfnumber(0), pdfnumber(1) -- not really needed
+ local pw = pdfdictionary {
+ Type = pdfconstant("XObject"),
+ Subtype = pdfconstant("Form"),
+ FormType = one,
+ BBox = pdfarray { zero, zero, pdfnumber(factor*width), pdfnumber(factor*height) },
+ Matrix = pdfarray { one, zero, zero, one, zero, zero },
+ Resources = pdfdictionary {
+ XObject = pdfdictionary {
+ IM = pdfreference(ref)
+ }
+ },
+ ExtGState = pdfdictionary {
+ GS = pdfdictionary {
+ Type = pdfconstant("ExtGState"),
+ CA = one,
+ ca = one,
+ }
+ },
+ ProcSet = pdfarray { pdfconstant("PDF"), pdfconstant("ImageC") },
+ }
+ local pwd = pdfimmediateobj(
+ "stream",
+ format("q /GS gs %s 0 0 %s 0 0 cm /IM Do Q",
+ factor*width,factor*height),
+ pw()
+ )
+ annot.AP = pdfdictionary {
+ N = pdfreference(pwd)
+ }
+ end
return annot, figure, ref
else
activationdict.A = pdfconstant("PV")
diff --git a/Master/texmf-dist/tex/context/base/lpdf-wid.lua b/Master/texmf-dist/tex/context/base/lpdf-wid.lua
index c87192b3acd..40a81e7d4d9 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-wid.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-wid.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['lpdf-wid'] = {
version = 1.001,
- comment = "companion to lpdf-ini.tex",
+ 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"
@@ -16,16 +16,23 @@ local registrations = backends.pdf.registrations
local executers = jobreferences.executers
local variables = interfaces.variables
-local pdfconstant = lpdf.constant
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfreference = lpdf.reference
-local pdfunicode = lpdf.unicode
-local pdfcolorspec = lpdf.colorspec
+local pdfconstant = lpdf.constant
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfunicode = lpdf.unicode
+local pdfstring = lpdf.string
+local pdfcolorspec = lpdf.colorspec
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
local pdfreserveobj = pdf.reserveobj
local pdfimmediateobj = pdf.immediateobj
+local pdfannotation = nodes.pdfannotation
+
+local hpack_node, write_node = node.hpack, node.write
+
-- symbols
local presets = { } -- xforms
@@ -38,12 +45,16 @@ function codeinjections.registeredsymbol(name)
return presets[name]
end
+function codeinjections.presetsymbol(symbol)
+ if not presets[symbol] then
+ texsprint(ctxcatcodes,format("\\predefinesymbol[%s]",symbol))
+ end
+end
+
function codeinjections.presetsymbollist(list)
if list then
- for s in gmatch(list,"[^, ]+") do
- if not presets[s] then
- texsprint(ctxcatcodes,format("\\predefinesymbol[%s]",s))
- end
+ for symbol in gmatch(list,"[^, ]+") do
+ codeinjections.presetsymbol(symbol)
end
end
end
@@ -117,17 +128,17 @@ function codeinjections.registercomment(specification)
}
-- watch the nice feed back to tex hack
if usepopupcomments then
- local nd = pdfreserveobj()
- local nc = pdfreserveobj()
+ local nd = pdfreserveobject()
+ local nc = pdfreserveobject()
local c = pdfdictionary {
Subtype = pdfconstant("Popup"),
Parent = pdfreference(nd),
}
d.Popup = pdfreference(nc)
- texbox["commentboxone"] = node.hpack(nodes.pdfannot(0,0,0,d(),nd))
- texbox["commentboxtwo"] = node.hpack(nodes.pdfannot(specification.width,specification.height,0,c(),nc))
+ texbox["commentboxone"] = hpack_node(pdfannotation(0,0,0,d(),nd)) -- current dir
+ texbox["commentboxtwo"] = hpack_node(pdfannotation(specification.width,specification.height,0,c(),nc)) -- current dir
else
- texbox["commentboxone"] = node.hpack(nodes.pdfannot(0,0,0,d()))
+ texbox["commentboxone"] = hpack_node(pdfannotation(0,0,0,d())) -- current dir
texbox["commentboxtwo"] = nil
end
end
@@ -136,6 +147,32 @@ end
local nofattachments, attachments, filestreams = 0, { }, { }
+function codeinjections.embedfile(filename)
+ local r = filestreams[filename]
+ if r == false then
+ return nil
+ elseif r then
+ return r
+ elseif not lfs.isfile(filename) then
+ interfaces.showmessage("interactions",5,filename)
+ filestreams[filename] = false
+ return nil
+ else
+ local basename = file.basename(filename)
+ local a = pdfdictionary { Type = pdfconstant("EmbeddedFile") }
+ local f = pdfimmediateobj("streamfile",filename,a())
+ local d = pdfdictionary {
+ Type = pdfconstant("Filespec"),
+ F = pdfstring(newname or basename),
+ UF = pdfstring(newname or basename),
+ EF = pdfdictionary { F = pdfreference(f) },
+ }
+ local r = pdfreference(pdfflushobject(d))
+ filestreams[filename] = r
+ return r
+ end
+end
+
function codeinjections.attachfile(specification)
local attachment = interactions.attachment(specification.label)
if not attachment then
@@ -156,20 +193,8 @@ function codeinjections.attachfile(specification)
if newname == "" then newname = filename end
local aref = attachments[label]
if not aref then
- if not lfs.isfile(filename) then
- interfaces.showmessage("interactions",5,filename)
- return -- todo: message
- else
- local f = pdf.immediateobj("streamfile",filename)
- filestreams[filename] = f
- local d = pdfdictionary {
- Type = pdfconstant("Filespec"),
- F = newname,
- EF = pdfdictionary { F = pdfreference(d) },
- }
- aref = pdfreference(pdfimmediateobj(tostring(d)))
- attachments[label] = aref
- end
+ aref = codeinjections.embedfile(filename,newname)
+ attachments[label] = aref
end
local name, appearance = analyzesymbol(specification.symbol)
local d = pdfdictionary {
@@ -181,10 +206,12 @@ function codeinjections.attachfile(specification)
OC = analyzelayer(specification.layer),
C = pdfcolorspec(specification.colormodel,specification.colorvalue),
}
+ -- as soon as we can ask for the dimensions of an xform we can
+ -- use them here
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- node.write(nodes.pdfannot(width,height,depth,d()))
+ write_node(pdfannotation(width,height,depth,d()))
end
function codeinjections.attachmentid(filename)
@@ -241,7 +268,7 @@ local function insertrenderingwindow(label,width,height,specification)
AA = actions,
}
local r = pdfreserveobj("annot")
- node.write(nodes.pdfannot(width,height,0,d(),r)) -- save ref
+ write_node(pdfannotation(width,height,0,d(),r)) -- save ref
return pdfreference(r)
end
@@ -268,7 +295,7 @@ local function insertrendering(specification)
}
}
}
- mf[label] = pdfreference(pdfimmediateobj(tostring(d)))
+ mf[label] = pdfreference(pdfflushobject(d))
if not ms[label] then
mu[label] = insertrenderingwindow(label,0,0,specification.options)
end
@@ -288,7 +315,7 @@ local function insertrenderingobject(specification)
D = pdfreference(unknown), -- not label but objectname, hm
}
}
- mf[label] = pdfreference(pdfimmediateobj(tostring(d)))
+ mf[label] = pdfreference(pdfflushobject(d))
if ms[label] then
insertrenderingwindow(label,0,0,specification)
end
diff --git a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua
new file mode 100644
index 00000000000..c8e7b2b5733
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua
@@ -0,0 +1,165 @@
+if not modules then modules = { } end modules ['lpdf-xmp'] = {
+ 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",
+ comment = "with help from Peter Rolf",
+}
+
+local format, random, char, gsub, concat = string.format, math.random, string.char, string.gsub, table.concat
+local xmlfillin = xml.fillin
+
+local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end)
+
+local pdfdictionary = lpdf.dictionary
+local pdfconstant = lpdf.constant
+
+-- i wonder why this begin end is empty / w (no time now to look into it)
+
+local xpacket = [[
+<?xpacket begin="" id="%s"?>
+
+%s
+
+<?xpacket end="w"?>]]
+
+local mapping = {
+ -- user defined keys (pdfx:)
+ ["ConTeXt.Jobname"] = "rdf:Description/pdfx:ConTeXt.Jobname",
+ ["ConTeXt.Time"] = "rdf:Description/pdfx:ConTeXt.Time",
+ ["ConTeXt.Url"] = "rdf:Description/pdfx:ConTeXt.Url",
+ ["ConTeXt.Version"] = "rdf:Description/pdfx:ConTeXt.Version",
+ ["ID"] = "rdf:Description/pdfx:ID",
+ ["PTEX.Fullbanner"] = "rdf:Description/pdfx:PTEX.Fullbanner",
+ -- Adobe PDF schema
+ ["Keywords"] = "rdf:Description/pdf:Keywords",
+ ["Producer"] = "rdf:Description/pdf:Producer",
+ -- ["Trapped"] = "rdf:Description/pdf:Trapped", -- '/False' in /Info, but 'False' in XMP
+ -- Dublin Core schema
+ ["Author"] = "rdf:Description/dc:creator/rdf:Seq/rdf:li",
+ ["Format"] = "rdf:Description/dc:format", -- optional, but nice to have
+ ["Subject"] = "rdf:Description/dc:description",
+ ["Title"] = "rdf:Description/dc:title/rdf:Alt/rdf:li",
+ -- XMP Basic schema
+ ["CreateDate"] = "rdf:Description/xmp:CreateDate",
+ ["Creator"] = "rdf:Description/xmp:CreatorTool",
+ ["MetadataDate"] = "rdf:Description/xmp:MetadataDate",
+ ["ModifyDate"] = "rdf:Description/xmp:ModifyDate",
+ -- XMP Media Management schema
+ ["DocumentID"] = "rdf:Description/xmpMM:DocumentID",
+ ["InstanceID"] = "rdf:Description/xmpMM:InstanceID",
+ ["RenditionClass"] = "rdf:Description/xmpMM:RenditionClass", -- PDF/X-4
+ ["VersionID"] = "rdf:Description/xmpMM:VersionID", -- PDF/X-4
+ -- additional entries
+ -- PDF/X
+ ["GTS_PDFXVersion"] = "rdf:Description/pdfxid:GTS_PDFXVersion",
+ -- optional entries
+ -- all what is visible in the 'document properties --> additional metadata' window
+ -- XMP Rights Management schema (optional)
+ ["Marked"] = "rdf:Description/xmpRights:Marked",
+ -- ["Owner"] = "rdf:Description/xmpRights:Owner/rdf:Bag/rdf:li", -- maybe useful (not visible)
+ -- ["UsageTerms"] = "rdf:Description/xmpRights:UsageTerms", -- maybe useful (not visible)
+ ["WebStatement"] = "rdf:Description/xmpRights:WebStatement",
+ -- Photoshop PDF schema (optional)
+ ["AuthorsPosition"] = "rdf:Description/photoshop:AuthorsPosition",
+ ["Copyright"] = "rdf:Description/photoshop:Copyright",
+ ["CaptionWriter"] = "rdf:Description/photoshop:CaptionWriter",
+}
+
+-- maybe some day we will load the xmp file at runtime
+
+local xmp, xmpfile, xmpname = nil, nil, "lpdf-xmp.xml"
+
+function lpdf.setxmpfile(name)
+ xmpfile = resolvers.findctxfile(name) or ""
+ if xmpfile == "" then
+ xmpfile = nil
+ end
+end
+
+local function valid_xmp()
+ if not xmp then
+ local xmpfile = xmpfile or resolvers.find_file(xmpname) or ""
+ local xmpdata = (xmpfile ~= "" and io.loaddata(xmpfile)) or ""
+ xmp = xml.convert(xmpdata)
+ end
+ return xmp
+end
+
+function lpdf.addxmpinfo(tag,value,check)
+ local pattern = mapping[tag]
+ if pattern then
+ xmlfillin(xmp or valid_xmp(),pattern,value,check)
+ end
+end
+
+-- redefined
+
+local addtoinfo = lpdf.addtoinfo
+local addxmpinfo = lpdf.addxmpinfo
+
+function lpdf.addtoinfo(tag,pdfvalue,strvalue)
+ addtoinfo(tag,pdfvalue)
+ addxmpinfo(tag,strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1")) -- hack
+end
+
+-- for the do-it-yourselvers
+
+function lpdf.insertxmpinfo(pattern,whatever,prepend)
+ xml.insert(xmp or valid_xmp(),pattern,whatever,prepend)
+end
+
+function lpdf.injectxmpinfo(pattern,whatever,prepend)
+ xml.inject(xmp or valid_xmp(),pattern,whatever,prepend)
+end
+
+-- flushing
+
+local t = { } for i=1,24 do t[i] = random() end
+
+local function flushxmpinfo()
+
+ commands.freezerandomseed(os.clock()) -- hack
+
+ local t = { } for i=1,24 do t[i] = char(96 + random(26)) end
+ local packetid = concat(t)
+ local time = lpdf.timestamp()
+ addxmpinfo("Producer",format("LuaTeX-%0.2f.%s",tex.luatexversion/100,tex.luatexrevision))
+ addxmpinfo("DocumentID",format("uuid:%s",os.uuid()))
+ addxmpinfo("InstanceID",format("uuid:%s",os.uuid()))
+ addxmpinfo("CreatorTool","LuaTeX + ConTeXt MkIV")
+ addxmpinfo("CreateDate",time)
+ addxmpinfo("ModifyDate",time)
+ addxmpinfo("MetadataDate",time)
+ addxmpinfo("PTEX.Fullbanner", tex.pdftexbanner)
+ local blob = xml.tostring(xml.first(xmp or valid_xmp(),"/x:xmpmeta"))
+ local md = pdfdictionary {
+ Subtype = pdfconstant("XML"),
+ Type = pdfconstant("Metadata"),
+ }
+ if trace_xmp then
+ commands.writestatus("system","xmp data flushed (see log file)")
+ texio.write_nl("log","")
+ texio.write("log","\n% ",(gsub(blob,"[\r\n]","\n%% ")),"\n")
+ end
+ blob = format(xpacket,packetid,blob)
+ if tex.pdfcompresslevel > 0 then
+ blob = gsub(blob,">%s+<","><")
+ end
+ local r = pdf.obj {
+ immediate = true,
+ compresslevel = 0,
+ type = "stream",
+ string = blob,
+ attr = md(),
+ }
+ lpdf.addtocatalog("Metadata",lpdf.reference(r))
+
+ commands.defrostrandomseed() -- hack
+
+end
+
+-- his will be enabled when we can inhibit compression for a stream at the lua end
+
+lpdf.registerdocumentfinalizer(flushxmpinfo,1)
diff --git a/Master/texmf-dist/tex/context/base/lpdf-xmp.xml b/Master/texmf-dist/tex/context/base/lpdf-xmp.xml
new file mode 100644
index 00000000000..2947211bd8e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lpdf-xmp.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04">
+ <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/>
+ </rdf:Seq>
+ </dc:creator>
+ <dc:description/>
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default"/>
+ </rdf:Alt>
+ </dc:title>
+ </rdf:Description>
+ <rdf:Description rdf:about="" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/">
+ <pdfx:ConTeXt.Jobname/>
+ <pdfx:ConTeXt.Time/>
+ <pdfx:ConTeXt.Url/>
+ <pdfx:ConTeXt.Version/>
+ <pdfx:ID/>
+ <pdfx:PTEX.Fullbanner/>
+ </rdf:Description>
+ <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:CreateDate/>
+ <xmp:CreatorTool/>
+ <xmp:ModifyDate/>
+ <xmp:MetadataDate/>
+ </rdf:Description>
+ <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
+ <pdf:Keywords/>
+ <pdf:Producer/>
+ <pdf:Trapped>False</pdf:Trapped>
+ </rdf:Description>
+ <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
+ <xmpMM:DocumentID/>
+ <xmpMM:InstanceID/>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
diff --git a/Master/texmf-dist/tex/context/base/luat-cbk.lua b/Master/texmf-dist/tex/context/base/luat-cbk.lua
index d8b508c13d6..3cb63ad6ec5 100644
--- a/Master/texmf-dist/tex/context/base/luat-cbk.lua
+++ b/Master/texmf-dist/tex/context/base/luat-cbk.lua
@@ -1,11 +1,15 @@
if not modules then modules = { } end modules ['luat-cbk'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 insert, remove, find = table.insert, table.remove, string.find
+local collectgarbage, type, next = collectgarbage, type, next
+local round = math.round
+
local trace_checking = false trackers.register("memory.checking", function(v) trace_checking = v end)
--[[ldx--
@@ -14,8 +18,7 @@ your own code into the <l n='tex'/> engine. Here we implement a few handy
auxiliary functions.</p>
--ldx]]--
-callbacks = { }
-callbacks.stack = { }
+callbacks = callbacks or { }
--[[ldx--
<p>When you (temporarily) want to install a callback function, and after a
@@ -23,20 +26,124 @@ while wants to revert to the original one, you can use the following two
functions.</p>
--ldx]]--
+local trace_callbacks = false trackers.register("system.callbacks", function(v) trace_callbacks = v end)
+
+local register_callback, find_callback = callback.register, callback.find
+local frozen, stack = { }, { }
+
+callback.original_register_callback = register_callback
+
+local function frozen_message(what,name)
+ logs.report("callbacks","not %s frozen '%s' (%s)",what,name,frozen[name])
+end
+
+local function frozen_callback(name)
+ return nil, format("callback '%s' is frozen (%s)",name,frozen[name])
+end
+
+local function state(name)
+ local f = find_callback(name)
+ if f == false then
+ return "disabled"
+ elseif f then
+ return "enabled"
+ else
+ return "undefined"
+ end
+end
+
+function callbacks.report()
+ local list = callback.list()
+ for name, func in table.sortedhash(list) do
+ local str = frozen[name]
+ if str then
+ logs.report("callbacks","%s: %s -> %s",state(name),name,str)
+ else
+ logs.report("callbacks","%s: %s",state(name),name)
+ end
+ end
+end
+
+function callbacks.table()
+ local NC, NR, verbatim = context.NC, context.NR, context.type
+ context.starttabulate { "|l|l|p|" }
+ for name, func in table.sortedhash(callback.list()) do
+ NC() verbatim(name) NC() verbatim(state(name)) NC() context(frozen[name] or "") NC() NR()
+ end
+ context.stoptabulate()
+end
+
+function callbacks.freeze(name,freeze)
+ freeze = type(freeze) == "string" and freeze
+--~ print(name)
+ if find(name,"%*") then
+ local pattern = name -- string.simpleesc(name)
+ local list = callback.list()
+ for name, func in next, list do
+ if find(name,pattern) then
+ frozen[name] = freeze or frozen[name] or "frozen"
+ end
+ end
+ else
+ frozen[name] = freeze or frozen[name] or "frozen"
+ end
+end
+
+function callbacks.register(name,func,freeze)
+ if frozen[name] then
+ if trace_callbacks then
+ frozen_message("registering",name)
+ end
+ return frozen_callback(name)
+ elseif freeze then
+ frozen[name] = (type(freeze) == "string" and freeze) or "registered"
+ end
+ return register_callback(name,func)
+end
+
+function callback.register(name,func) -- original
+ if not frozen[name] then
+ return register_callback(name,func)
+ elseif trace_callbacks then
+ frozen_message("registering",name)
+ end
+ return frozen_callback(name)
+end
+
function callbacks.push(name, func)
- if not callbacks.stack[name] then
- callbacks.stack[name] = { }
+ if not frozen[name] then
+ local sn = stack[name]
+ if not sn then
+ sn = { }
+ stack[name] = sn
+ end
+ insert(sn,find_callback(name))
+ register_callback(name, func)
+ elseif trace_callbacks then
+ frozen_message("pushing",name)
end
- table.insert(callbacks.stack[name],callback.find(name))
- callback.register(name, func)
end
function callbacks.pop(name)
--- this fails: callback.register(name, table.remove(callbacks.stack[name]))
- local func = table.remove(callbacks.stack[name])
- callback.register(name, func)
+ if not frozen[name] then
+ local sn = stack[name]
+ if not sn or #sn == 0 then
+ -- some error
+ register_callback(name, nil) -- ! really needed
+ else
+ -- this fails: register_callback(name, remove(stack[name]))
+ local func = remove(sn)
+ register_callback(name, func)
+ end
+ end
end
+--~ -- somehow crashes later on
+--~
+--~ callbacks.freeze("find_.*_file","finding file")
+--~ callbacks.freeze("read_.*_file","reading file")
+--~ callbacks.freeze("open_.*_file","opening file")
+
--[[ldx--
<p>The simple case is to remove the callback:</p>
@@ -128,7 +235,6 @@ function garbagecollector.check(size,criterium)
criterium = criterium or garbagecollector.criterium
if not size or (criterium and criterium > 0 and size > criterium) then
if trace_checking then
- local round = math.round or math.floor
local b = collectgarbage("count")
collectgarbage("collect")
local a = collectgarbage("count")
diff --git a/Master/texmf-dist/tex/context/base/luat-cnf.lua b/Master/texmf-dist/tex/context/base/luat-cnf.lua
index 4cfc7278e91..e45aceb79f4 100644
--- a/Master/texmf-dist/tex/context/base/luat-cnf.lua
+++ b/Master/texmf-dist/tex/context/base/luat-cnf.lua
@@ -1,12 +1,12 @@
if not modules then modules = { } end modules ['luat-cnf'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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, concat = string.format, table.concat
+local format, concat, find = string.format, table.concat, string.find
luatex = luatex or { }
@@ -26,7 +26,7 @@ function luatex.variables()
local t, x = { }, nil
for _,v in next, luatex.variablenames do
x = resolvers.var_value(v)
- if x and x:find("^%d+$") then
+ if x and find(x,"^%d+$") then
t[v] = tonumber(x)
end
end
@@ -43,18 +43,18 @@ end
local stub = [[
-- checking
-storage = storage or {}
-luatex = luatex or {}
-
--- as soon as possible
-
-luatex.starttime = os.gettimeofday()
+storage = storage or { }
+luatex = luatex or { }
-- we provide our own file handling
texconfig.kpse_init = false
texconfig.shell_escape = 't'
+-- as soon as possible
+
+luatex.starttime = os.gettimeofday()
+
-- this will happen after the format is loaded
function texconfig.init()
diff --git a/Master/texmf-dist/tex/context/base/luat-cod.mkiv b/Master/texmf-dist/tex/context/base/luat-cod.mkiv
index 001cc2aa9c6..d3b37d0e145 100644
--- a/Master/texmf-dist/tex/context/base/luat-cod.mkiv
+++ b/Master/texmf-dist/tex/context/base/luat-cod.mkiv
@@ -146,7 +146,7 @@
{\ctxlua{environment.loadluafile("#1")}}
{\ctxlua{environment.loadluafile("#1",#2)}}}
-\def\registerctxluafile#1#2% name version
+\def\registerctxluafile#1#2% name version (modules and core code)
{\ifproductionrun
\ctxloadluafile{#1}{#2}%
\else
diff --git a/Master/texmf-dist/tex/context/base/luat-dum.lua b/Master/texmf-dist/tex/context/base/luat-dum.lua
index 699a0feefa6..4530c2ef34e 100644
--- a/Master/texmf-dist/tex/context/base/luat-dum.lua
+++ b/Master/texmf-dist/tex/context/base/luat-dum.lua
@@ -13,11 +13,21 @@ statistics = {
starttiming = dummyfunction,
stoptiming = dummyfunction,
}
+directives = {
+ register = dummyfunction,
+ enable = dummyfunction,
+ disable = dummyfunction,
+}
trackers = {
register = dummyfunction,
enable = dummyfunction,
disable = dummyfunction,
}
+experiments = {
+ register = dummyfunction,
+ enable = dummyfunction,
+ disable = dummyfunction,
+}
storage = {
register = dummyfunction,
shared = { },
@@ -32,6 +42,9 @@ tasks = {
appendaction = dummyfunction,
prependaction = dummyfunction,
}
+callbacks = {
+ register = function(n,f) return callback.register(n,f) end,
+}
-- we need to cheat a bit here
@@ -44,13 +57,14 @@ local remapper = {
ttf = "truetype fonts",
ttc = "truetype fonts",
dfont = "truetype dictionary",
- cid = "other text files", -- will become "cid files"
+ cid = "cid maps",
+ fea = "font feature files",
}
function resolvers.find_file(name,kind)
name = string.gsub(name,"\\","\/")
kind = string.lower(kind)
- return kpse.find_file(name,(kind and kind ~= "" and (remapper[kind] or kind)) or "tex")
+ return kpse.find_file(name,(kind and kind ~= "" and (remapper[kind] or kind)) or file.extname(name,"tex"))
end
function resolvers.findbinfile(name,kind)
@@ -59,3 +73,54 @@ function resolvers.findbinfile(name,kind)
end
return resolvers.find_file(name,(kind and remapper[kind]) or kind)
end
+
+-- Caches ... I will make a real stupid version some day when I'm in the
+-- mood. After all, the generic code does not need the more advanced
+-- ConTeXt features. Cached data is not shared between ConTeXt and other
+-- usage as I don't want any dependency at all. Also, ConTeXt might have
+-- different needs and tricks added.
+
+caches = { }
+
+--~ containers.usecache = true
+
+function caches.setpath(category,subcategory)
+ local root = kpse.var_value("TEXMFCACHE") or ""
+ if root == "" then
+ root = kpse.var_value("VARTEXMF") or ""
+ end
+ if root ~= "" then
+ root = file.join(root,category)
+ lfs.mkdir(root)
+ root = file.join(root,subcategory)
+ lfs.mkdir(root)
+ return lfs.isdir(root) and root
+ end
+end
+
+local function makefullname(path,name)
+ if path and path ~= "" then
+ name = "temp-" and name -- clash prevention
+ return file.addsuffix(file.join(path,name),"lua")
+ end
+end
+
+function caches.iswritable(path,name)
+ local fullname = makefullname(path,name)
+ return fullname and file.iswritable(fullname)
+end
+
+function caches.loaddata(path,name)
+ local fullname = makefullname(path,name)
+ if fullname then
+ local data = loadfile(fullname)
+ return data and data()
+ end
+end
+
+function caches.savedata(path,name,data)
+ local fullname = makefullname(path,name)
+ if fullname then
+ table.tofile(fullname,data,'return',false,true,false)
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/luat-env.lua b/Master/texmf-dist/tex/context/base/luat-env.lua
index 9c05b249ca1..0e21fca31e9 100644
--- a/Master/texmf-dist/tex/context/base/luat-env.lua
+++ b/Master/texmf-dist/tex/context/base/luat-env.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-env'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -12,10 +12,10 @@ if not modules then modules = { } end modules ['luat-env'] = {
-- evolved before bytecode arrays were available and so a lot of
-- code has disappeared already.
-local trace_verbose = false trackers.register("resolvers.verbose", function(v) trace_verbose = v end)
-local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v trackers.enable("resolvers.verbose") end)
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
-local format = string.format
+local format, sub, match, gsub, find = string.format, string.sub, string.match, string.gsub, string.find
+local unquote, quote = string.unquote, string.quote
-- precautions
@@ -49,13 +49,14 @@ if not environment.jobname then environ
function environment.initialize_arguments(arg)
local arguments, files = { }, { }
environment.arguments, environment.files, environment.sortedflags = arguments, files, nil
- for index, argument in pairs(arg) do
+ for index=1,#arg do
+ local argument = arg[index]
if index > 0 then
- local flag, value = argument:match("^%-+(.+)=(.-)$")
+ local flag, value = match(argument,"^%-+(.-)=(.-)$")
if flag then
- arguments[flag] = string.unquote(value or "")
+ arguments[flag] = unquote(value or "")
else
- flag = argument:match("^%-+(.+)")
+ flag = match(argument,"^%-+(.+)")
if flag then
arguments[flag] = true
else
@@ -82,25 +83,30 @@ function environment.argument(name,partial)
return arguments[name]
elseif partial then
if not sortedflags then
- sortedflags = { }
- for _,v in pairs(table.sortedkeys(arguments)) do
- sortedflags[#sortedflags+1] = "^" .. v
+ sortedflags = table.sortedkeys(arguments)
+ for k=1,#sortedflags do
+ sortedflags[k] = "^" .. sortedflags[k]
end
environment.sortedflags = sortedflags
end
-- example of potential clash: ^mode ^modefile
- for _,v in ipairs(sortedflags) do
- if name:find(v) then
- return arguments[v:sub(2,#v)]
+ for k=1,#sortedflags do
+ local v = sortedflags[k]
+ if find(name,v) then
+ return arguments[sub(v,2,#v)]
end
end
end
return nil
end
+environment.argument("x",true)
+
function environment.split_arguments(separator) -- rather special, cut-off before separator
local done, before, after = false, { }, { }
- for _,v in ipairs(environment.original_arguments) do
+ local original_arguments = environment.original_arguments
+ for k=1,#original_arguments do
+ local v = original_arguments[k]
if not done and v == separator then
done = true
elseif done then
@@ -117,16 +123,17 @@ function environment.reconstruct_commandline(arg,noquote)
if noquote and #arg == 1 then
local a = arg[1]
a = resolvers.resolve(a)
- a = a:unquote()
+ a = unquote(a)
return a
- elseif next(arg) then
+ elseif #arg > 0 then
local result = { }
- for _,a in ipairs(arg) do -- ipairs 1 .. #n
+ for i=1,#arg do
+ local a = arg[i]
a = resolvers.resolve(a)
- a = a:unquote()
- a = a:gsub('"','\\"') -- tricky
- if a:find(" ") then
- result[#result+1] = a:quote()
+ a = unquote(a)
+ a = gsub(a,'"','\\"') -- tricky
+ if find(a," ") then
+ result[#result+1] = quote(a)
else
result[#result+1] = a
end
@@ -139,17 +146,18 @@ end
if arg then
- -- new, reconstruct quoted snippets (maybe better just remnove the " then and add them later)
+ -- new, reconstruct quoted snippets (maybe better just remove the " then and add them later)
local newarg, instring = { }, false
- for index, argument in ipairs(arg) do
- if argument:find("^\"") then
- newarg[#newarg+1] = argument:gsub("^\"","")
- if not argument:find("\"$") then
+ for index=1,#arg do
+ local argument = arg[index]
+ if find(argument,"^\"") then
+ newarg[#newarg+1] = gsub(argument,"^\"","")
+ if not find(argument,"\"$") then
instring = true
end
- elseif argument:find("\"$") then
- newarg[#newarg] = newarg[#newarg] .. " " .. argument:gsub("\"$","")
+ elseif find(argument,"\"$") then
+ newarg[#newarg] = newarg[#newarg] .. " " .. gsub(argument,"\"$","")
instring = false
elseif instring then
newarg[#newarg] = newarg[#newarg] .. " " .. argument
@@ -204,12 +212,12 @@ function environment.luafilechunk(filename) -- used for loading lua bytecode in
filename = file.replacesuffix(filename, "lua")
local fullname = environment.luafile(filename)
if fullname and fullname ~= "" then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","loading file %s", fullname)
end
return environment.loadedluacode(fullname)
else
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","unknown file %s", filename)
end
return nil
@@ -229,7 +237,7 @@ function environment.loadluafile(filename, version)
-- when not overloaded by explicit suffix we look for a luc file first
local fullname = (lucname and environment.luafile(lucname)) or ""
if fullname ~= "" then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","loading %s", fullname)
end
chunk = loadfile(fullname) -- this way we don't need a file exists check
@@ -247,7 +255,7 @@ function environment.loadluafile(filename, version)
if v == version then
return true
else
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","version mismatch for %s: lua=%s, luc=%s", filename, v, version)
end
environment.loadluafile(filename)
@@ -258,12 +266,12 @@ function environment.loadluafile(filename, version)
end
fullname = (luaname and environment.luafile(luaname)) or ""
if fullname ~= "" then
- if trace_verbose then
+ if trace_locating then
logs.report("fileio","loading %s", fullname)
end
chunk = loadfile(fullname) -- this way we don't need a file exists check
if not chunk then
- if verbose then
+ if trace_locating then
logs.report("fileio","unknown file %s", filename)
end
else
diff --git a/Master/texmf-dist/tex/context/base/luat-exe.lua b/Master/texmf-dist/tex/context/base/luat-exe.lua
index fd93ad3829b..ca3b751623b 100644
--- a/Master/texmf-dist/tex/context/base/luat-exe.lua
+++ b/Master/texmf-dist/tex/context/base/luat-exe.lua
@@ -1,11 +1,14 @@
if not modules then modules = { } end modules ['luat-exe'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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 match, find = string.match, string.find
+local concat = table.concat
+
if not executer then executer = { } end
executer.permitted = { }
@@ -13,7 +16,9 @@ executer.execute = os.execute
function executer.register(...)
local ep = executer.permitted
- for k,v in pairs({...}) do
+ local t = { ... }
+ for k=1,#t do
+ local v = t[k]
ep[#ep+1] = (v == "*" and ".*") or v
end
end
@@ -24,18 +29,20 @@ function executer.finalize() -- todo: os.exec, todo: report ipv print
local t, name, arguments = {...}, "", ""
if #t == 1 then
if type(t[1]) == 'table' then
- name, arguments = t[1], table.concat(t," ",2,#t)
+ name, arguments = t[1], concat(t," ",2,#t)
else
- name, arguments = t[1]:match("^(.-)%s+(.+)$")
+ name, arguments = match(t[1],"^(.-)%s+(.+)$")
if not (name and arguments) then
name, arguments = t[1], ""
end
end
else
- name, arguments = t[1], table.concat(t," ",2,#t)
+ name, arguments = t[1], concat(t," ",2,#t)
end
- for _,v in pairs(executer.permitted) do
- if name:find(v) then
+ local permitted = executer.permitted
+ for k=1,#permitted do
+ local v = permitted[k]
+ if find(name,v) then
execute(name .. " " .. arguments)
-- print("executed: " .. name .. " " .. arguments)
else
diff --git a/Master/texmf-dist/tex/context/base/luat-fio.lua b/Master/texmf-dist/tex/context/base/luat-fio.lua
index d8a9a27bf75..0d1bd18087b 100644
--- a/Master/texmf-dist/tex/context/base/luat-fio.lua
+++ b/Master/texmf-dist/tex/context/base/luat-fio.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-fio'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -42,7 +42,7 @@ if not resolvers.instance then
callback.register('find_map_file' , function(name) return resolvers.findbinfile(name,"map") end)
callback.register('find_ocp_file' , function(name) return resolvers.findbinfile(name,"ocp") end)
callback.register('find_opentype_file' , function(name) return resolvers.findbinfile(name,"otf") end)
- callback.register('find_output_file' , function(name) return name end)
+ callback.register('find_output_file' , function(name) return name end)
callback.register('find_pk_file' , function(name) return resolvers.findbinfile(name,"pk") end)
callback.register('find_sfd_file' , function(name) return resolvers.findbinfile(name,"sfd") end)
callback.register('find_truetype_file' , function(name) return resolvers.findbinfile(name,"ttf") end)
@@ -57,7 +57,7 @@ if not resolvers.instance then
callback.register('read_map_file' , function(file) return resolvers.loadbinfile(file,"map") end)
callback.register('read_ocp_file' , function(file) return resolvers.loadbinfile(file,"ocp") end)
-- output
- callback.register('read_pk_file' , function(file) return resolvers.loadbinfile(file,"pk") end)
+ callback.register('read_pk_file' , function(file) return resolvers.loadbinfile(file,"pk") end) -- 600dpi/manfnt.720pk
callback.register('read_sfd_file' , function(file) return resolvers.loadbinfile(file,"sfd") end)
callback.register('read_vf_file' , function(file) return resolvers.loadbinfile(file,"vf" ) end)
diff --git a/Master/texmf-dist/tex/context/base/luat-ini.lua b/Master/texmf-dist/tex/context/base/luat-ini.lua
index 34b59d7e8d5..e6a715c07fa 100644
--- a/Master/texmf-dist/tex/context/base/luat-ini.lua
+++ b/Master/texmf-dist/tex/context/base/luat-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-ini'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -44,8 +44,10 @@ just a lightweight suggestive system, not a watertight
one.</p>
--ldx]]--
+local debug = require "debug"
+
local string, table, lpeg, math, io, system = string, table, lpeg, math, io, system
-local next, setfenv = next, setfenv
+local next, setfenv = next, setfenv or debug.setfenv
local format = string.format
local global = _G
@@ -78,6 +80,10 @@ local protected = {
userdata, thirddata, moduledata = nil, nil, nil
+if not setfenv then
+ texio.write_nl("warning: we need to fix setfenv by using 'load in' or '_ENV'")
+end
+
function protect(name)
if name == "isolateddata" then
local t = { }
@@ -125,6 +131,8 @@ end
storage.register("lua/numbers", lua.numbers, "lua.numbers")
storage.register("lua/messages", lua.messages, "lua.messages")
+--~ local arguments, files = document.arguments, document.files -- set later
+
function document.setargument(key,value)
document.arguments[key] = value
end
@@ -145,6 +153,10 @@ function document.getargument(key,default)
tex.sprint(tex.ctxcatcodes,v or default or "")
end
+function document.setfilename(i,name)
+ document.files[tonumber(i)] = name
+end
+
function document.getfilename(i)
tex.sprint(tex.ctxcatcodes,document.files[i] or "")
end
diff --git a/Master/texmf-dist/tex/context/base/luat-ini.mkiv b/Master/texmf-dist/tex/context/base/luat-ini.mkiv
index 84214ea731b..c9d88bf4fcf 100644
--- a/Master/texmf-dist/tex/context/base/luat-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/luat-ini.mkiv
@@ -44,8 +44,8 @@
\long\def\dodostartluacode#1\stopluacode
{\normalexpanded{\endgroup\noexpand\directlua\zerocount{#1}}}
-\def\startlua {\dostartlua } % tex catcodes
-\def\startluacode{\dostartluacode} % lua catcodes
+\unexpanded\def\startlua {\dostartlua } % tex catcodes
+\unexpanded\def\startluacode{\dostartluacode} % lua catcodes
%D Some delayed definitions:
@@ -134,7 +134,7 @@
\obeyluatokens
\csname dodostartnamed#1\v!code\endcsname}
-\def\definenamedlua[#1]#2[#3]% no optional arg handling here yet
+\unexpanded\def\definenamedlua[#1]#2[#3]% no optional arg handling here yet
{\scratchcounter\ctxlua{lua.registername("#1","#3")}%
\normalexpanded{\long\edef\csname dodostartnamed#1\v!code\endcsname##1\csname\e!stop#1\v!code\endcsname}%
{\endgroup\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}%
@@ -190,12 +190,16 @@
\def\setdocumentfilename #1#2{\ctxlua{document.setfilename(#1,"#2")}}
\def\setdocumentargument #1#2{\ctxlua{document.setargument("#1","#2")}}
-\def\setdefaultdocumentargument#1#2{\ctxlua{document.getargument("#1","#2")}}
-\def\getdocumentfilename #1{\ctxlua{document.getfilename(#1)}}
-\def\getdocumentargument #1{\ctxlua{document.getargument(#1)}}
+\def\setdocumentargumentdefault#1#2{\ctxlua{document.setdefaultargument("#1","#2")}}
+\def\getdocumentfilename #1{\ctxlua{document.getfilename("#1")}}
+\def\getdocumentargument #1{\ctxlua{document.getargument("#1")}}
+\def\getdocumentargumentdefault#1#2{\ctxlua{document.getargument("#1","#2")}}
\def\doifdocumentargumentelse #1{\doifsomethingelse{\getdocumentargument{#1}}}
\def\doifdocumentargument #1{\doifsomething {\getdocumentargument{#1}}}
\def\doifnotdocumentargument #1{\doifnothing {\getdocumentargument{#1}}}
+\def\doifdocumentfilenameelse #1{\doifsomethingelse{\getdocumentfilename{#1}}}
+\def\doifdocumentfilename #1{\doifsomething {\getdocumentfilename{#1}}}
+\def\doifnotdocumentfilename #1{\doifnothing {\getdocumentfilename{#1}}}
\let\doifelsedocumentargument\doifdocumentargumentelse
@@ -205,7 +209,7 @@
%D Experimental:
-\def\startluaparameterset[#1]%
+\unexpanded\def\startluaparameterset[#1]%
{\begingroup
\obeylualines
\obeyluatokens
diff --git a/Master/texmf-dist/tex/context/base/luat-iop.lua b/Master/texmf-dist/tex/context/base/luat-iop.lua
index 883ec43cedb..e5722d2bd7f 100644
--- a/Master/texmf-dist/tex/context/base/luat-iop.lua
+++ b/Master/texmf-dist/tex/context/base/luat-iop.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-iop'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -11,65 +11,61 @@ if not modules then modules = { } end modules ['luat-iop'] = {
-- we can feed back specific patterns and paths into the next
-- mechanism
-if not io.inp then io.inp = { } end
-if not io.out then io.out = { } end
+local lower, find, sub = string.lower, string.find, string.sub
-io.inp.blocked = { }
-io.out.blocked = { }
-io.inp.permitted = { }
-io.out.permitted = { }
-io.inp.modes = { } -- functions
-io.out.modes = { } -- functions
+local ioinp = io.inp if not ioinp then ioinp = { } io.inp = ioinp end
+local ioout = io.out if not ioout then ioout = { } io.out = ioout end
-io.blocked_openers = { } -- *.open(name,method)
+ioinp.modes, ioout.modes = { }, { } -- functions
-function io.inp.inhibit (name) table.insert(io.inp.blocked, name) end
-function io.out.inhibit (name) table.insert(io.out.blocked, name) end
-function io.inp.permit (name) table.insert(io.inp.permitted, name) end
-function io.out.permit (name) table.insert(io.out.permitted, name) end
+local inp_blocked, inp_permitted = { }, { }
+local out_blocked, out_permitted = { }, { }
-function io.register_opener(func) table.insert(io.blocked_openers, func) end
+local function i_inhibit(name) inp_blocked [#inp_blocked +1] = name end
+local function o_inhibit(name) out_blocked [#out_blocked +1] = name end
+local function i_permit (name) inp_permitted[#inp_permitted+1] = name end
+local function o_permit (name) out_permitted[#out_permitted+1] = name end
-function io.finalize_openers(func)
- if (#io.out.blocked > 0) or (#io.inp.blocked > 0) then
- do
- local open = func
- local out_permitted = io.out.permitted
- local inp_permitted = io.inp.permitted
- local out_blocked = io.out.blocked
- local inp_blocked = io.inp.blocked
- return function(name,method)
- local function checked(blocked, permitted)
- local n = string.lower(name)
- for _,b in pairs(blocked) do
- if string.find(n,b) then
- for _,p in pairs(permitted) do
- if string.find(n,p) then
- return true
- end
- end
- return false
- end
- end
+ioinp.inhibit, ioinp.permit = i_inhibit, o_permit
+ioout.inhibit, ioout.permit = o_inhibit, o_permit
+
+local blocked_openers = { } -- *.open(name,method)
+
+function io.register_opener(func)
+ blocked_openers[#blocked_openers+1] = func
+end
+
+local function checked(name,blocked,permitted)
+ local n = lower(name)
+ for _,b in next, blocked do
+ if find(n,b) then
+ for _,p in next, permitted do
+ if find(n,p) then
return true
end
- if method and string.find(method,'[wa]') then
- if #out.blocked > 0 then
- if not checked(out_blocked, out_permitted) then
- -- print("writing to " .. name .. " is not permitted")
- return nil
- end
- end
- else
- if #inp.blocked > 0 then
- if not checked(inp_blocked, inp_permitted) then
- -- print("reading from " .. name .. " is not permitted")
- return nil
- end
- end
+ end
+ return false
+ end
+ end
+ return true
+end
+
+function io.finalize_openers(func)
+ if #out_blocked > 0 or #inp_blocked > 0 then
+ local open = func -- why not directly?
+ return function(name,method)
+ if method and find(method,'[wa]') then
+ if #out_blocked > 0 and not checked(name,out_blocked,out_permitted) then
+ -- print("writing to " .. name .. " is not permitted")
+ return nil
+ end
+ else
+ if #inp_blocked > 0 and not checked(name,inp_blocked,inp_permitted) then
+ -- print("reading from " .. name .. " is not permitted")
+ return nil
end
- return open(name,method)
end
+ return open(name,method)
end
else
return func
@@ -91,21 +87,13 @@ end
--~ f = io.open('c:/windows/crap.log') print(f)
--~ f = io.open('c:/windows/wmsetup.log') print(f)
-function io.set_opener_modes(i,o)
- for _,v in pairs({'inp','out'}) do
- if io[v][i] then
- io[v][i]()
- elseif io[v][string.sub(i,1,1)] then
- io[v][string.sub(i,1,1)]()
- end
- end
- io.open = io.finalize_openers(io.open)
-end
+local inpout = { 'inp', 'out' }
function io.set_opener_modes(i,o)
- local f
- for _,v in pairs({'inp','out'}) do
- f = io[v][i] or io[v][string.sub(i,1,1)]
+ local first = sub(i,1,1)
+ for k=1,#inpout do
+ local iov = io[inpout[k]]
+ local f = iov[i] or iov[first]
if f then f() end
end
io.open = io.finalize_openers(io.open)
@@ -113,43 +101,46 @@ end
-- restricted
-function io.inp.modes.restricted()
- io.inp.inhibit('^%.[%a]')
+function ioinp.modes.restricted()
+ i_inhibit('^%.[%a]')
end
-function io.out.modes.restricted()
- io.out.inhibit('^%.[%a]')
+
+function ioout.modes.restricted()
+ o_inhibit('^%.[%a]')
end
-- paranoid
-function io.inp.modes.paranoid()
- io.inp.inhibit('.*')
- io.inp.inhibit('%.%.')
- io.inp.permit('^%./')
- io.inp.permit('[^/]')
- resolvers.do_with_path('TEXMF',io.inp.permit)
+function ioinp.modes.paranoid()
+ i_inhibit('.*')
+ i_inhibit('%.%.')
+ i_permit('^%./')
+ i_permit('[^/]')
+ resolvers.do_with_path('TEXMF',i_permit)
end
-function io.out.modes.paranoid()
- io.out.inhibit('.*')
- resolvers.do_with_path('TEXMFOUTPUT',io.out.permit)
+
+function ioout.modes.paranoid()
+ o_inhibit('.*')
+ resolvers.do_with_path('TEXMFOUTPUT',o_permit)
end
-- handy
-function io.inp.modes.handy()
- io.inp.inhibit('%.%.')
- if os.platform == 'linux' then
- io.inp.inhibit('^/etc')
+function ioinp.modes.handy()
+ i_inhibit('%.%.')
+ if os.type == 'windows' then
+ i_inhibit('/windows/')
+ i_inhibit('/winnt/')
else
- io.inp.inhibit('/windows/')
- io.inp.inhibit('/winnt/')
+ i_inhibit('^/etc')
end
end
-function io.out.modes.handy()
- io.out.inhibit('.*')
- io.out.permit('%./')
- io.out.permit('^%./')
- io.out.permit('[^/]')
+
+function ioout.modes.handy()
+ o_inhibit('.*')
+ o_permit('%./')
+ o_permit('^%./')
+ o_permit('[^/]')
end
--~ io.set_opener_modes('p','p')
diff --git a/Master/texmf-dist/tex/context/base/luat-lib.mkiv b/Master/texmf-dist/tex/context/base/luat-lib.mkiv
index f8f71dd0a92..91ddec0aa62 100644
--- a/Master/texmf-dist/tex/context/base/luat-lib.mkiv
+++ b/Master/texmf-dist/tex/context/base/luat-lib.mkiv
@@ -27,7 +27,8 @@
\registerctxluafile{data-tex} {1.001}
\registerctxluafile{data-bin} {1.001}
\registerctxluafile{data-zip} {1.001}
-\registerctxluafile{data-crl} {1.001}
+%registerctxluafile{data-crl} {1.001}
+\registerctxluafile{data-sch} {1.001}
\registerctxluafile{data-tre} {1.001}
\registerctxluafile{data-lua} {1.001}
\registerctxluafile{data-ctx} {1.001}
@@ -42,7 +43,11 @@
\registerctxluafile{luat-ini} {1.001}
\registerctxluafile{luat-env} {1.001}
-\registerctxluafile{l-xml} {1.001} % we need to load lxml-tab earlier so this will change !
+\registerctxluafile{lxml-tab} {1.001}
+\registerctxluafile{lxml-lpt} {1.001}
+\registerctxluafile{lxml-xml} {1.001}
+\registerctxluafile{lxml-aux} {1.001}
+\registerctxluafile{lxml-mis} {1.001}
\startruntimeluacode
\edef\asciia{\ctxlua{tex.sprint(logs.mode)}}
diff --git a/Master/texmf-dist/tex/context/base/luat-lua.lua b/Master/texmf-dist/tex/context/base/luat-lua.lua
index 61be6e9d69e..b964bf8e80d 100644
--- a/Master/texmf-dist/tex/context/base/luat-lua.lua
+++ b/Master/texmf-dist/tex/context/base/luat-lua.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-lua'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -38,5 +38,6 @@ end end
--~ tex.sprint(string.format("more pi: %s %s %s\\par",...))
--~ end)
--~ tex.sprint(string.format("\\setbox0=\\hbox{%s}",math.pi*n))
---~ lua.flush(tex.wd[0],tex.ht[0],tex.dp[0])
+--~ local box = tex.box[0]
+--~ lua.flush(box.width,box.height,box.depth)
--~ end
diff --git a/Master/texmf-dist/tex/context/base/luat-run.lua b/Master/texmf-dist/tex/context/base/luat-run.lua
index 09fce32c1a1..b64a99fc6b8 100644
--- a/Master/texmf-dist/tex/context/base/luat-run.lua
+++ b/Master/texmf-dist/tex/context/base/luat-run.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-run'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -61,9 +61,14 @@ end
-- this can be done later
-callback.register('start_run', main.start)
-callback.register('stop_run' , main.stop)
-callback.register('report_output_pages', main.report_output_pages)
-callback.register('report_output_log' , main.report_output_log)
-callback.register('start_page_number' , main.start_shipout_page)
-callback.register('stop_page_number' , main.stop_shipout_page)
+callbacks.register('start_run', main.start, "actions performed at the beginning of a run")
+callbacks.register('stop_run', main.stop, "actions performed at the end of a run")
+
+callbacks.register('report_output_pages', main.report_output_pages, "actions performed when reporting pages")
+callbacks.register('report_output_log', main.report_output_log, "actions performed when reporting log file")
+
+callbacks.register('start_page_number', main.start_shipout_page, "actions performed at the beginning of a shipout")
+callbacks.register('stop_page_number', main.stop_shipout_page, "actions performed at the end of a shipout")
+
+callbacks.register('process_input_buffer', false, "actions performed when reading data")
+callbacks.register('process_output_buffer', false, "actions performed when writing data")
diff --git a/Master/texmf-dist/tex/context/base/luat-sta.lua b/Master/texmf-dist/tex/context/base/luat-sta.lua
index 12fa18219bb..a81b0c206fc 100644
--- a/Master/texmf-dist/tex/context/base/luat-sta.lua
+++ b/Master/texmf-dist/tex/context/base/luat-sta.lua
@@ -7,6 +7,9 @@ if not modules then modules = { } end modules ['luat-sta'] = {
-- this code is used in the updater
+local gmatch, match = string.gmatch, string.match
+local type = type
+
states = states or { }
states.data = states.data or { }
states.hash = states.hash or { }
@@ -35,13 +38,17 @@ function states.set_by_tag(tag,key,value,default,persistent)
if d then
if type(d) == "table" then
local dkey, hkey = key, key
- local pre, post = key:match("(.+)%.([^%.]+)$")
+ local pre, post = match(key,"(.+)%.([^%.]+)$")
if pre and post then
- for k in pre:gmatch("[^%.]+") do
+ for k in gmatch(pre,"[^%.]+") do
local dk = d[k]
if not dk then
dk = { }
d[k] = dk
+ elseif type(dk) == "string" then
+ -- invalid table, unable to upgrade structure
+ -- hope for the best or delete the state file
+ break
end
d = dk
end
@@ -69,7 +76,7 @@ function states.get_by_tag(tag,key,default)
else
local d = states.data[tag]
if d then
- for k in key:gmatch("[^%.]+") do
+ for k in gmatch(key,"[^%.]+") do
local dk = d[k]
if dk then
d = dk
diff --git a/Master/texmf-dist/tex/context/base/luat-sto.lua b/Master/texmf-dist/tex/context/base/luat-sto.lua
index 6fea9151495..08da735db31 100644
--- a/Master/texmf-dist/tex/context/base/luat-sto.lua
+++ b/Master/texmf-dist/tex/context/base/luat-sto.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['luat-sto'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ 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"
@@ -109,20 +109,20 @@ end
function statistics.report_storage(whereto)
whereto = whereto or "term and log"
write_nl(whereto," ","stored tables:"," ")
- for k,v in table.sortedpairs(storage.data) do
+ for k,v in table.sortedhash(storage.data) do
write_nl(whereto,format("%03i %s",k,v[1]))
end
write_nl(whereto," ","stored modules:"," ")
- for k,v in table.sortedpairs(lua.bytedata) do
+ for k,v in table.sortedhash(lua.bytedata) do
write_nl(whereto,format("%03i %s %s",k,v[2],v[1]))
end
write_nl(whereto," ","stored attributes:"," ")
- for k,v in table.sortedpairs(attributes.names) do
+ for k,v in table.sortedhash(attributes.names) do
write_nl(whereto,format("%03i %s",k,v))
end
write_nl(whereto," ","stored catcodetables:"," ")
- for k,v in table.sortedpairs(catcodes.names) do
- write_nl(whereto,format("%03i %s",k,v))
+ for k,v in table.sortedhash(catcodes.names) do
+ write_nl(whereto,format("%03i %s",k,table.concat(v," ")))
end
write_nl(whereto," ")
end
diff --git a/Master/texmf-dist/tex/context/base/lxml-aux.lua b/Master/texmf-dist/tex/context/base/lxml-aux.lua
new file mode 100644
index 00000000000..00f7919098f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-aux.lua
@@ -0,0 +1,543 @@
+if not modules then modules = { } end modules ['lxml-aux'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- not all functions here make sense anymore vbut we keep them for
+-- compatibility reasons
+
+local trace_manipulations = false trackers.register("lxml.manipulations", function(v) trace_manipulations = v end)
+
+local xmlparseapply, xmlconvert, xmlcopy, xmlname = xml.parse_apply, xml.convert, xml.copy, xml.name
+local xmlinheritedconvert = xml.inheritedconvert
+
+local type = type
+local insert, remove = table.insert, table.remove
+local gmatch, gsub = string.gmatch, string.gsub
+
+local function report(what,pattern,c,e)
+ logs.report("xml","%s element '%s' (root: '%s', position: %s, index: %s, pattern: %s)",what,xmlname(e),xmlname(e.__p__),c,e.ni,pattern)
+end
+
+local function withelements(e,handle,depth)
+ if e and handle then
+ local edt = e.dt
+ if edt then
+ depth = depth or 0
+ for i=1,#edt do
+ local e = edt[i]
+ if type(e) == "table" then
+ handle(e,depth)
+ withelements(e,handle,depth+1)
+ end
+ end
+ end
+ end
+end
+
+xml.withelements = withelements
+
+function xml.withelement(e,n,handle) -- slow
+ if e and n ~= 0 and handle then
+ local edt = e.dt
+ if edt then
+ if n > 0 then
+ for i=1,#edt do
+ local ei = edt[i]
+ if type(ei) == "table" then
+ if n == 1 then
+ handle(ei)
+ return
+ else
+ n = n - 1
+ end
+ end
+ end
+ elseif n < 0 then
+ for i=#edt,1,-1 do
+ local ei = edt[i]
+ if type(ei) == "table" then
+ if n == -1 then
+ handle(ei)
+ return
+ else
+ n = n + 1
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+xml.elements_only = xml.collected
+
+function xml.each_element(root,pattern,handle,reverse)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ if reverse then
+ for c=#collected,1,-1 do
+ handle(collected[c])
+ end
+ else
+ for c=1,#collected do
+ handle(collected[c])
+ end
+ end
+ return collected
+ end
+end
+
+xml.process_elements = xml.each_element
+
+function xml.process_attributes(root,pattern,handle)
+ local collected = xmlparseapply({ root },pattern)
+ if collected and handle then
+ for c=1,#collected do
+ handle(collected[c].at)
+ end
+ end
+ return collected
+end
+
+--[[ldx--
+<p>The following functions collect elements and texts.</p>
+--ldx]]--
+
+-- are these still needed -> lxml-cmp.lua
+
+function xml.collect_elements(root, pattern)
+ return xmlparseapply({ root },pattern)
+end
+
+function xml.collect_texts(root, pattern, flatten) -- todo: variant with handle
+ local collected = xmlparseapply({ root },pattern)
+ if collected and flatten then
+ local xmltostring = xml.tostring
+ for c=1,#collected do
+ collected[c] = xmltostring(collected[c].dt)
+ end
+ end
+ return collected or { }
+end
+
+function xml.collect_tags(root, pattern, nonamespace)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ local t = { }
+ for c=1,#collected do
+ local e = collected[c]
+ local ns, tg = e.ns, e.tg
+ if nonamespace then
+ t[#t+1] = tg
+ elseif ns == "" then
+ t[#t+1] = tg
+ else
+ t[#t+1] = ns .. ":" .. tg
+ end
+ end
+ return t
+ end
+end
+
+--[[ldx--
+<p>We've now arrived at the functions that manipulate the tree.</p>
+--ldx]]--
+
+local no_root = { no_root = true }
+
+function xml.redo_ni(d)
+ for k=1,#d do
+ local dk = d[k]
+ if type(dk) == "table" then
+ dk.ni = k
+ end
+ end
+end
+
+local function xmltoelement(whatever,root)
+ if not whatever then
+ return nil
+ end
+ local element
+ if type(whatever) == "string" then
+ element = xmlinheritedconvert(whatever,root)
+ else
+ element = whatever -- we assume a table
+ end
+ if element.error then
+ return whatever -- string
+ end
+ if element then
+ --~ if element.ri then
+ --~ element = element.dt[element.ri].dt
+ --~ else
+ --~ element = element.dt
+ --~ end
+ end
+ return element
+end
+
+xml.toelement = xmltoelement
+
+local function copiedelement(element,newparent)
+ if type(element) == "string" then
+ return element
+ else
+ element = xmlcopy(element).dt
+ if newparent and type(element) == "table" then
+ element.__p__ = newparent
+ end
+ return element
+ end
+end
+
+function xml.delete_element(root,pattern)
+ local collected = xmlparseapply({ 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('deleting',pattern,c,e)
+ end
+ local d = p.dt
+ remove(d,e.ni)
+ xml.redo_ni(d) -- can be made faster and inlined
+ end
+ end
+ end
+end
+
+function xml.replace_element(root,pattern,whatever)
+ local element = root and xmltoelement(whatever,root)
+ local collected = element and xmlparseapply({ 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('replacing',pattern,c,e)
+ end
+ local d = p.dt
+ d[e.ni] = copiedelement(element,p)
+ xml.redo_ni(d) -- probably not needed
+ end
+ end
+ end
+end
+
+local function inject_element(root,pattern,whatever,prepend)
+ local element = root and xmltoelement(whatever,root)
+ local collected = element and xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local r = e.__p__
+ local d, k, rri = r.dt, e.ni, r.ri
+ local edt = (rri and d[rri].dt) or (d and d[k] and d[k].dt)
+ if edt then
+ local be, af
+ local cp = copiedelement(element,e)
+ if prepend then
+ be, af = cp, edt
+ else
+ be, af = edt, cp
+ end
+ for i=1,#af do
+ be[#be+1] = af[i]
+ end
+ if rri then
+ r.dt[rri].dt = be
+ else
+ d[k].dt = be
+ end
+ xml.redo_ni(d)
+ end
+ end
+ end
+end
+
+local function insert_element(root,pattern,whatever,before) -- todo: element als functie
+ local element = root and xmltoelement(whatever,root)
+ local collected = element and xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local r = e.__p__
+ local d, k = r.dt, e.ni
+ if not before then
+ k = k + 1
+ end
+ insert(d,k,copiedelement(element,r))
+ xml.redo_ni(d)
+ end
+ end
+end
+
+xml.insert_element = insert_element
+xml.insert_element_after = insert_element
+xml.insert_element_before = function(r,p,e) insert_element(r,p,e,true) end
+xml.inject_element = inject_element
+xml.inject_element_after = inject_element
+xml.inject_element_before = function(r,p,e) inject_element(r,p,e,true) end
+
+local function include(xmldata,pattern,attribute,recursive,loaddata)
+ -- parse="text" (default: xml), encoding="" (todo)
+ -- attribute = attribute or 'href'
+ pattern = pattern or 'include'
+ loaddata = loaddata or io.loaddata
+ local collected = xmlparseapply({ xmldata },pattern)
+ if collected then
+ for c=1,#collected do
+ local ek = collected[c]
+ local name = nil
+ local ekdt = ek.dt
+ local ekat = ek.at
+ local epdt = ek.__p__.dt
+ if not attribute or attribute == "" then
+ name = (type(ekdt) == "table" and ekdt[1]) or ekdt -- ckeck, probably always tab or str
+ end
+ if not name then
+ for a in gmatch(attribute or "href","([^|]+)") do
+ name = ekat[a]
+ if name then break end
+ end
+ end
+ local data = (name and name ~= "" and loaddata(name)) or ""
+ if data == "" then
+ epdt[ek.ni] = "" -- xml.empty(d,k)
+ elseif ekat["parse"] == "text" then
+ -- for the moment hard coded
+ epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data)
+ else
+--~ local settings = xmldata.settings
+--~ settings.parent_root = xmldata -- to be tested
+--~ local xi = xmlconvert(data,settings)
+ local xi = xmlinheritedconvert(data,xmldata)
+ if not xi then
+ epdt[ek.ni] = "" -- xml.empty(d,k)
+ else
+ if recursive then
+ include(xi,pattern,attribute,recursive,loaddata)
+ end
+ epdt[ek.ni] = xml.body(xi) -- xml.assign(d,k,xi)
+ end
+ end
+ end
+ end
+end
+
+xml.include = include
+
+--~ local function manipulate(xmldata,pattern,manipulator) -- untested and might go away
+--~ local collected = xmlparseapply({ xmldata },pattern)
+--~ if collected then
+--~ local xmltostring = xml.tostring
+--~ for c=1,#collected do
+--~ local e = collected[c]
+--~ local data = manipulator(xmltostring(e))
+--~ if data == "" then
+--~ epdt[e.ni] = ""
+--~ else
+--~ local xi = xmlinheritedconvert(data,xmldata)
+--~ if not xi then
+--~ epdt[e.ni] = ""
+--~ else
+--~ epdt[e.ni] = xml.body(xi) -- xml.assign(d,k,xi)
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
+
+--~ xml.manipulate = manipulate
+
+function xml.strip_whitespace(root, pattern, nolines) -- strips all leading and trailing space !
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ for i=1,#collected do
+ local e = collected[i]
+ local edt = e.dt
+ if edt then
+ local t = { }
+ for i=1,#edt do
+ local str = edt[i]
+ if type(str) == "string" then
+ if str == "" then
+ -- stripped
+ else
+ if nolines then
+ str = gsub(str,"[ \n\r\t]+"," ")
+ end
+ if str == "" then
+ -- stripped
+ else
+ t[#t+1] = str
+ end
+ end
+ else
+ --~ str.ni = i
+ t[#t+1] = str
+ end
+ end
+ e.dt = t
+ end
+ end
+ end
+end
+
+function xml.strip_whitespace(root, pattern, nolines, anywhere) -- strips all leading and trailing spacing
+ local collected = xmlparseapply({ root },pattern) -- beware, indices no longer are valid now
+ if collected then
+ for i=1,#collected do
+ local e = collected[i]
+ local edt = e.dt
+ if edt then
+ if anywhere then
+ local t = { }
+ for e=1,#edt do
+ local str = edt[e]
+ if type(str) ~= "string" then
+ t[#t+1] = str
+ elseif str ~= "" then
+ -- todo: lpeg for each case
+ if nolines then
+ str = gsub(str,"%s+"," ")
+ end
+ str = gsub(str,"^%s*(.-)%s*$","%1")
+ if str ~= "" then
+ t[#t+1] = str
+ end
+ end
+ end
+ e.dt = t
+ else
+ -- we can assume a regular sparse xml table with no successive strings
+ -- otherwise we should use a while loop
+ if #edt > 0 then
+ -- strip front
+ local str = edt[1]
+ if type(str) ~= "string" then
+ -- nothing
+ elseif str == "" then
+ remove(edt,1)
+ else
+ if nolines then
+ str = gsub(str,"%s+"," ")
+ end
+ str = gsub(str,"^%s+","")
+ if str == "" then
+ remove(edt,1)
+ else
+ edt[1] = str
+ end
+ end
+ end
+ if #edt > 1 then
+ -- strip end
+ local str = edt[#edt]
+ if type(str) ~= "string" then
+ -- nothing
+ elseif str == "" then
+ remove(edt)
+ else
+ if nolines then
+ str = gsub(str,"%s+"," ")
+ end
+ str = gsub(str,"%s+$","")
+ if str == "" then
+ remove(edt)
+ else
+ edt[#edt] = str
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+local function rename_space(root, oldspace, newspace) -- fast variant
+ local ndt = #root.dt
+ for i=1,ndt or 0 do
+ local e = root[i]
+ if type(e) == "table" then
+ if e.ns == oldspace then
+ e.ns = newspace
+ if e.rn then
+ e.rn = newspace
+ end
+ end
+ local edt = e.dt
+ if edt then
+ rename_space(edt, oldspace, newspace)
+ end
+ end
+ end
+end
+
+xml.rename_space = rename_space
+
+function xml.remap_tag(root, pattern, newtg)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ collected[c].tg = newtg
+ end
+ end
+end
+
+function xml.remap_namespace(root, pattern, newns)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ collected[c].ns = newns
+ end
+ end
+end
+
+function xml.check_namespace(root, pattern, newns)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ if (not e.rn or e.rn == "") and e.ns == "" then
+ e.rn = newns
+ end
+ end
+ end
+end
+
+function xml.remap_name(root, pattern, newtg, newns, newrn)
+ local collected = xmlparseapply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ e.tg, e.ns, e.rn = newtg, newns, newrn
+ end
+ end
+end
+
+--[[ldx--
+<p>Here are a few synonyms.</p>
+--ldx]]--
+
+xml.each = xml.each_element
+xml.process = xml.process_element
+xml.strip = xml.strip_whitespace
+xml.collect = xml.collect_elements
+xml.all = xml.collect_elements
+
+xml.insert = xml.insert_element_after
+xml.inject = xml.inject_element_after
+xml.after = xml.insert_element_after
+xml.before = xml.insert_element_before
+xml.delete = xml.delete_element
+xml.replace = xml.replace_element
diff --git a/Master/texmf-dist/tex/context/base/lxml-ctx.lua b/Master/texmf-dist/tex/context/base/lxml-ctx.lua
new file mode 100644
index 00000000000..765754953e9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-ctx.lua
@@ -0,0 +1,131 @@
+if not modules then modules = { } end modules ['lxml-ctx'] = {
+ version = 1.001,
+ comment = "companion to lxml-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- is this still used?
+
+xml.ctx = { }
+xml.ctx.enhancers = { }
+
+-- hashen
+
+function xml.ctx.enhancers.compound(root,lpath,before,tokens,after) -- todo lpeg
+ local before = before or "[%a%d][%a%d][%a%d]"
+ local tokens = tokens or "[%/%-]"
+ local after = after or "[%a%d][%a%d][%a%d]"
+ local pattern = "(" .. before .. ")(" .. tokens .. ")(" .. after .. ")"
+ local action = function(a,b,c)
+ return a .. "<compound token=" .. string.format("%q",b) .. "/>" .. c
+ end
+ xml.enhance(root,lpath,pattern,action) -- still present?
+end
+
+local loaded = { }
+
+local nodesettostring = xml.nodesettostring
+
+-- maybe use detokenize instead of \type
+
+function xml.ctx.tshow(specification)
+ local pattern = specification.pattern
+ local xmlroot = specification.xmlroot
+ local attribute = specification.attribute
+ if context then
+ local xmlpattern = pattern
+ if not string.find(xmlpattern,"^[%a]+://") then
+ xmlpattern = "xml://" .. pattern
+ end
+ parsed = xml.parse_pattern(xmlpattern)
+ titlecommand = specification.title or "type"
+ if parsed.state then
+ context[titlecommand]("pattern: " .. pattern .. " (".. parsed.state .. ")")
+ else
+ context[titlecommand]("pattern: " .. pattern)
+ end
+ context.starttabulate({ "|Tr|Tl|Tp|" } )
+ if specification.warning then
+ local comment = parsed.comment
+ if comment then
+ for k=1,#comment do
+ context.NC()
+ context("!")
+ context.NC()
+ context.rlap(comment[k])
+ context.NR()
+ end
+ context.TB()
+ end
+ end
+ for p=1,#parsed do
+ local pp = parsed[p]
+ local kind = pp.kind
+ context.NC()
+ context(p)
+ context.NC()
+ context(kind)
+ context.NC()
+ if kind == "axis" then
+ context(pp.axis)
+ elseif kind == "nodes" then
+ context(nodesettostring(pp.nodes,pp.nodetest))
+ elseif kind == "expression" then
+--~ context("%s => %s",pp.expression,pp.converted)
+ context(pp.expression)
+ elseif kind == "finalizer" then
+ context("%s(%s)",pp.name,pp.arguments)
+ elseif kind == "error" and pp.error then
+ context(pp.error)
+ end
+ context.NC()
+ context.NR()
+ end
+ context.stoptabulate()
+ if xmlroot and xmlroot ~= "" then
+ if not loaded[xmlroot] then
+ loaded[xmlroot] = { xml.convert(buffers.content(xmlroot) or "") }
+ end
+ local collected = xml.parse_apply(loaded[xmlroot],xmlpattern)
+ if collected then
+ local tc = type(collected)
+ if not tc then
+ -- skip
+ else
+ context.blank()
+ context.type("result : ")
+ if tc == "string" then
+ context.type(collected)
+ elseif tc == "table" then
+ if collected.tg then
+ collected = { collected }
+ end
+ for c=1,#collected do
+ local cc = collected[c]
+ if attribute and attribute ~= "" then
+ local ccat = cc.at
+ local a = ccat and ccat[attribute]
+ if a and a ~= "" then
+ context.type(a)
+ context.type(">")
+ end
+ end
+ local ccns = cc.ns
+ if ccns == "" then
+ context.type(cc.tg)
+ else
+ context.type(ccns .. ":" .. cc.tg)
+ end
+ context.space()
+ end
+ else
+ context.type(tostring(tc))
+ end
+ context.blank()
+ end
+ end
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-ctx.mkiv b/Master/texmf-dist/tex/context/base/lxml-ctx.mkiv
new file mode 100644
index 00000000000..73d082d0d51
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-ctx.mkiv
@@ -0,0 +1,64 @@
+%D \module
+%D [ file=lxml-ini,
+%D version=2007.08.17,
+%D title=\CONTEXT\ \XML\ Support,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D Experimental. This might change! Also, it might become a module
+%D instead if core code.
+
+\writestatus{loading}{ConTeXt XML Support / Goodies}
+
+\registerctxluafile{lxml-ctx}{1.001}
+
+\unprotect
+
+% the letterbar is a messy hack and is needed for the tabulate
+
+\settrue \xmllshowbuffer
+\setfalse\xmllshowtitle
+\settrue \xmllshowwarning
+
+\definehead[lshowtitle][subsubsubsubsubject]
+\setuphead[lshowtitle][style=\tta]
+
+% \unexpanded\def\setuplxmlshow[#1]%
+% {\dodoubleargument\getparameters[\??xl]}
+
+\def\xmllshow#1%
+ {\begingroup
+ \let|=\letterbar
+ \ctxlua{xml.ctx.tshow {
+ pattern = \!!bs#1\!!es,
+ \ifconditional\xmllshowtitle
+ title = "lshowtitle",
+ \fi
+ \ifconditional\xmllshowwarning
+ warning = true,
+ \fi
+ } }%
+ \endgroup}
+
+\def\xmllshowbuffer#1#2#3%
+ {\begingroup
+ \let|=\letterbar
+ \ctxlua{xml.ctx.tshow {
+ pattern = \!!bs#2\!!es,
+ \ifconditional\xmllshowbuffer
+ xmlroot = "#1",
+ attribute = "#3",
+ \fi
+ \ifconditional\xmllshowwarning
+ warning = true,
+ \fi
+ } }%
+ \endgroup}
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/lxml-dir.lua b/Master/texmf-dist/tex/context/base/lxml-dir.lua
new file mode 100644
index 00000000000..617ce3e20e2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-dir.lua
@@ -0,0 +1,112 @@
+if not modules then modules = { } end modules ['lxml-dir'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, gsub = string.format, string.gsub
+local get_id = lxml.id
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local xmlparseapply = xml.parse_apply
+
+--~ <?xml version="1.0" standalone="yes"?>
+--~ <!-- demo.cdx -->
+--~ <directives>
+--~ <!--
+--~ <directive attribute='id' value="100" setup="cdx:100"/>
+--~ <directive attribute='id' value="101" setup="cdx:101"/>
+--~ -->
+--~ <!--
+--~ <directive attribute='cdx' value="colors" element="cals:table" setup="cdx:cals:table:colors"/>
+--~ <directive attribute='cdx' value="vertical" element="cals:table" setup="cdx:cals:table:vertical"/>
+--~ <directive attribute='cdx' value="noframe" element="cals:table" setup="cdx:cals:table:noframe"/>
+--~ -->
+--~ <directive attribute='cdx' value="*" element="cals:table" setup="cdx:cals:table:*"/>
+--~ </directives>
+
+
+
+lxml.directives = lxml.directives or { }
+
+local directives = lxml.directives
+
+local data = {
+ setup = { },
+ before = { },
+ after = { }
+}
+
+local function load_setup(filename)
+ local fullname = resolvers.findtexfile(filename) or ""
+ if fullname ~= "" then
+ filename = fullname
+ end
+ local collection = xmlparseapply({ get_id(xml.load(filename)) },"directive")
+ if collection then
+ local valid = 0
+ for i=1,#collection do
+ local at = collection[i].at
+ local attribute, value, element = at.attribute or "", at.value or "", at.element or '*'
+ local setup, before, after = at.setup or "", at.before or "", at.after or ""
+ if attribute ~= "" and value ~= "" then
+ local key = format("%s::%s::%s",element,attribute,value)
+ local t = data[key] or { }
+ if setup ~= "" then t.setup = setup end
+ if before ~= "" then t.before = before end
+ if after ~= "" then t.after = after end
+ data[key] = t
+ valid = valid + 1
+ end
+ end
+ commands.writestatus("lxml","%s directives found in '%s', %s valid",#collection,filename,valid)
+ else
+ commands.writestatus("lxml","no directives found in '%s'",filename)
+ end
+end
+
+local function handle_setup(category,root,attribute,element)
+ root = get_id(root)
+ if attribute then
+ local value = root.at[attribute]
+ if value then
+ if not element then
+ local ns, tg = root.rn or root.ns, root.tg
+ if ns == "" then
+ element = tg
+ else
+ element = ns .. ':' .. tg
+ end
+ end
+ local setup = data[format("%s::%s::%s",element,attribute,value)]
+ if setup then
+ setup = setup[category]
+ end
+ if setup then
+ texsprint(ctxcatcodes,"\\directsetup{",setup,"}")
+ else
+ setup = data[format("%s::%s::*",element,attribute)]
+ if setup then
+ setup = setup[category]
+ end
+ if setup then
+ texsprint(ctxcatcodes,"\\directsetup{",gsub(setup,'%*',value),"}")
+ end
+ end
+ end
+ end
+end
+
+directives.load = load_setup
+directives.handle = handle_setup
+
+function directives.setup(root,attribute,element)
+ handle_setup('setup',root,attribute,element)
+end
+function directives.before(root,attribute,element)
+ handle_setup('before',root,attribute,element)
+end
+function directives.after(root,attribute,element)
+ handle_setup('after',root,attribute,element)
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-ent.lua b/Master/texmf-dist/tex/context/base/lxml-ent.lua
index c91d12706bb..19361193745 100644
--- a/Master/texmf-dist/tex/context/base/lxml-ent.lua
+++ b/Master/texmf-dist/tex/context/base/lxml-ent.lua
@@ -6,110 +6,64 @@ if not modules then modules = { } end modules ['lxml-ent'] = {
license = "see context related readme files"
}
-local type, next, tonumber, tostring, setmetatable, loadstring = type, next, tonumber, tostring, setmetatable, loadstring
-local format, gsub, find = string.format, string.gsub, string.find
-local utfchar = unicode.utf8.char
+local type, next, tonumber = type, next, tonumber
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local utf = unicode.utf8
+local byte, format = string.byte, string.format
+local utfupper, utfchar = utf.upper, utf.char
+local lpegmatch = lpeg.match
--[[ldx--
<p>We provide (at least here) two entity handlers. The more extensive
resolver consults a hash first, tries to convert to <l n='utf'/> next,
and finaly calls a handler when defines. When this all fails, the
original entity is returned.</p>
+
+<p>We do things different now but it's still somewhat experimental</p>
--ldx]]--
+local trace_entities = false trackers.register("xml.entities", function(v) trace_entities = v end)
+
xml.entities = xml.entities or { } -- xml.entity_handler == function
-function xml.entity_handler(e)
- return format("[%s]",e)
-end
+storage.register("xml/entities",xml.entities,"xml.entities") -- this will move to lxml
-local function toutf(s)
- return utfchar(tonumber(s,16))
-end
+local entities = xml.entities -- this is a shared hash
-local function utfize(root)
- local d = root.dt
- for k=1,#d do
- local dk = d[k]
- if type(dk) == "string" then
- -- test prevents copying if no match
- if find(dk,"&#x.-;") then
- d[k] = gsub(dk,"&#x(.-);",toutf)
- end
- else
- utfize(dk)
- end
- end
-end
+xml.unknown_any_entity_format = nil -- has to be per xml
-xml.utfize = utfize
+local parsedentity = xml.parsedentitylpeg
-local function resolve(e) -- hex encoded always first, just to avoid mkii fallbacks
- if find(e,"^#x") then
- return utfchar(tonumber(e:sub(3),16))
- elseif find(e,"^#") then
- return utfchar(tonumber(e:sub(2)))
- else
- local ee = xml.entities[e] -- we cannot shortcut this one (is reloaded)
- if ee then
- return ee
- else
- local h = xml.entity_handler
- return (h and h(e)) or "&" .. e .. ";"
- end
+function xml.register_entity(key,value)
+ entities[key] = value
+ if trace_entities then
+ logs.report("xml","registering entity '%s' as: %s",key,value)
end
end
-local function resolve_entities(root)
- if not root.special or root.tg == "@rt@" then
- local d = root.dt
- for k=1,#d do
- local dk = d[k]
- if type(dk) == "string" then
- if find(dk,"&.-;") then
- d[k] = gsub(dk,"&(.-);",resolve)
- end
- else
- resolve_entities(dk)
- end
+function xml.resolved_entity(str)
+ local e = entities[str]
+ if e then
+ local te = type(e)
+ if te == "function" then
+ e(str)
+ elseif e then
+ texsprint(ctxcatcodes,e)
end
- end
-end
-
-xml.resolve_entities = resolve_entities
-
-function xml.utfize_text(str)
- if find(str,"&#") then
- return (gsub(str,"&#x(.-);",toutf))
else
- return str
- end
-end
-
-function xml.resolve_text_entities(str) -- maybe an lpeg. maybe resolve inline
- if find(str,"&") then
- return (gsub(str,"&(.-);",resolve))
- else
- return str
- end
-end
-
-function xml.show_text_entities(str)
- if find(str,"&") then
- return (gsub(str,"&(.-);","[%1]"))
- else
- return str
- end
-end
-
--- experimental, this will be done differently
-
-function xml.merge_entities(root)
- local documententities = root.entities
- local allentities = xml.entities
- if documententities then
- for k, v in next, documententities do
- allentities[k] = v
+ -- resolve hex and dec, todo: escape # & etc for ctxcatcodes
+ -- normally this is already solved while loading the file
+ local chr, err = lpegmatch(parsedentity,str)
+ if chr then
+ texsprint(ctxcatcodes,chr)
+ elseif err then
+ texsprint(ctxcatcodes,err)
+ else
+ texsprint(ctxcatcodes,"\\xmle{",str,"}{",utfupper(str),"}") -- we need to use our own upper
end
end
end
+
+entities.amp = function() tex.write("&") end
+entities.lt = function() tex.write("<") end
+entities.gt = function() tex.write(">") end
diff --git a/Master/texmf-dist/tex/context/base/lxml-inf.lua b/Master/texmf-dist/tex/context/base/lxml-inf.lua
new file mode 100644
index 00000000000..629c869eca9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-inf.lua
@@ -0,0 +1,53 @@
+if not modules then modules = { } end modules ['lxml-inf'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This file will be loaded runtime by x-pending.tex.
+
+local status, stack
+
+local function get(e,d)
+ local ns, tg = e.ns, e.tg
+ local name = tg
+ if ns ~= "" then name = ns .. ":" .. tg end
+ stack[d] = name
+ local ec = e.command
+ if ec == true then
+ ec = "system: text"
+ elseif ec == false then
+ ec = "system: skip"
+ elseif ec == nil then
+ ec = "system: not set"
+ elseif type(ec) == "string" then
+ ec = "setup: " .. ec
+ else -- function
+ ec = tostring(ec)
+ end
+ local tag = concat(stack," => ",1,d)
+ local s = status[tag]
+ if not s then
+ s = { }
+ status[tag] = s
+ end
+ s[ec] = (s[ec] or 0) + 1
+end
+
+local function get_command_status(id)
+ status, stack = {}, {}
+ if id then
+ xmlwithelements(get_id(id),get)
+ return status
+ else
+ local t = { }
+ for id, _ in next, loaded do
+ t[id] = get_command_status(id)
+ end
+ return t
+ end
+end
+
+lxml.get_command_status = get_command_status
diff --git a/Master/texmf-dist/tex/context/base/lxml-ini.lua b/Master/texmf-dist/tex/context/base/lxml-ini.lua
deleted file mode 100644
index 0c40a4bafb9..00000000000
--- a/Master/texmf-dist/tex/context/base/lxml-ini.lua
+++ /dev/null
@@ -1,1138 +0,0 @@
-if not modules then modules = { } end modules ['lxml-ini'] = {
- version = 1.001,
- comment = "companion to lxml-ini.tex",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local utf = unicode.utf8
-
-local texsprint, texprint, utfchar = tex.sprint or print, tex.print or print, utf.char
-local format, concat, insert, remove = string.format, table.concat, table.insert, table.remove
-local type, next, tonumber = type, next, tonumber
-
-local ctxcatcodes = tex.ctxcatcodes
-local texcatcodes = tex.texcatcodes
-local vrbcatcodes = tex.vrbcatcodes
-
-local trace_setups = false trackers.register("lxml.setups", function(v) trace_setups = v end)
-local trace_loading = false trackers.register("lxml.loading", function(v) trace_loading = v end)
-
--- for the moment here
-
-function table.insert_before_value(t,value,extra)
- for i=1,#t do
- if t[i] == extra then
- remove(t,i)
- end
- end
- for i=1,#t do
- if t[i] == value then
- insert(t,i,extra)
- return
- end
- end
- insert(t,1,extra)
-end
-
-function table.insert_after_value(t,value,extra)
- for i=1,#t do
- if t[i] == extra then
- remove(t,i)
- end
- end
- for i=1,#t do
- if t[i] == value then
- insert(t,i+1,extra)
- return
- end
- end
- insert(t,#t+1,extra)
-end
-
--- todo: speed up: remember last index/match combination
-
-local traverse, lpath = xml.traverse, xml.lpath
-
-local xmlfilter, xmlfirst, xmllast, xmlall = xml.filter, xml.first, xml.last, xml.all
-local xmlcollect, xmlcontent, xmlcollect_texts, xmlcollect_tags, xmlcollect_elements = xml.collect, xml.content, xml.collect_texts, xml.collect_tags, xml.collect_elements
-local xmlattribute, xmlindex = xml.filters.attribute, xml.filters.index
-local xmlelements = xml.elements
-
-document = document or { }
-document.xml = document.xml or { }
-
--- todo: loaded and myself per document so that we can garbage collect buffers
-
-lxml = lxml or { }
-lxml.loaded = { }
-lxml.myself = { }
-lxml.n = 0
-
-local loaded = lxml.loaded
-local myself = lxml.myself
-local stack = lxml.stack
-
-lxml.self = myself -- be backward compatible for a while
-
-local function get_id(id)
- return (type(id) == "table" and id) or loaded[id] or myself[tonumber(id)] -- no need for tonumber if we pass without ""
-end
-
-lxml.id = get_id
-
-function lxml.root(id)
- return loaded[id]
-end
-
-do
-
- xml.specialhandler = xml.specialhandler or { }
-
- local specialhandler = xml.specialhandler
- local serialize = xml.serialize
-
- local crlf = lpeg.P("\r\n")
- local cr = lpeg.P("\r")
- local lf = lpeg.P("\n")
- local space = lpeg.S(" \t\f\v")
- local newline = crlf + cr + lf
- local spacing = newline * space^0
- local content = lpeg.C((1-spacing)^1)
- local verbose = lpeg.C((1-(space+newline))^1)
-
- -- local capture = (
- -- newline^2 * lpeg.Cc("") / texprint +
- -- newline * lpeg.Cc(" ") / texsprint +
- -- content / texsprint
- -- )^0
-
- local capture = (
- space^0 * newline^2 * lpeg.Cc("") / texprint +
- space^0 * newline * space^0 * lpeg.Cc(" ") / texsprint +
- content / texsprint
- )^0
-
- local forceraw, rawroot = false, nil
-
- function lxml.startraw()
- forceraw = true
- end
- function lxml.stopraw()
- forceraw = false
- end
- function lxml.rawroot()
- return rawroot
- end
- function lxml.rawpath(rootid)
- if rawroot and type(rawroot) == "table" then
- local text, path, rp
- if not rawroot.dt then
- text, path, rp = "text", "", rawroot[0]
- else
- path, rp = "tree", "", rawroot.__p__
- end
- while rp do
- local rptg = rp.tg
- if rptg then
- path = rptg .. "/" .. path
- end
- rp = rp.__p__
- end
- return { rootid, "/" .. path, text }
- end
- end
-
- local function sprint(root)
- if not root then
- --~ rawroot = false
- -- quit
- else
- local tr = type(root)
- if tr == "string" then -- can also be result of lpath
- --~ rawroot = false
- capture:match(root)
- elseif tr == "table" then
- rawroot = forceraw and root
- serialize(root,sprint,nil,nil,specialhandler,forceraw)
- end
- end
- end
-
- xml.sprint = sprint
-
- function xml.tprint(root) -- we can move sprint inline
- local tr = type(root)
- if tr == "table" then
- local n = #root
- if n == 0 then
- sprint("") -- empty element, else no setup triggered (check this! )
- else
- for i=1,n do
- sprint(root[i])
- end
- end
- elseif tr == "string" then
- sprint(root)
- end
- end
-
- function xml.cprint(root) -- content
- if not root then
---~ rawroot = false
- -- quit
- elseif type(root) == 'string' then
---~ rawroot = false
- capture:match(root)
- else
- local rootdt = root.dt
- rawroot = forceraw and root
- if rootdt then -- the main one
- serialize(rootdt,sprint,nil,nil,specialhandler,forceraw)
- else -- probably dt
- serialize(root,sprint,nil,nil,specialhandler,forceraw)
- end
- end
- end
-
- -- lines (untested)
-
- local buffer = { }
-
- local capture = (
- newline^2 / function() buffer[#buffer+1] = "" end +
- newline / function() buffer[#buffer] = buffer[#buffer] .. " " end +
- content / function(s) buffer[#buffer] = buffer[#buffer] .. s end
- )^0
-
- function lines(root)
- if not root then
---~ rawroot = false
- -- quit
- elseif type(root) == 'string' then
---~ rawroot = false
- capture:match(root)
- elseif next(root) then -- tr == 'table'
- rawroot = forceraw and root
- serialize(root,lines,forceraw)
- end
- end
-
- function xml.lines(root)
- buffer = { "" }
- lines(root)
- return result
- end
-
- -- cdata
-
- local linecommand = "\\obeyedline"
- local spacecommand = "\\obeyedspace" -- "\\strut\\obeyedspace"
- local beforecommand = ""
- local aftercommand = ""
-
- local capture = (
- newline / function( ) texsprint(texcatcodes,linecommand,"{}") end +
- verbose / function(s) texsprint(vrbcatcodes,s) end +
- space / function( ) texsprint(texcatcodes,spacecommand,"{}") end
- )^0
-
- local function toverbatim(str)
- if beforecommand then texsprint(texcatcodes,beforecommand,"{}") end
- capture:match(str)
- if aftercommand then texsprint(texcatcodes,aftercommand,"{}") end
- end
-
- function lxml.set_verbatim(before,after,obeyedline,obeyedspace)
- beforecommand, aftercommand, linecommand, spacecommand = before, after, obeyedline, obeyedspace
- end
-
- function lxml.set_cdata()
- specialhandler['@cd@'] = toverbatim
- end
-
- function lxml.reset_cdata()
- specialhandler['@cd@'] = nil
- end
-
- -- local capture = (space^0*newline)^0 * capture * (space+newline)^0 * -1
-
- local function toverbatim(str)
- if beforecommand then texsprint(texcatcodes,beforecommand,"{}") end
- -- todo: add this to capture
- str = str:gsub("^[ \t]+[\n\r]+","")
- str = str:gsub("[ \t\n\r]+$","")
- capture:match(str)
- if aftercommand then texsprint(texcatcodes,aftercommand,"{}") end
- end
-
- function lxml.verbatim(id,before,after)
- local root = get_id(id)
- if root then
- if before then texsprint(ctxcatcodes,format("%s[%s]",before,root.tg)) end
- -- serialize(root.dt,toverbatim,nil,nil,nil,true) -- was root
- local t = { }
- serialize(root.dt,function(s) t[#t+1] = s end,nil,nil,nil,true) -- was root
- toverbatim(table.concat(t,""))
- if after then texsprint(ctxcatcodes,after) end
- end
- end
- function lxml.inlineverbatim(id)
- lxml.verbatim(id,"\\startxmlinlineverbatim","\\stopxmlinlineverbatim")
- end
- function lxml.displayverbatim(id)
- lxml.verbatim(id,"\\startxmldisplayverbatim","\\stopxmldisplayverbatim")
- end
-
- local pihandlers = { }
-
- specialhandler['@pi@'] = function(str)
- for i=1,#pihandlers do
- pihandlers[i](str)
- end
- end
-
- xml.pihandlers = pihandlers
-
- local kind = lpeg.P("context-") * lpeg.C((1-lpeg.P("-"))^1) * lpeg.P("-directive")
- local space = lpeg.S(" \n\r")
- local spaces = space^0
- local class = lpeg.C((1-space)^0)
- local key = class
- local value = lpeg.C(lpeg.P(1-(space * -1))^0)
-
- local parser = kind * spaces * class * spaces * key * spaces * value
-
- pihandlers[#pihandlers+1] = function(str)
- -- local kind, class, key, value = parser:match(str)
- if str then
- local a, b, c, d = parser:match(str)
- if d then
- texsprint(ctxcatcodes,format("\\xmlcontextdirective{%s}{%s}{%s}{%s}",a,b,c,d))
- end
- end
- end
-
- -- print(contextdirective("context-mathml-directive function reduction yes "))
- -- print(contextdirective("context-mathml-directive function "))
-
- function lxml.main(id)
- serialize(get_id(id),sprint,nil,nil,specialhandler) -- the real root (@rt@)
- end
-
- specialhandler['@dt@'] = function()
- -- nothing
- end
-
-end
-
-local xmlsprint = xml.sprint
-local xmltprint = xml.tprint
-
--- redefine xml load
-
-xml.originalload = xml.originalload or xml.load
-
-local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-
-function xml.load(filename)
- lxml.n = lxml.n + 1
- starttiming(xml)
- local xmldata = xml.convert((filename and resolvers.loadtexfile(filename)) or "")
- stoptiming(xml)
- return xmldata
-end
-
-function lxml.load(id,filename)
- lxml.n = lxml.n + 1
- filename = commands.preparedfile(filename)
- if trace_loading then
- commands.writestatus("lxml","loading file: %s",filename)
- end
- loaded[id] = xml.load(filename)
- return loaded[id], filename
-end
-
-function lxml.register(id,xmltable)
- lxml.n = lxml.n + 1
- loaded[id] = xmltable
- return xmltable
-end
-
-function lxml.include(id,pattern,attribute,recurse)
- starttiming(xml)
- xml.include(get_id(id),pattern,attribute,recurse,function(filename)
- if filename then
- filename = commands.preparedfile(filename)
- if trace_loading then
- commands.writestatus("lxml","including file: %s",filename)
- end
- return resolvers.loadtexfile(filename) or ""
- else
- return ""
- end
- end)
- stoptiming(xml)
-end
-
-function lxml.utfize(id)
- xml.utfize(get_id(id))
-end
-
-function lxml.filter(id,pattern)
- xmlsprint(xmlfilter(get_id(id),pattern))
-end
-function lxml.first(id,pattern)
- xmlsprint(xmlfirst(get_id(id),pattern))
-end
-function lxml.last(id,pattern)
- xmlsprint(xmllast(get_id(id),pattern))
-end
-function lxml.all(id,pattern)
- -- xmltprint(xmlcollect(get_id(id),pattern))
- traverse(get_id(id), lpath(pattern), function(r,d,k)
- -- to be checked for root::
- if d then
- xmlsprint(d[k])
- else -- new, maybe wrong
---~ xmlsprint(r)
- end
- return false
- end)
-end
-
-function lxml.nonspace(id,pattern) -- slow, todo loop
- xmltprint(xmlcollect(get_id(id),pattern,true))
-end
-
---~ function lxml.content(id)
---~ xmlsprint(xmlcontent(get_id(id)) or "")
---~ end
-
-function lxml.strip(id,pattern,nolines)
- xml.strip(get_id(id),pattern,nolines)
-end
-
-function lxml.text(id,pattern)
- xmltprint(xmlcollect_texts(get_id(id),pattern) or {})
-end
-
-function lxml.tags(id,pattern)
- local tags = xmlcollect_tags(get_id(id),pattern)
- if tags then
- texsprint(concat(tags,","))
- end
-end
-
-function lxml.raw(id,pattern) -- the content, untouched by commands
- local c = xmlfilter(get_id(id),pattern)
- if c then
- xml.serialize(c.dt,texsprint,nil,nil,nil,true)
- end
-end
-
-function lxml.snippet(id,i)
- local e = get_id(id)
- if e then
- local edt = e.dt
- if edt then
- xmlsprint(edt[i])
- end
- end
-end
-
-function xml.element(e,n)
- if e then
- local edt = e.dt
- if edt then
- if n > 0 then
- for i=1,#edt do
- local ei = edt[i]
- if type(ei) == "table" then
- if n == 1 then
- xmlsprint(ei)
- return
- else
- n = n - 1
- end
- end
- end
- elseif n < 0 then
- for i=#edt,1,-1 do
- local ei = edt[i]
- if type(ei) == "table" then
- if n == -1 then
- xmlsprint(ei)
- return
- else
- n = n + 1
- end
- end
- end
- end
- end
- end
-end
-
-function lxml.element(id,n)
- xml.element(get_id(id),n)
-end
-
-function lxml.stripped(id,pattern,nolines)
- local str = xmlcontent(get_id(id),pattern) or ""
- str = str:gsub("^%s*(.-)%s*$","%1")
- if nolines then
- str = str:gsub("%s+"," ")
- end
- xmlsprint(str)
-end
-
-function lxml.flush(id)
- id = get_id(id)
- local dt = id and id.dt
- if dt then
- xmlsprint(dt)
- end
-end
-
---~ function lxml.strip(id,flush)
---~ local dt = get_id(id).dt
---~ local str = dt[1]
---~ if type(str) == "string" then
---~ dt[1] = str:gsub("^ *","")
---~ end
---~ str = dt[#dt]
---~ if type(str) == "string" then
---~ dt[#dt] = str:gsub(" *$","")
---~ end
---~ if flush then
---~ xmlsprint(dt)
---~ end
---~ end
-
-function lxml.direct(id)
- xmlsprint(get_id(id))
-end
-
-function lxml.index(id,pattern,i)
- xmlsprint((xmlindex(get_id(id),pattern,i)))
-end
-
-function lxml.attribute(id,pattern,a,default) --todo: snelle xmlatt
- local str = xmlattribute(get_id(id),pattern,a) or ""
- texsprint((str == "" and default) or str)
-end
-
-function lxml.count(id,pattern)
- texsprint(xml.count(get_id(id),pattern) or 0)
-end
-function lxml.nofelements(id)
- local e = get_id(id)
- local edt = e.dt
- if edt and type(edt) == "table" then
- local n = 0
- for i=1,#edt do
- if type(edt[i]) == "table" then
- n = n + 1
- end
- end
- texsprint(n)
- else
- texsprint(0)
- end
-end
-function lxml.name(id) -- or remapped name? -> lxml.info, combine
- local r = get_id(id)
- local ns = r.rn or r.ns or ""
- if ns ~= "" then
- texsprint(ns,":",r.tg)
- else
- texsprint(r.tg)
- end
-end
-function lxml.tag(id) -- tag vs name -> also in l-xml tag->name
- texsprint(get_id(id).tg or "")
-end
-function lxml.namespace(id) -- or remapped name?
- local root = get_id(id)
- texsprint(root.rn or root.ns or "")
-end
-
---~ function lxml.concat(id,what,separator,lastseparator)
---~ texsprint(concat(xml.collect_texts(get_id(id),what,true),separator or ""))
---~ end
-
-function lxml.concatrange(id,what,start,stop,separator,lastseparator) -- test this on mml
- local t = xmlcollect_elements(lxml.id(id),what,true) -- ignorespaces
- local separator = separator or ""
- local lastseparator = lastseparator or separator or ""
- start, stop = (start == "" and 1) or tonumber(start) or 1, (stop == "" and #t) or tonumber(stop) or #t
- if stop < 0 then stop = #t + stop end -- -1 == last-1
- for i=start,stop do
- xmlsprint(t[i])
- if i == #t then
- -- nothing
- elseif i == #t-1 and lastseparator ~= "" then
- texsprint(ctxcatcodes,lastseparator)
- elseif separator ~= "" then
- texsprint(ctxcatcodes,separator)
- end
- end
-end
-
-function lxml.concat(id,what,separator,lastseparator)
- lxml.concatrange(id,what,false,false,separator,lastseparator)
-end
-
--- string : setup
--- true : text (no <self></self>)
--- false : ignore
--- function : call
-
--- todo: free self after usage, i.e. after the setup, which
--- means a call to lua; we can also choose a proper maximum
--- and cycle or maybe free on demand
-
--- problems with empty elements
--- we use a real tex.sprint, else spaces go wrong
--- maybe just a .. because this happens often
-
-function xml.command(root, command)
- local tc = type(command)
- if tc == "string" then
- -- setup
- local n = #myself + 1
- myself[n] = root
- texsprint(ctxcatcodes,format("\\xmlsetup{%i}{%s}",n,command))
- elseif tc == "function" then
- -- function
- command(root)
- elseif command == true then
- -- text (no <self></self>) / so, no mkii fallback then
- xmltprint(root.dt)
- elseif command == false then
- -- ignore
- else
- -- fuzzy, so ignore too
- end
-end
-
-function lxml.setaction(id,pattern,action)
- for rt, dt, dk in xmlelements(get_id(id),pattern) do
- dt[dk].command = action
- end
-end
-
-function lxml.setsetup(id,pattern,setup)
- if not setup or setup == "" or setup == "*" or setup == "-" or setup == "+" then
- for rt, dt, dk in xmlelements(get_id(id),pattern) do
- local dtdk = dt and dt[dk] or rt
- local ns, tg = dtdk.rn or dtdk.ns, dtdk.tg
- if tg then -- to be sure
- local command = (ns == "" and tg) or (ns .. ":" .. tg)
- if setup == "-" then
- dtdk.command = false
- if trace then
- logs.report("lxml","lpath matched -> %s -> skipped", command)
- end
- elseif setup == "+" then
- dtdk.command = true
- if trace_setups then
- logs.report("lxml","lpath matched -> %s -> text", command)
- end
- else
- dtdk.command = command
- if trace_setups then
- logs.report("lxml","lpath matched -> %s -> %s", command, command)
- end
- end
- end
- end
- else
- local a, b = setup:match("^(.+:)([%*%-])$")
- if a and b then
- for rt, dt, dk in xmlelements(get_id(id),pattern) do
- local dtdk = (dt and dt[dk]) or rt
- local ns, tg = dtdk.rn or dtdk.ns, dtdk.tg
- if b == "-" then
- dtdk.command = false
- if trace_setups then
- if ns == "" then
- logs.report("lxml","lpath matched -> %s -> skipped", tg)
- else
- logs.report("lxml","lpath matched -> %s:%s -> skipped", ns, tg)
- end
- end
- elseif b == "+" then
- dtdk.command = true
- if trace_setups then
- if ns == "" then
- logs.report("lxml","lpath matched -> %s -> text", tg)
- else
- logs.report("lxml","lpath matched -> %s:%s -> text", ns, tg)
- end
- end
- else
- dtdk.command = a .. tg
- if trace_setups then
- if ns == "" then
- logs.report("lxml","lpath matched -> %s -> %s", tg, dtdk.command)
- else
- logs.report("lxml","lpath matched -> %s:%s -> %s", ns, tg, dtdk.command)
- end
- end
- end
- end
- else
- if trace_setups then
- logs.report("lxml","lpath pattern -> %s -> %s", pattern, setup)
- end
- for rt, dt, dk in xmlelements(get_id(id),pattern) do
- local dtdk = (dt and dt[dk]) or rt
- dtdk.command = setup
- if trace_setups then
- local ns, tg = dtdk.rn or dtdk.ns, dtdk.tg
- if ns == "" then
- logs.report("lxml","lpath matched -> %s -> %s", tg, setup)
- else
- logs.report("lxml","lpath matched -> %s:%s -> %s", ns, tg, setup)
- end
- end
- end
- end
- end
-end
-
-function lxml.idx(id,pattern,i) -- hm, hashed, needed?
- local r = get_id(id)
- if r then
- local rp = r.patterns
- if not rp then
- rp = { }
- r.patterns = rp
- end
- if not rp[pattern] then
- rp[pattern] = xmlcollect_elements(r,pattern) -- dd, rr
- end
- local rpi = rp[pattern] and rp[pattern][i]
- if rpi then
- xmlsprint(rpi)
- end
- end
-end
-
-function lxml.info(id)
- id = get_id(id)
- local ns, tg = id.ns, id.tg
- if ns and ns ~= "" then -- best make a function
- tg = ns .. ":" .. tg
- else
- tg = tg or "?"
- end
- texsprint(tg)
-end
-
-
-local function command(root,pattern,cmd) -- met zonder ''
- cmd = cmd:gsub("^([\'\"])(.-)%1$", "%2")
- traverse(root, lpath(pattern), function(r,d,k)
- -- this can become pretty large
- local m = (d and d[k]) or r -- brrr this r, maybe away
- if type(m) == "table" then -- probably a bug
- local n = #myself + 1
- myself[n] = m
- texsprint(ctxcatcodes,format("\\xmlsetup{%s}{%s}",n,cmd))
- end
- end)
-end
-
-xml.filters.command = command
-
-function lxml.command(id,pattern,cmd)
- command(get_id(id),pattern,cmd)
-end
-
-local function dofunction(root,pattern,fnc)
- traverse(root, lpath(pattern), xml.functions[fnc]) -- r, d, t
-end
-
-xml.filters["function"] = dofunction
-
---~ <?xml version="1.0" standalone="yes"?>
---~ <!-- demo.cdx -->
---~ <directives>
---~ <!--
---~ <directive attribute='id' value="100" setup="cdx:100"/>
---~ <directive attribute='id' value="101" setup="cdx:101"/>
---~ -->
---~ <!--
---~ <directive attribute='cdx' value="colors" element="cals:table" setup="cdx:cals:table:colors"/>
---~ <directive attribute='cdx' value="vertical" element="cals:table" setup="cdx:cals:table:vertical"/>
---~ <directive attribute='cdx' value="noframe" element="cals:table" setup="cdx:cals:table:noframe"/>
---~ -->
---~ <directive attribute='cdx' value="*" element="cals:table" setup="cdx:cals:table:*"/>
---~ </directives>
-
-lxml.directives = { }
-
-local data = {
- setup = { },
- before = { },
- after = { }
-}
-
-function lxml.directives.load(filename)
- local fullname = resolvers.find_file(filename) or ""
- if fullname ~= "" then
- filename = fullname
- end
- local root = xml.load(filename)
- for r, d, k in xmlelements(root,"directive") do
- local dk = d[k]
- local at = dk.at
- local attribute, value, element = at.attribute or "", at.value or "", at.element or '*'
- local setup, before, after = at.setup or "", at.before or "", at.after or ""
- if attribute ~= "" and value ~= "" then
- local key = format("%s::%s::%s",element,attribute,value)
- local t = data[key] or { }
- if setup ~= "" then t.setup = setup end
- if before ~= "" then t.before = before end
- if after ~= "" then t.after = after end
- data[key] = t
- end
- end
-end
-
-function lxml.directives.setup(root,attribute,element)
- lxml.directives.handle_setup('setup',root,attribute,element)
-end
-function lxml.directives.before(root,attribute,element)
- lxml.directives.handle_setup('before',root,attribute,element)
-end
-function lxml.directives.after(root,attribute,element)
- lxml.directives.handle_setup('after',root,attribute,element)
-end
-
-function lxml.directives.handle_setup(category,root,attribute,element)
- root = get_id(root)
- attribute = attribute
- if attribute then
- local value = root.at[attribute]
- if value then
- if not element then
- local ns, tg = root.rn or root.ns, root.tg
- if ns == "" then
- element = tg
- else
- element = ns .. ':' .. tg
- end
- end
- local setup = data[format("%s::%s::%s",element,attribute,value)]
- if setup then
- setup = setup[category]
- end
- if setup then
- texsprint(ctxcatcodes,format("\\directsetup{%s}",setup))
- else
- setup = data[format("%s::%s::*",element,attribute)]
- if setup then
- setup = setup[category]
- end
- if setup then
- texsprint(ctxcatcodes,format("\\directsetup{%s}",setup:gsub('%*',value)))
- end
- end
- end
- end
-end
-
-function xml.getbuffer(name) -- we need to make sure that commands are processed
- if not name or name == "" then
- name = tex.jobname
- end
- xml.tostring(xml.convert(concat(buffers.data[name] or {},"")))
-end
-
-function lxml.loadbuffer(id,name)
- if not name or name == "" then
- name = tex.jobname
- end
- starttiming(xml)
- loaded[id] = xml.convert(buffers.collect(name or id,"\n"))
- stoptiming(xml)
- return loaded[id], name or id
-end
-
-function lxml.loaddata(id,str)
- starttiming(xml)
- loaded[id] = xml.convert(str or "")
- stoptiming(xml)
- return loaded[id], id
-end
-
-function lxml.loadregistered(id)
- return loaded[id], id
-end
-
--- for the moment here:
-
-lxml.set_verbatim("\\xmlcdatabefore", "\\xmlcdataafter", "\\xmlcdataobeyedline", "\\xmlcdataobeyedspace")
-lxml.set_cdata()
-
-local traced = { }
-
-function lxml.trace_text_entities(str)
- return str:gsub("&(.-);",function(s)
- traced[s] = (traced[s] or 0) + 1
- return "["..s.."]"
- end)
-end
-
-function lxml.show_text_entities()
- for k,v in ipairs(table.sortedkeys(traced)) do
- local h = v:match("^#x(.-)$")
- if h then
- local d = tonumber(h,16)
- local u = utfchar(d)
- logs.report("lxml","entity: %s / %s / %s / n=%s",h,d,u,traced[v])
- else
- logs.report("lxml","entity: %s / n=%s",v,traced[v])
- end
- end
-end
-
-local error_entity_handler = function(s) return format("[%s]",s) end
-local element_entity_handler = function(s) return format("<ctx:e n='%s'/>",s) end
-
-function lxml.set_mkii_entityhandler()
- xml.entity_handler = error_entity_handler
- xml.set_text_cleanup()
-end
-function lxml.set_mkiv_entityhandler()
- xml.entity_handler = element_entity_handler
- xml.set_text_cleanup(xml.resolve_text_entities)
-end
-function lxml.reset_entityhandler()
- xml.entity_handler = error_entity_handler
- xml.set_text_cleanup()
-end
-
-local function with_elements_only(e,handle)
- if e and handle then
- local etg = e.tg
- if etg then
- if e.special and etg ~= "@rt@" then
- if resthandle then
- resthandle(e)
- end
- else
- local edt = e.dt
- if edt then
- for i=1,#edt do
- local e = edt[i]
- if type(e) == "table" then
- handle(e)
- with_elements_only(e,handle)
- end
- end
- end
- end
- end
- end
-end
-
- local function with_elements_only(e,handle,depth)
- if e and handle then
- local edt = e.dt
- if edt then
- depth = depth or 0
- for i=1,#edt do
- local e = edt[i]
- if type(e) == "table" then
- handle(e,depth)
- with_elements_only(e,handle,depth+1)
- end
- end
- end
- end
-end
-
-xml.with_elements_only = with_elements_only
-
-local function to_text(e)
- if e.command == nil then
- local etg = e.tg
- if etg and e.special and etg ~= "@rt@" then
- e.command = false -- i.e. skip
- else
- e.command = true -- i.e. no <self></self>
- end
- end
-end
-local function to_none(e)
- if e.command == nil then
- e.command = false -- i.e. skip
- end
-end
-
--- can be made faster: just recurse over whole table, todo
-
-function lxml.set_command_to_text(id)
- xml.with_elements_only(get_id(id),to_text)
-end
-
-function lxml.set_command_to_none(id)
- xml.with_elements_only(get_id(id),to_none)
-end
-
-function lxml.get_command_status(id)
- local status, stack = {}, {}
- local function get(e,d)
- local ns, tg = e.ns, e.tg
- local name = tg
- if ns ~= "" then name = ns .. ":" .. tg end
- stack[d] = name
- local ec = e.command
- if ec == true then
- ec = "system: text"
- elseif ec == false then
- ec = "system: skip"
- elseif ec == nil then
- ec = "system: not set"
- elseif type(ec) == "string" then
- ec = "setup: " .. ec
- else -- function
- ec = tostring(ec)
- end
- local tag = table.concat(stack," => ",1,d)
- local s = status[tag]
- if not s then
- s = { }
- status[tag] = s
- end
- s[ec] = (s[ec] or 0) + 1
- end
- if id then
- xml.with_elements_only(get_id(id),get)
- return status
- else
- local t = { }
- for id, _ in pairs(loaded) do
- t[id] = lxml.get_command_status(id)
- end
- return t
- end
-end
-
-local setups = { }
-
-function lxml.installsetup(what,document,setup,where)
- document = document or "*"
- local sd = setups[document]
- if not sd then sd = { } setups[document] = sd end
- for k=1,#sd do
- if sd[k] == setup then sd[k] = nil break end
- end
- if what == 1 then
- if trace_loading then
- commands.writestatus("lxml","prepending setup %s for %s",setup,document)
- end
- insert(sd,1,setup)
- elseif what == 2 then
- if trace_loading then
- commands.writestatus("lxml","appending setup %s for %s",setup,document)
- end
- insert(sd,setup)
- elseif what == 3 then
- if trace_loading then
- commands.writestatus("lxml","inserting setup %s for %s before %s",setup,document,where)
- end
- table.insert_before_value(sd,setup,where)
- elseif what == 4 then
- if trace_loading then
- commands.writestatus("lxml","inserting setup %s for %s after %s",setup,document,where)
- end
- table.insert_after_value(sd,setup,where)
- end
-end
-
-function lxml.flushsetups(...)
- local done = { }
- for _, document in ipairs({...}) do
- local sd = setups[document]
- if sd then
- for k=1,#sd do
- local v= sd[k]
- if not done[v] then
- if trace_loading then
- commands.writestatus("lxml","applying setup %02i = %s to %s",k,v,document)
- end
- texsprint(ctxcatcodes,format("\\directsetup{%s}",v))
- done[v] = true
- end
- end
- elseif trace_loading then
- commands.writestatus("lxml","no setups for %s",document)
- end
- end
-end
-
-function lxml.resetsetups(document)
- if trace_loading then
- commands.writestatus("lxml","resetting all setups for %s",document)
- end
- setups[document] = { }
-end
-
-function lxml.removesetup(document,setup)
- local s = setups[document]
- if s then
- for i=1,#s do
- if s[i] == setup then
- if trace_loading then
- commands.writestatus("lxml","removing setup %s for %s",setup,document)
- end
- remove(t,i)
- break
- end
- end
- end
-end
-
-local found, isempty = xml.found, xml.isempty
-
-function lxml.doif (id,pattern) commands.doif (found(get_id(id),pattern,false)) end
-function lxml.doifnot (id,pattern) commands.doifnot (found(get_id(id),pattern,false)) end
-function lxml.doifelse (id,pattern) commands.doifelse(found(get_id(id),pattern,false)) end
-
--- todo: if no second arg or second arg == "" then quick test
-
-function lxml.doiftext (id,pattern) commands.doif (found (get_id(id),pattern,true)) end
-function lxml.doifnottext (id,pattern) commands.doifnot (found (get_id(id),pattern,true)) end
-function lxml.doifelsetext (id,pattern) commands.doifelse(found (get_id(id),pattern,true)) end
-
--- special case: "*" and "" -> self else lpath lookup
-
-function lxml.doifelseempty(id,pattern) commands.doifelse(isempty(get_id(id),pattern ~= "" and pattern ~= nil)) end -- not yet done, pattern
-
--- status info
-
-statistics.register("xml load time", function()
- local n = lxml.n
- if n > 0 then
- local stats = xml.statistics()
- return format("%s seconds, lpath calls: %s, cached calls: %s", statistics.elapsedtime(xml), stats.lpathcalls, stats.lpathcached)
- else
- return nil
- end
-end)
-
-statistics.register("lxml load time", function()
- local n = #lxml.self
- if n > 0 then
- return format("%s seconds preparation, backreferences: %i", statistics.elapsedtime(lxml),n)
- else
- return nil
- end
-end)
diff --git a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
index 34a14f9d9f5..0f04d048808 100644
--- a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv
@@ -11,36 +11,47 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D Todo: auto apply setups (manage at lua end)
+
\writestatus{loading}{ConTeXt XML Support / Initialization}
-\registerctxluafile{lxml-tab}{1.001}
-\registerctxluafile{lxml-pth}{1.001}
-\registerctxluafile{lxml-ent}{1.001}
-\registerctxluafile{lxml-mis}{1.001}
-\registerctxluafile{lxml-ini}{1.001}
+%registerctxluafile{lxml-tab}{1.001} % loader
+%registerctxluafile{lxml-lpt}{1.001} % parser
+%registerctxluafile{lxml-xml}{1.001} % xml finalizers
+%registerctxluafile{lxml-aux}{1.001} % extras using parser
+%registerctxluafile{lxml-mis}{1.001} % extras independent of parser
+\registerctxluafile{lxml-ent}{1.001} % entity hacks
+\registerctxluafile{lxml-tex}{1.001} % tex finalizers
+\registerctxluafile{lxml-dir}{1.001} % ctx hacks
\unprotect
+\def\c!entities{entities} % to be internationalized
+
\def\xmlmain #1{\ctxlua{lxml.main("#1")}}
+\def\xmlmatch #1{\ctxlua{lxml.match("#1")}}
\def\xmlall #1#2{\ctxlua{lxml.all("#1","#2")}}
-\def\xmlatt #1#2{\ctxlua{lxml.attribute("#1","/","#2")}}
-\def\xmlattdef #1#2#3{\ctxlua{lxml.attribute("#1","/","#2","#3")}}
+\def\xmlatt #1#2{\ctxlua{lxml.att("#1","#2")}}
+\def\xmlattdef #1#2#3{\ctxlua{lxml.att("#1","#2","#3")}}
+\def\xmlchainatt #1#2{\ctxlua{lxml.chainattribute("#1","/","#2")}}
+\def\xmlchainattdef #1#2#3{\ctxlua{lxml.chainattribute("#1","/","#2","#3")}}
\def\xmlattribute #1#2#3{\ctxlua{lxml.attribute("#1","#2","#3")}}
\def\xmlattributedef #1#2#3#4{\ctxlua{lxml.attribute("#1","#2","#3","#4")}}
\def\xmlcommand #1#2#3{\ctxlua{lxml.command("#1","#2","#3")}}
\def\xmlconcat #1#2#3{\ctxlua{lxml.concat("#1","#2",[[\detokenize{#3}]])}}
\def\xmlconcatrange#1#2#3#4#5{\ctxlua{lxml.concatrange("#1","#2","#3","#4",[[\detokenize{#5}]])}}
\def\xmlcount #1#2{\ctxlua{lxml.count("#1","#2")}}
-\def\xmldelete #1#2{\ctxlua{xml.delete(lxml.id("#1"),"#2")}}
+\def\xmldelete #1#2{\ctxlua{lxml.delete("#1","#2")}}
\def\xmldirectives #1{\ctxlua{lxml.directives.setup("#1")}}
\def\xmldirectivesbefore #1{\ctxlua{lxml.directives.before("#1")}}
\def\xmldirectivesafter #1{\ctxlua{lxml.directives.after("#1")}}
\def\xmlfilter #1#2{\ctxlua{lxml.filter("#1",\!!bs#2\!!es)}}
+\def\xmlfilterlist #1#2{\ctxlua{lxml.filterlist("#1",\!!bs#2\!!es)}}
+\def\xmlfunction #1#2{\ctxlua{lxml["function"]("#1",\!!bs#2\!!es)}}
\def\xmlfirst #1#2{\ctxlua{lxml.first("#1","#2")}}
\def\xmlflush #1{\ctxlua{lxml.flush("#1")}}
-% \def\xmlcontent #1{\ctxlua{lxml.content("#1")}}
-% \def\xmlstrip #1{\ctxlua{lxml.strip("#1")}}
-% \def\xmlflushstripped #1{\ctxlua{lxml.strip("#1",true)}}
+%def\xmlcontent #1{\ctxlua{lxml.content("#1")}}
+%def\xmlflushstripped #1{\ctxlua{lxml.strip("#1",true)}}
\def\xmldirect #1{\ctxlua{lxml.direct("#1")}} % in loops, not dt but root
\def\xmlidx #1#2#3{\ctxlua{lxml.idx("#1","#2",\number#3)}}
\def\xmlinclude #1#2#3{\ctxlua{lxml.include("#1","#2","#3",true)}}
@@ -48,18 +59,14 @@
\def\xmlinfo #1{\hbox{\ttxx[\ctxlua{lxml.info("#1")}]}}
\def\xmlshow #1{\startpacked\ttx\xmlverbatim{#1}\stoppacked}
\def\xmllast #1#2{\ctxlua{lxml.last("#1","#2")}}
-\def\xmlload #1#2{\ctxlua{lxml.load("#1","#2")}}
-\def\xmlloadbuffer #1#2{\ctxlua{lxml.loadbuffer("#1","#2")}}
-\def\xmlloaddata #1#2{\ctxlua{lxml.loaddata("#1",\!!bs#2\!!es)}}
-\def\xmlloadregistered #1#2{\ctxlua{lxml.loadregistered("#1")}}
-\def\xmlloaddirectives #1{\ctxlua{lxml.directives.load("#1")}}
\def\xmlname #1{\ctxlua{lxml.name("#1")}}
\def\xmlnamespace #1{\ctxlua{lxml.namespace("#1")}}
\def\xmlnonspace #1#2{\ctxlua{lxml.nonspace("#1","#2")}}
\def\xmlraw #1#2{\ctxlua{lxml.raw("#1","#2")}}
+\def\xmlcontext #1#2{\ctxlua{lxml.context("#1","#2")}}
+\def\xmlflushcontext #1{\ctxlua{lxml.context("#1")}}
\def\xmlsnippet #1#2{\ctxlua{lxml.snippet("#1",#2)}}
\def\xmlelement #1#2{\ctxlua{lxml.element("#1",#2)}}
-\def\xmlnofelements #1{\ctxlua{lxml.nofelements("#1")}}
\def\xmlregisterns #1#2{\ctxlua{xml.registerns("#1","#2")}} % document
\def\xmlremapname #1#2#3#4{\ctxlua{xml.remapname(lxml.id("#1"),"#2","#3","#4")}} % element
\def\xmlremapnamespace #1#2#3{\ctxlua{xml.rename_space(lxml.id("#1"),"#2","#3")}} % document
@@ -67,17 +74,23 @@
\def\xmlsetfunction #1#2#3{\ctxlua{lxml.setaction("#1","#2",#3)}}
\def\xmlsetsetup #1#2#3{\ctxlua{lxml.setsetup("#1","#2","#3")}}
\def\xmlstrip #1#2{\ctxlua{lxml.strip("#1","#2")}}
-\def\xmlstripped #1#2{\ctxlua{lxml.stripped("#1","#2")}}
\def\xmlstripnolines #1#2{\ctxlua{lxml.strip("#1","#2",true)}}
+\def\xmlstripanywhere #1#2{\ctxlua{lxml.strip("#1","#2",true,true)}}
+\def\xmlstripped #1#2{\ctxlua{lxml.stripped("#1","#2")}}
\def\xmlstrippednolines #1#2{\ctxlua{lxml.stripped("#1","#2",true)}}
\def\xmltag #1{\ctxlua{lxml.tag("#1")}}
\def\xmltext #1#2{\ctxlua{lxml.text("#1","#2")}}
-\def\xmltags #1#2{\ctxlua{lxml.tags("#1","#2")}}
-\def\xmlutfize #1{\ctxlua{lxml.utfize("#1")}}
\def\xmlverbatim #1{\ctxlua{lxml.verbatim("#1")}}
\def\xmldisplayverbatim #1{\ctxlua{lxml.displayverbatim("#1")}}
\def\xmlinlineverbatim #1{\ctxlua{lxml.inlineverbatim("#1")}}
+\def\xmlload #1#2{\ctxlua{lxml.load("#1","#2","\@@xmentities","\@@xmcompress")}}
+\def\xmlloadbuffer #1#2{\ctxlua{lxml.loadbuffer("#1","#2","\@@xmentities","\@@xmcompress")}}
+\def\xmlloaddata #1#2{\ctxlua{lxml.loaddata("#1",\!!bs#2\!!es,"\@@xmentities","\@@xmcompress")}}
+\def\xmlloadregistered #1#2{\ctxlua{lxml.loadregistered("#1","\@@xmentities","\@@xmcompress")}}
+\def\xmlloaddirectives #1{\ctxlua{lxml.directives.load("any:///#1")}}
+\def\xmlpos #1{\ctxlua{lxml.pos("#1")}}
+
%def\xmldoifelse #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",false))}}
%def\xmldoifelsetext #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",true ))}}
@@ -88,17 +101,15 @@
% todo: \xmldoifelseattribute
-\def\xmldoif #1#2{\ctxlua{lxml.doif("#1","#2")}}
-\def\xmldoifnot #1#2{\ctxlua{lxml.doifnot("#1","#2")}}
-\def\xmldoifelse #1#2{\ctxlua{lxml.doifelse("#1","#2")}}
-\def\xmldoiftext #1#2{\ctxlua{lxml.doiftext("#1","#2")}}
-\def\xmldoifnottext #1#2{\ctxlua{lxml.doifnottext("#1","#2")}}
-\def\xmldoifelsetext #1#2{\ctxlua{lxml.doifelsetext("#1","#2")}}
-\def\xmldoifelseempty #1#2{\ctxlua{lxml.doifelseempty("#1","#2")}} % #2, "*" or "" == self not yet implemented
-\def\xmldoifelseselfempty #1{\ctxlua{lxml.doifelseempty("#1")}}
+\def\xmldoif #1#2{\ctxlua{lxml.doif (\!!bs#1\!!es,\!!bs#2\!!es)}}
+\def\xmldoifnot #1#2{\ctxlua{lxml.doifnot (\!!bs#1\!!es,\!!bs#2\!!es)}}
+\def\xmldoifelse #1#2{\ctxlua{lxml.doifelse (\!!bs#1\!!es,\!!bs#2\!!es)}}
+\def\xmldoiftext #1#2{\ctxlua{lxml.doiftext (\!!bs#1\!!es,\!!bs#2\!!es)}}
+\def\xmldoifnottext #1#2{\ctxlua{lxml.doifnottext (\!!bs#1\!!es,\!!bs#2\!!es)}}
+\def\xmldoifelsetext #1#2{\ctxlua{lxml.doifelsetext(\!!bs#1\!!es,\!!bs#2\!!es)}}
-\def\xmldefaulttotext #1{\ifcase\xmlprocessingmode\or\or \ctxlua{lxml.set_command_to_text("#1")}\fi}
-\def\xmldefaulttonone #1{\ifcase\xmlprocessingmode\or\or\or\ctxlua{lxml.set_command_to_none("#1")}\fi}
+%def\xmldoifelseempty #1#2{\ctxlua{lxml.doifelseempty("#1","#2")}} % #2, "*" or "" == self not yet implemented
+%def\xmldoifelseselfempty #1{\ctxlua{lxml.doifelseempty("#1")}}
% \startxmlsetups xml:include
% \xmlinclude{main}{include}{filename|href}
@@ -106,15 +117,17 @@
%
% \xmlprependsetup{xml:include}
-\let\xmlgrab\xmlsetsetup
+\let\xmlgrab\xmlsetsetup % obsolete
+\let\xmlself\s!unknown % obsolete
+
+\def\xmlsetup#1#2{\setupwithargument{#2}{#1}}
-\def\xmlsetup#1#2% % we pass the reference so that we have access to the frozen number
- {\def\xmlself{#1}% % by using #1 inside a setup; maybe self becomes obsolete
- \setupwithargument{#2}{#1}}
+\let\xmls\xmlsetup
+\let\xmlw\setupwithargument
\newtoks \registeredxmlsetups
-% todo: 1:xml:whatever alwas before 3:xml:something
+% todo: 1:xml:whatever always before 3:xml:something
\def\xmlprependsetup #1{\ctxlua{lxml.installsetup(1,"*","#1")}}
\def\xmlappendsetup #1{\ctxlua{lxml.installsetup(2,"*","#1")}}
@@ -129,7 +142,7 @@
\def\xmlremovesetup #1{\ctxlua{lxml.removesetup("*","#1")}}
\def\xmlremovedocumentsetup #1#2{\ctxlua{lxml.removesetup("#1","#2")}}
-\def\xmlflushdocumentsetups #1{\ctxlua{lxml.flushsetups("*","#1")}}
+\def\xmlflushdocumentsetups #1#2{\ctxlua{lxml.flushsetups("#1","*","#2")}} % #1 == id where to apply * and #2
\def\xmlresetdocumentsetups #1{\ctxlua{lxml.resetsetups("#1")}}
\let\xmlregistersetup \xmlappendsetup
@@ -143,58 +156,59 @@
\xmldefaulttotext\xmldocument % after include
\xmlstoptiming}
-\def\xmlregistereddocumentsetups#1%
+\def\xmlregistereddocumentsetups#1#2% id setups
{\xmlstarttiming
% todo: test for duplicates !
- \xmlflushdocumentsetups{#1}%
+ \xmlflushdocumentsetups{#1}{#2}%
\xmldefaulttotext{#1}% after include
\xmlstoptiming}
\def\xmlstarttiming{\ctxlua{statistics.starttiming(lxml)}}
\def\xmlstoptiming {\ctxlua{statistics.stoptiming (lxml)}}
-\def\doxmlprocess#1#2#3#4%
+\def\doxmlprocess#1#2#3#4#5% flag \loader id name what initializersetup
{\begingroup
- \edef\xmldocument{#2}% #2 can be \xmldocument and set as such
- #1{#2}{#3}%
- \ifcase\xmlprocessingmode
- \enableXML
- \else
- \setcatcodetable\notcatcodes
- \fi
- \doifelsenothing{#4}
- {\directsetup{xml:process}}
- {\directsetup{#4}}%
+ \edef\xmldocument{#3}% #2 can be \xmldocument and set as such
+ %xmlpushdocument{#3}%
+ #2{#3}{#4}%
+ \setcatcodetable\notcatcodes
+ \doifelsenothing{#5}
+ {\xmlsetup{#3}{xml:process}}
+ {\xmlsetup{#3}{#5}}%
+ %xmlpopdocument
\endgroup}
-\def\xmlprocessfile {\doxmlprocess\xmlload}
-\def\xmlprocessdata {\doxmlprocess\xmlloaddata}
-\def\xmlprocessbuffer {\doxmlprocess\xmlloadbuffer}
-\def\xmlprocessregistered{\doxmlprocess\xmlloadregistered}
+\def\xmlprocessfile {\doxmlprocess\plusone \xmlload}
+\def\xmlprocessdata {\doxmlprocess\zerocount\xmlloaddata}
+\def\xmlprocessbuffer {\doxmlprocess\zerocount\xmlloadbuffer}
+\def\xmlprocessregistered{\doxmlprocess\zerocount\xmlloadregistered}
\let\xmlprocess \xmlprocessfile
+\startxmlsetups xml:flush
+ \xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:process
+ \xmlregistereddocumentsetups{#1}{#1}
+ \xmlmain{#1}
+\stopxmlsetups
+
+\def\xmlloadonly#1#2#3%
+ {\xmlload{#1}{#2}%
+ \xmlregistereddocumentsetups{#1}{#3}}
+
% beware: \xmlmain takes the real root, so also processing
% instructions preceding the root element; well, in some
% sense that is the root
-\startsetups xml:process
- \xmlregistereddocumentsetups\xmldocument
- \xmlmain\xmldocument
-\stopsetups
-
-\long\def\xmlloop#1#2#3%
- {\def\xmli##1##2{\xmlidx{#1}{#2/##1}{##2}}%
- \dorecurse{\xmlcount{#1}{#2}}{#3}}
-
\long\def\xmlconnect#1#2#3% inefficient
{\scratchcounter\xmlcount{#1}{#2}\relax
\ifcase\scratchcounter \or
- \xmlall{#1}{#2}%
+ \xmlall{#1}{#2}%
\else
- \dorecurse \scratchcounter {
- \ifnum\recurselevel>\plusone#3\fi
- \xmlidx{#1}{#2}{\recurselevel}
- }
+ \dorecurse \scratchcounter
+ {\ifnum\recurselevel>\plusone#3\fi
+ \xmlidx{#1}{#2}\recurselevel}%
\fi}
\def\xmlcdataobeyedline {\obeyedline}
@@ -208,10 +222,10 @@
% \xmlsetfunction{main}{verbatim}{lxml.displayverbatim}
% \xmlsetfunction{main}{verb} {lxml.inlineverbatim}
-% \def\startxmldisplayverbatim[#1]{}
-% \def\stopxmldisplayverbatim {}
-% \def\startxmlinlineverbatim [#1]{}
-% \def\stopxmlinlineverbatim {}
+% \unexpanded\def\startxmldisplayverbatim[#1]{}
+% \unexpanded\def\stopxmldisplayverbatim {}
+% \unexpanded\def\startxmlinlineverbatim [#1]{}
+% \unexpanded\def\stopxmlinlineverbatim {}
% we use an xml: namespace so one has to define a suitable verbatim, say
%
@@ -219,35 +233,35 @@
%
% this is experimental!
-\def\startxmldisplayverbatim[#1]%
+\unexpanded\def\startxmldisplayverbatim[#1]%
{\startpacked % \begingroup
\let\currenttypingclass\??tp
\edef\currenttyping{xml:#1}%
- \def\stopxmldisplayverbatim
+ \unexpanded\def\stopxmldisplayverbatim
{\endofverbatimlines
\stoppacked} % \endgroup
- \mkinitializeverbatim
+ \doinitializeverbatim
\beginofverbatimlines}
-\def\startxmlinlineverbatim[#1]%
+\unexpanded\def\startxmlinlineverbatim[#1]%
{\begingroup
\let\currenttypingclass\??ty
\edef\currenttyping{xml:#1}%
\let\stopxmldisplayverbatim\endgroup
- \mkinitializeverbatim}
+ \doinitializeverbatim}
% will move but is developed for xml
\newtoks \collectingtoks
-\def\startcollect#1\stopcollect
+\unexpanded\def\startcollect#1\stopcollect
{\collectingtoks\@EA{\the\collectingtoks#1}}
-\def\startexpandedcollect#1\stopexpandedcollect
- {\expanded{\collectingtoks{\the\collectingtoks#1}}}
+\unexpanded\def\startexpandedcollect#1\stopexpandedcollect
+ {\normalexpanded{\collectingtoks{\the\collectingtoks#1}}}
-\def\startcollecting{\collectingtoks\emptytoks}
-\def\stopcollecting {\the\collectingtoks}
+\unexpanded\def\startcollecting{\collectingtoks\emptytoks}
+\unexpanded\def\stopcollecting {\the\collectingtoks}
\def\inlinemessage #1{\dontleavehmode{\tttf#1}}
\def\displaymessage#1{\blank\inlinemessage{#1}\blank}
@@ -263,98 +277,43 @@
% setting up xml:
%
-% \setupxml[\c!method=mkii] % mixed mkiv and mkii
-% \setupxml[\c!method=mkiv,\c!default=] % mkiv only
-% \setupxml[\c!method=mkiv,\c!default=\v!none] % mkiv only, undefined -> hidden
-% \setupxml[\c!method=mkiv,\c!default=\v!text] % mkiv only, undefined -> text
+% \setupxml[\c!default=] % mkiv only == text
+% \setupxml[\c!default=\v!none] % mkiv only, undefined -> hidden
+% \setupxml[\c!default=\v!text] % mkiv only, undefined -> text
% \def\xmlctxdirective#1#2#3{\doif{#1}{clue}{\doif{#2}{page}}{\page[#3]}}
-\chardef\xmlprocessingmode=0 % 0=mixed, 1=mkivonly, 2=mkivonly-default-text, 3=mkivonly-default-none
-
-% \setupxml[method=mkiv,strip=yes,entities=yes,default=text]
+\chardef\xmlprocessingmode=0 % 0=unset, 1=text, 2=hidden
\newtoks\everysetupxml
-\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml}
-
-\def\c!entities{entities} % to be internationalized
-\def\s!mkiv {mkiv}
-\def\s!mkii {mkii}
-
-% entities
-
-\newif\ifautoXMLentities
-
-\def\xmlkeepentities{\ctxlua{lxml.reset_entityhandler()}}
-\def\xmlmkiientities{\ctxlua{lxml.set_mkii_entityhandler()}\autoXMLentitiestrue}
-\def\xmlmkiventities{\ctxlua{lxml.set_mkiv_entityhandler()}}
-
-\let\xmlresolveentities\xmlmkiventities % will become \xmlmkiventities
+\unexpanded\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml}
-\letvalue{\??xm:1:\s!mkii }\zerocount
-\letvalue{\??xm:1:\s!mkiv }\plusone
-\letvalue{\??xm:2:\v!none }\plusone
-\letvalue{\??xm:2:\v!text }\plustwo
-\letvalue{\??xm:2:\v!hidden}\plusthree
+\letvalue{\??xm:\s!default:\v!normal}\zerocount
+\letvalue{\??xm:\s!default:\v!none }\zerocount
+\letvalue{\??xm:\s!default:\v!text }\plusone
+\letvalue{\??xm:\s!default:\v!hidden}\plustwo
-\letvalue{\??xm:ii:\v!yes }\xmlresolveentities
-\letvalue{\??xm:ii:\v!no }\xmlkeepentities
-\letvalue{\??xm:ii:\s!mkii}\xmlmkiientities
-\letvalue{\??xm:ii:\s!mkiv}\xmlmkiventities
-
-\letvalue{\??xm:iv:\v!yes }\xmlresolveentities
-\letvalue{\??xm:iv:\v!no }\xmlkeepentities
-\letvalue{\??xm:iv:\s!mkii}\xmlmkiventities
-\letvalue{\??xm:iv:\s!mkiv}\xmlmkiventities
+\def\xmldefaulttotext#1%
+ {\ifcase\xmlprocessingmode
+ % unset
+ \or
+ \ctxlua{lxml.set_command_to_text("#1")}% 1
+ \or
+ \ctxlua{lxml.set_command_to_none("#1")}% 2
+ \else
+ % unset
+ \fi}
\appendtoks
- \chardef\xmlprocessingmode\executeifdefined{\??xm:1:\@@xmmethod}\zerocount
- \ifcase\xmlprocessingmode
- % mkii, permits both methods
- \executeifdefined{\??xm:ii:\@@xmentities}\xmlkeepentities
- \or
- % mkiv, mkiv exclusively
- \chardef\xmlprocessingmode\executeifdefined{\??xm:2:\@@xmdefault}\plusone
- \executeifdefined{\??xm:iv:\@@xmentities}\xmlresolveentities
- \else
- % unset
- \fi
- \ifcase\xmlprocessingmode
- \ctxlua{characters.setmkiientities()}%
- \else
- \ctxlua{characters.setmkiventities()}%
- \fi
- \doifelse\@@xmcompress\v!yes % this key may change, maybe compress=yes|no
- {\ctxlua{xml.strip_cm_and_dt=true}}
- {\ctxlua{xml.strip_cm_and_dt=false}}%
+ \chardef\xmlprocessingmode\executeifdefined{\??xm:\s!default:\@@xmdefault}\plusone
\to \everysetupxml
\def\xmlinitialize{\the\everysetupxml}
-\newcount\charactersactiveoffset \charactersactiveoffset="10000
-
-\startextendcatcodetable\ctxcatcodes
- \catcode\numexpr\charactersactiveoffset+`<\relax=13
- \catcode\numexpr\charactersactiveoffset+`&\relax=13
- \catcode\numexpr\charactersactiveoffset+`>\relax=13
-\stopextendcatcodetable
-\startextendcatcodetable\xmlcatcodes
- \catcode\numexpr\charactersactiveoffset+`<\relax=13
- \catcode\numexpr\charactersactiveoffset+`&\relax=13
- \catcode\numexpr\charactersactiveoffset+`>\relax=13
-\stopextendcatcodetable
-
-\ctxlua { % entities are remembered in the format
- characters.remapentity("<",characters.active_offset + utf.byte("<"))
- characters.remapentity("&",characters.active_offset + utf.byte("&"))
- characters.remapentity(">",characters.active_offset + utf.byte(">"))
-}
-
\setupxml
- [\c!method=mkii, % mixed mode
- \c!default=\v!hidden, % ignore elements that are not defined
+ [\c!default=, % flush all
\c!compress=\v!no, % strip comment
\c!entities=\v!yes] % replace entities
@@ -376,33 +335,80 @@
%
% mkii: [\processXMLbuffer]\quad mkiv: [\xmlprocessbuffer{main}{}{}]
-% some mkii commands, but mkiv-ified
-
-\def\xmlmapvalue#1#2#3{\setvalue{\??xm:v:#1:#2}{#3}} % keep #3 to grab spaces
-\def\xmlvalue #1#2#3{\executeifdefined{\??xm:v:#1:#2}{#3}}
+\def\xmlmapvalue #1#2#3{\setvalue{\??xm:v:#1:#2}{#3}} % keep #3 to grab spaces
+\def\xmlvalue #1#2#3{\executeifdefined{\??xm:v:#1:#2}{#3}}
+%def\xmlvalue #1#2{\ifcsname\??xm:v:#1:#2\endcsname\csname\??xm:v:#1:#2\expandafter\expandafter\gobbleoneargument\expandafter\endcsname\else\expandafter\firstofoneargument\fi}
+\def\xmldoifelsevalue #1#2{\ifcsname\??xm:v:#1:#2\endcsname\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi}
\let\xmlmapval\xmlmapvalue
\let\xmlval \xmlvalue
-% brrrr, give this at the top of a style that needs to stub mkiv loading
+%D Experimental:
+
+\def\xmlgetindex #1{\ctxlua{lxml.getindex("\xmldocument","#1")}}
+\def\xmlrawindex #1{\ctxlua{lxml.rawindex("#1")}}
+\def\xmlwithindex #1#2{\ctxlua{lxml.withindex("\xmldocument","#1","#2")}}
+\def\xmlreference #1#2{\string\xmlwithindex{#1}{#2}}
+
+%D Entities:
+
+\chardef\xmlautoentities=1 % 0=off, 1=upper, 2=upper,lower
+
+\let\isolatedentity\firstofoneargument
+
+\def\xmlsetentity#1#2{\ctxlua{xml.register_entity('#1',\!!bs\detokenize{#2}\!!es)}}
+\def\xmltexentity#1#2{\ctxlua{xml.register_entity('#1',\!!bs\detokenize{\isolatedentity{#2}}\!!es)}}
-\def\remapXMLtoMKIV
- {\ifx\xmldocument\undefined\def\xmldocument{main}\fi
- \def\processXMLfile ##1{\xmlprocessfile \xmldocument{##1}{}}%
- \def\processXMLfilegrouped ##1{\xmlprocessfile \xmldocument{##1}{}}% maybe still grouped?
- \def\processXMLbuffer {\dosingleempty\doprocessXMLbuffer}%
- \def\doprocessXMLbuffer [##1]{\xmlprocessbuffer\xmldocument{##1}{}}%
- \def\XMLdata ##1{\xmlprocessdata \xmldocument{##1}{}}%
- \def\startXMLdata##1\stopXMLdata{\xmlprocessdata \xmldocument{##1}{}}}
+% \xmlsetentity{tex}{\TEX{}} % {} needed
-\let\normalprocessXMLfilegrouped\processXMLfilegrouped
+\unexpanded\def\xmle
+ {\ifcase\xmlautoentities
+ \expandafter\xmle@none
+ \or
+ \expandafter\xmle@upper
+ \or
+ \expandafter\xmle@upperlower
+ \else
+ \expandafter\xmle@none
+ \fi}
+
+\def\xmle@none#1#2% safe
+ {#1}
-\def\processXMLfileMKIV % one-shot, will become obsolete, personal hack
- {\dosingleempty\doprocessXMLfileMKIV}
+\def\xmle@upper#1#2% can be abbreviation
+ {\ifcsname#2\endcsname
+ \csname#2\expandafter\endcsname
+ \else
+ #1%
+ \fi}
-\def\doprocessXMLfileMKIV[#1]%
- {\def\processXMLfilegrouped##1%
- {\let\processXMLfilegrouped\normalprocessXMLfilegrouped
- \doifelsenothing{#1}{\xmlprocess{main}{##1}{}}{\xmlprocess{#1}{##1}{}}}}
+\def\xmle@upperlower#1#2% can be anything, so unsafe
+ {\ifcsname#2\endcsname
+ \csname#2\expandafter\endcsname
+ \else\ifcsname#1\endcsname
+ \csname#1\expandafter\expandafter\expandafter\endcsname
+ \else
+ #1%
+ \fi\fi}
\protect \endinput
+
+% \newcount\charactersactiveoffset \charactersactiveoffset="10000
+%
+% \startextendcatcodetable\ctxcatcodes
+% \catcode\numexpr\charactersactiveoffset+`<\relax=13
+% \catcode\numexpr\charactersactiveoffset+`&\relax=13
+% \catcode\numexpr\charactersactiveoffset+`>\relax=13
+% \stopextendcatcodetable
+%
+% \startextendcatcodetable\xmlcatcodes % not needed
+% \catcode\numexpr\charactersactiveoffset+`<\relax=13
+% \catcode\numexpr\charactersactiveoffset+`&\relax=13
+% \catcode\numexpr\charactersactiveoffset+`>\relax=13
+% \stopextendcatcodetable
+%
+% \ctxlua { % entities are remembered in the format
+% characters.remapentity("<",characters.active_offset + utf.byte("<"))
+% characters.remapentity("&",characters.active_offset + utf.byte("&"))
+% characters.remapentity(">",characters.active_offset + utf.byte(">"))
+% }
diff --git a/Master/texmf-dist/tex/context/base/lxml-lpt.lua b/Master/texmf-dist/tex/context/base/lxml-lpt.lua
new file mode 100644
index 00000000000..bddbe48685c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-lpt.lua
@@ -0,0 +1,1259 @@
+if not modules then modules = { } end modules ['lxml-pth'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- e.ni is only valid after a filter run
+
+local concat, remove, insert = table.concat, table.remove, table.insert
+local type, next, tonumber, tostring, setmetatable, loadstring = type, next, tonumber, tostring, setmetatable, loadstring
+local format, upper, lower, gmatch, gsub, find, rep = string.format, string.upper, string.lower, string.gmatch, string.gsub, string.find, string.rep
+local lpegmatch = lpeg.match
+
+-- beware, this is not xpath ... e.g. position is different (currently) and
+-- we have reverse-sibling as reversed preceding sibling
+
+--[[ldx--
+<p>This module can be used stand alone but also inside <l n='mkiv'/> in
+which case it hooks into the tracker code. Therefore we provide a few
+functions that set the tracers. Here we overload a previously defined
+function.</p>
+<p>If I can get in the mood I will make a variant that is XSLT compliant
+but I wonder if it makes sense.</P>
+--ldx]]--
+
+--[[ldx--
+<p>Expecially the lpath code is experimental, we will support some of xpath, but
+only things that make sense for us; as compensation it is possible to hook in your
+own functions. Apart from preprocessing content for <l n='context'/> we also need
+this module for process management, like handling <l n='ctx'/> and <l n='rlx'/>
+files.</p>
+
+<typing>
+a/b/c /*/c
+a/b/c/first() a/b/c/last() a/b/c/index(n) a/b/c/index(-n)
+a/b/c/text() a/b/c/text(1) a/b/c/text(-1) a/b/c/text(n)
+</typing>
+--ldx]]--
+
+local trace_lpath = false if trackers then trackers.register("xml.path", function(v) trace_lpath = v end) end
+local trace_lparse = false if trackers then trackers.register("xml.parse", function(v) trace_lparse = v end) end
+local trace_lprofile = false if trackers then trackers.register("xml.profile", function(v) trace_lpath = v trace_lparse = v trace_lprofile = v end) end
+
+--[[ldx--
+<p>We've now arrived at an interesting part: accessing the tree using a subset
+of <l n='xpath'/> and since we're not compatible we call it <l n='lpath'/>. We
+will explain more about its usage in other documents.</p>
+--ldx]]--
+
+local lpathcalls = 0 function xml.lpathcalls () return lpathcalls end
+local lpathcached = 0 function xml.lpathcached() return lpathcached end
+
+xml.functions = xml.functions or { } -- internal
+xml.expressions = xml.expressions or { } -- in expressions
+xml.finalizers = xml.finalizers or { } -- fast do-with ... (with return value other than collection)
+xml.specialhandler = xml.specialhandler or { }
+
+local functions = xml.functions
+local expressions = xml.expressions
+local finalizers = xml.finalizers
+
+finalizers.xml = finalizers.xml or { }
+finalizers.tex = finalizers.tex or { }
+
+local function fallback (t, name)
+ local fn = finalizers[name]
+ if fn then
+ t[name] = fn
+ else
+ logs.report("xml","unknown sub finalizer '%s'",tostring(name))
+ fn = function() end
+ end
+ return fn
+end
+
+setmetatable(finalizers.xml, { __index = fallback })
+setmetatable(finalizers.tex, { __index = fallback })
+
+xml.defaultprotocol = "xml"
+
+-- as xsl does not follow xpath completely here we will also
+-- be more liberal especially with regards to the use of | and
+-- the rootpath:
+--
+-- test : all 'test' under current
+-- /test : 'test' relative to current
+-- a|b|c : set of names
+-- (a|b|c) : idem
+-- ! : not
+--
+-- after all, we're not doing transformations but filtering. in
+-- addition we provide filter functions (last bit)
+--
+-- todo: optimizer
+--
+-- .. : parent
+-- * : all kids
+-- / : anchor here
+-- // : /**/
+-- ** : all in between
+--
+-- so far we had (more practical as we don't transform)
+--
+-- {/test} : kids 'test' under current node
+-- {test} : any kid with tag 'test'
+-- {//test} : same as above
+
+-- evaluator (needs to be redone, for the moment copied)
+
+-- todo: apply_axis(list,notable) and collection vs single
+
+local apply_axis = { }
+
+apply_axis['root'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ local rt = ll
+ while ll do
+ ll = ll.__p__
+ if ll then
+ rt = ll
+ end
+ end
+ collected[#collected+1] = rt
+ end
+ return collected
+end
+
+apply_axis['self'] = function(list)
+--~ local collected = { }
+--~ for l=1,#list do
+--~ collected[#collected+1] = list[l]
+--~ end
+--~ return collected
+ return list
+end
+
+apply_axis['child'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ local dt = ll.dt
+ local en = 0
+ for k=1,#dt do
+ local dk = dt[k]
+ if dk.tg then
+ collected[#collected+1] = dk
+ dk.ni = k -- refresh
+ en = en + 1
+ dk.ei = en
+ end
+ end
+ ll.en = en
+ end
+ return collected
+end
+
+local function collect(list,collected)
+ local dt = list.dt
+ if dt then
+ local en = 0
+ for k=1,#dt do
+ local dk = dt[k]
+ if dk.tg then
+ collected[#collected+1] = dk
+ dk.ni = k -- refresh
+ en = en + 1
+ dk.ei = en
+ collect(dk,collected)
+ end
+ end
+ list.en = en
+ end
+end
+apply_axis['descendant'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ collect(list[l],collected)
+ end
+ return collected
+end
+
+local function collect(list,collected)
+ local dt = list.dt
+ if dt then
+ local en = 0
+ for k=1,#dt do
+ local dk = dt[k]
+ if dk.tg then
+ collected[#collected+1] = dk
+ dk.ni = k -- refresh
+ en = en + 1
+ dk.ei = en
+ collect(dk,collected)
+ end
+ end
+ list.en = en
+ end
+end
+apply_axis['descendant-or-self'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ if ll.special ~= true then -- catch double root
+ collected[#collected+1] = ll
+ end
+ collect(ll,collected)
+ end
+ return collected
+end
+
+apply_axis['ancestor'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ while ll do
+ ll = ll.__p__
+ if ll then
+ collected[#collected+1] = ll
+ end
+ end
+ end
+ return collected
+end
+
+apply_axis['ancestor-or-self'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ collected[#collected+1] = ll
+ while ll do
+ ll = ll.__p__
+ if ll then
+ collected[#collected+1] = ll
+ end
+ end
+ end
+ return collected
+end
+
+apply_axis['parent'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local pl = list[l].__p__
+ if pl then
+ collected[#collected+1] = pl
+ end
+ end
+ return collected
+end
+
+apply_axis['attribute'] = function(list)
+ return { }
+end
+
+apply_axis['namespace'] = function(list)
+ return { }
+end
+
+apply_axis['following'] = function(list) -- incomplete
+--~ local collected = { }
+--~ for l=1,#list do
+--~ local ll = list[l]
+--~ local p = ll.__p__
+--~ local d = p.dt
+--~ for i=ll.ni+1,#d do
+--~ local di = d[i]
+--~ if type(di) == "table" then
+--~ collected[#collected+1] = di
+--~ break
+--~ end
+--~ end
+--~ end
+--~ return collected
+ return { }
+end
+
+apply_axis['preceding'] = function(list) -- incomplete
+--~ local collected = { }
+--~ for l=1,#list do
+--~ local ll = list[l]
+--~ local p = ll.__p__
+--~ local d = p.dt
+--~ for i=ll.ni-1,1,-1 do
+--~ local di = d[i]
+--~ if type(di) == "table" then
+--~ collected[#collected+1] = di
+--~ break
+--~ end
+--~ end
+--~ end
+--~ return collected
+ return { }
+end
+
+apply_axis['following-sibling'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ local p = ll.__p__
+ local d = p.dt
+ for i=ll.ni+1,#d do
+ local di = d[i]
+ if type(di) == "table" then
+ collected[#collected+1] = di
+ end
+ end
+ end
+ return collected
+end
+
+apply_axis['preceding-sibling'] = function(list)
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ local p = ll.__p__
+ local d = p.dt
+ for i=1,ll.ni-1 do
+ local di = d[i]
+ if type(di) == "table" then
+ collected[#collected+1] = di
+ end
+ end
+ end
+ return collected
+end
+
+apply_axis['reverse-sibling'] = function(list) -- reverse preceding
+ local collected = { }
+ for l=1,#list do
+ local ll = list[l]
+ local p = ll.__p__
+ local d = p.dt
+ for i=ll.ni-1,1,-1 do
+ local di = d[i]
+ if type(di) == "table" then
+ collected[#collected+1] = di
+ end
+ end
+ end
+ return collected
+end
+
+apply_axis['auto-descendant-or-self'] = apply_axis['descendant-or-self']
+apply_axis['auto-descendant'] = apply_axis['descendant']
+apply_axis['auto-child'] = apply_axis['child']
+apply_axis['auto-self'] = apply_axis['self']
+apply_axis['initial-child'] = apply_axis['child']
+
+local function apply_nodes(list,directive,nodes)
+ -- todo: nodes[1] etc ... negated node name in set ... when needed
+ -- ... currently ignored
+ local maxn = #nodes
+ if maxn == 3 then --optimized loop
+ local nns, ntg = nodes[2], nodes[3]
+ if not nns and not ntg then -- wildcard
+ if directive then
+ return list
+ else
+ return { }
+ end
+ else
+ local collected, m, p = { }, 0, nil
+ if not nns then -- only check tag
+ for l=1,#list do
+ local ll = list[l]
+ local ltg = ll.tg
+ if ltg then
+ if directive then
+ if ntg == ltg then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ elseif ntg ~= ltg then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ end
+ end
+ elseif not ntg then -- only check namespace
+ for l=1,#list do
+ local ll = list[l]
+ local lns = ll.rn or ll.ns
+ if lns then
+ if directive then
+ if lns == nns then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ elseif lns ~= nns then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ end
+ end
+ else -- check both
+ for l=1,#list do
+ local ll = list[l]
+ local ltg = ll.tg
+ if ltg then
+ local lns = ll.rn or ll.ns
+ local ok = ltg == ntg and lns == nns
+ if directive then
+ if ok then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ elseif not ok then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ end
+ end
+ end
+ return collected
+ end
+ else
+ local collected, m, p = { }, 0, nil
+ for l=1,#list do
+ local ll = list[l]
+ local ltg = ll.tg
+ if ltg then
+ local lns = ll.rn or ll.ns
+ local ok = false
+ for n=1,maxn,3 do
+ local nns, ntg = nodes[n+1], nodes[n+2]
+ ok = (not ntg or ltg == ntg) and (not nns or lns == nns)
+ if ok then
+ break
+ end
+ end
+ if directive then
+ if ok then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ elseif not ok then
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
+ end
+ end
+ end
+ return collected
+ end
+end
+
+local quit_expression = false
+
+local function apply_expression(list,expression,order)
+ local collected = { }
+ quit_expression = false
+ for l=1,#list do
+ local ll = list[l]
+ if expression(list,ll,l,order) then -- nasty, order alleen valid als n=1
+ collected[#collected+1] = ll
+ end
+ if quit_expression then
+ break
+ end
+ end
+ return collected
+end
+
+local P, V, C, Cs, Cc, Ct, R, S, Cg, Cb = lpeg.P, lpeg.V, lpeg.C, lpeg.Cs, lpeg.Cc, lpeg.Ct, lpeg.R, lpeg.S, lpeg.Cg, lpeg.Cb
+
+local spaces = S(" \n\r\t\f")^0
+local lp_space = S(" \n\r\t\f")
+local lp_any = P(1)
+local lp_noequal = P("!=") / "~=" + P("<=") + P(">=") + P("==")
+local lp_doequal = P("=") / "=="
+local lp_or = P("|") / " or "
+local lp_and = P("&") / " and "
+
+local lp_builtin = P (
+ P("firstindex") / "1" +
+ P("lastindex") / "(#ll.__p__.dt or 1)" +
+ P("firstelement") / "1" +
+ P("lastelement") / "(ll.__p__.en or 1)" +
+ P("first") / "1" +
+ P("last") / "#list" +
+ P("rootposition") / "order" +
+ P("position") / "l" + -- is element in finalizer
+ P("order") / "order" +
+ P("element") / "(ll.ei or 1)" +
+ P("index") / "(ll.ni or 1)" +
+ P("match") / "(ll.mi or 1)" +
+ P("text") / "(ll.dt[1] or '')" +
+ -- P("name") / "(ll.ns~='' and ll.ns..':'..ll.tg)" +
+ P("name") / "((ll.ns~='' and ll.ns..':'..ll.tg) or ll.tg)" +
+ P("tag") / "ll.tg" +
+ P("ns") / "ll.ns"
+ ) * ((spaces * P("(") * spaces * P(")"))/"")
+
+local lp_attribute = (P("@") + P("attribute::")) / "" * Cc("(ll.at and ll.at['") * R("az","AZ","--","__")^1 * Cc("'])")
+local lp_fastpos_p = ((P("+")^0 * R("09")^1 * P(-1)) / function(s) return "l==" .. s end)
+local lp_fastpos_n = ((P("-") * R("09")^1 * P(-1)) / function(s) return "(" .. s .. "<0 and (#list+".. s .. "==l))" end)
+local lp_fastpos = lp_fastpos_n + lp_fastpos_p
+local lp_reserved = C("and") + C("or") + C("not") + C("div") + C("mod") + C("true") + C("false")
+
+local lp_lua_function = C(R("az","AZ","__")^1 * (P(".") * R("az","AZ","__")^1)^1) * ("(") / function(t) -- todo: better . handling
+ return t .. "("
+end
+
+local lp_function = C(R("az","AZ","__")^1) * P("(") / function(t) -- todo: better . handling
+ if expressions[t] then
+ return "expr." .. t .. "("
+ else
+ return "expr.error("
+ end
+end
+
+local lparent = lpeg.P("(")
+local rparent = lpeg.P(")")
+local noparent = 1 - (lparent+rparent)
+local nested = lpeg.P{lparent * (noparent + lpeg.V(1))^0 * rparent}
+local value = lpeg.P(lparent * lpeg.C((noparent + nested)^0) * rparent) -- lpeg.P{"("*C(((1-S("()"))+V(1))^0)*")"}
+
+local lp_child = Cc("expr.child(ll,'") * R("az","AZ","--","__")^1 * Cc("')")
+local lp_number = S("+-") * R("09")^1
+local lp_string = Cc("'") * R("az","AZ","--","__")^1 * Cc("'")
+local lp_content = (P("'") * (1-P("'"))^0 * P("'") + P('"') * (1-P('"'))^0 * P('"'))
+
+local cleaner
+
+local lp_special = (C(P("name")+P("text")+P("tag")+P("count")+P("child"))) * value / function(t,s)
+ if expressions[t] then
+ s = s and s ~= "" and lpegmatch(cleaner,s)
+ if s and s ~= "" then
+ return "expr." .. t .. "(ll," .. s ..")"
+ else
+ return "expr." .. t .. "(ll)"
+ end
+ else
+ return "expr.error(" .. t .. ")"
+ end
+end
+
+local content =
+ lp_builtin +
+ lp_attribute +
+ lp_special +
+ lp_noequal + lp_doequal +
+ lp_or + lp_and +
+ lp_reserved +
+ lp_lua_function + lp_function +
+ lp_content + -- too fragile
+ lp_child +
+ lp_any
+
+local converter = Cs (
+ lp_fastpos + (P { lparent * (V(1))^0 * rparent + content } )^0
+)
+
+cleaner = Cs ( (
+--~ lp_fastpos +
+ lp_reserved +
+ lp_number +
+ lp_string +
+1 )^1 )
+
+
+--~ expr
+
+local template_e = [[
+ local expr = xml.expressions
+ return function(list,ll,l,order)
+ return %s
+ end
+]]
+
+local template_f_y = [[
+ local finalizer = xml.finalizers['%s']['%s']
+ return function(collection)
+ return finalizer(collection,%s)
+ end
+]]
+
+local template_f_n = [[
+ return xml.finalizers['%s']['%s']
+]]
+
+--
+
+local register_self = { kind = "axis", axis = "self" } -- , apply = apply_axis["self"] }
+local register_parent = { kind = "axis", axis = "parent" } -- , apply = apply_axis["parent"] }
+local register_descendant = { kind = "axis", axis = "descendant" } -- , apply = apply_axis["descendant"] }
+local register_child = { kind = "axis", axis = "child" } -- , apply = apply_axis["child"] }
+local register_descendant_or_self = { kind = "axis", axis = "descendant-or-self" } -- , apply = apply_axis["descendant-or-self"] }
+local register_root = { kind = "axis", axis = "root" } -- , apply = apply_axis["root"] }
+local register_ancestor = { kind = "axis", axis = "ancestor" } -- , apply = apply_axis["ancestor"] }
+local register_ancestor_or_self = { kind = "axis", axis = "ancestor-or-self" } -- , apply = apply_axis["ancestor-or-self"] }
+local register_attribute = { kind = "axis", axis = "attribute" } -- , apply = apply_axis["attribute"] }
+local register_namespace = { kind = "axis", axis = "namespace" } -- , apply = apply_axis["namespace"] }
+local register_following = { kind = "axis", axis = "following" } -- , apply = apply_axis["following"] }
+local register_following_sibling = { kind = "axis", axis = "following-sibling" } -- , apply = apply_axis["following-sibling"] }
+local register_preceding = { kind = "axis", axis = "preceding" } -- , apply = apply_axis["preceding"] }
+local register_preceding_sibling = { kind = "axis", axis = "preceding-sibling" } -- , apply = apply_axis["preceding-sibling"] }
+local register_reverse_sibling = { kind = "axis", axis = "reverse-sibling" } -- , apply = apply_axis["reverse-sibling"] }
+
+local register_auto_descendant_or_self = { kind = "axis", axis = "auto-descendant-or-self" } -- , apply = apply_axis["auto-descendant-or-self"] }
+local register_auto_descendant = { kind = "axis", axis = "auto-descendant" } -- , apply = apply_axis["auto-descendant"] }
+local register_auto_self = { kind = "axis", axis = "auto-self" } -- , apply = apply_axis["auto-self"] }
+local register_auto_child = { kind = "axis", axis = "auto-child" } -- , apply = apply_axis["auto-child"] }
+
+local register_initial_child = { kind = "axis", axis = "initial-child" } -- , apply = apply_axis["initial-child"] }
+
+local register_all_nodes = { kind = "nodes", nodetest = true, nodes = { true, false, false } }
+
+local skip = { }
+
+local function errorrunner_e(str,cnv)
+ if not skip[str] then
+ logs.report("lpath","error in expression: %s => %s",str,cnv)
+ skip[str] = cnv or str
+ end
+ return false
+end
+local function errorrunner_f(str,arg)
+ logs.report("lpath","error in finalizer: %s(%s)",str,arg or "")
+ return false
+end
+
+local function register_nodes(nodetest,nodes)
+ return { kind = "nodes", nodetest = nodetest, nodes = nodes }
+end
+
+local function register_expression(expression)
+ local converted = lpegmatch(converter,expression)
+ local runner = loadstring(format(template_e,converted))
+ runner = (runner and runner()) or function() errorrunner_e(expression,converted) end
+ return { kind = "expression", expression = expression, converted = converted, evaluator = runner }
+end
+
+local function register_finalizer(protocol,name,arguments)
+ local runner
+ if arguments and arguments ~= "" then
+ runner = loadstring(format(template_f_y,protocol or xml.defaultprotocol,name,arguments))
+ else
+ runner = loadstring(format(template_f_n,protocol or xml.defaultprotocol,name))
+ end
+ runner = (runner and runner()) or function() errorrunner_f(name,arguments) end
+ return { kind = "finalizer", name = name, arguments = arguments, finalizer = runner }
+end
+
+local expression = P { "ex",
+ ex = "[" * C((V("sq") + V("dq") + (1 - S("[]")) + V("ex"))^0) * "]",
+ sq = "'" * (1 - S("'"))^0 * "'",
+ dq = '"' * (1 - S('"'))^0 * '"',
+}
+
+local arguments = P { "ar",
+ ar = "(" * Cs((V("sq") + V("dq") + V("nq") + P(1-P(")")))^0) * ")",
+ nq = ((1 - S("),'\""))^1) / function(s) return format("%q",s) end,
+ sq = P("'") * (1 - P("'"))^0 * P("'"),
+ dq = P('"') * (1 - P('"'))^0 * P('"'),
+}
+
+-- todo: better arg parser
+
+local function register_error(str)
+ return { kind = "error", error = format("unparsed: %s",str) }
+end
+
+-- there is a difference in * and /*/ and so we need to catch a few special cases
+
+local special_1 = P("*") * Cc(register_auto_descendant) * Cc(register_all_nodes) -- last one not needed
+local special_2 = P("/") * Cc(register_auto_self)
+local special_3 = P("") * Cc(register_auto_self)
+
+local parser = Ct { "patterns", -- can be made a bit faster by moving pattern outside
+
+ patterns = spaces * V("protocol") * spaces * (
+ ( V("special") * spaces * P(-1) ) +
+ ( V("initial") * spaces * V("step") * spaces * (P("/") * spaces * V("step") * spaces)^0 )
+ ),
+
+ protocol = Cg(V("letters"),"protocol") * P("://") + Cg(Cc(nil),"protocol"),
+
+ -- the / is needed for // as descendant or self is somewhat special
+ -- step = (V("shortcuts") + V("axis") * spaces * V("nodes")^0 + V("error")) * spaces * V("expressions")^0 * spaces * V("finalizer")^0,
+ step = ((V("shortcuts") + P("/") + V("axis")) * spaces * V("nodes")^0 + V("error")) * spaces * V("expressions")^0 * spaces * V("finalizer")^0,
+
+ axis = V("descendant") + V("child") + V("parent") + V("self") + V("root") + V("ancestor") +
+ V("descendant_or_self") + V("following_sibling") + V("following") +
+ V("reverse_sibling") + V("preceding_sibling") + V("preceding") + V("ancestor_or_self") +
+ #(1-P(-1)) * Cc(register_auto_child),
+
+ special = special_1 + special_2 + special_3,
+
+ initial = (P("/") * spaces * Cc(register_initial_child))^-1,
+
+ error = (P(1)^1) / register_error,
+
+ shortcuts_a = V("s_descendant_or_self") + V("s_descendant") + V("s_child") + V("s_parent") + V("s_self") + V("s_root") + V("s_ancestor"),
+
+ shortcuts = V("shortcuts_a") * (spaces * "/" * spaces * V("shortcuts_a"))^0,
+
+ s_descendant_or_self = (P("***/") + P("/")) * Cc(register_descendant_or_self), --- *** is a bonus
+ -- s_descendant_or_self = P("/") * Cc(register_descendant_or_self),
+ s_descendant = P("**") * Cc(register_descendant),
+ s_child = P("*") * #(1-P(":")) * Cc(register_child ),
+-- s_child = P("*") * #(P("/")+P(-1)) * Cc(register_child ),
+ s_parent = P("..") * Cc(register_parent ),
+ s_self = P("." ) * Cc(register_self ),
+ s_root = P("^^") * Cc(register_root ),
+ s_ancestor = P("^") * Cc(register_ancestor ),
+
+ descendant = P("descendant::") * Cc(register_descendant ),
+ child = P("child::") * Cc(register_child ),
+ parent = P("parent::") * Cc(register_parent ),
+ self = P("self::") * Cc(register_self ),
+ root = P('root::') * Cc(register_root ),
+ ancestor = P('ancestor::') * Cc(register_ancestor ),
+ descendant_or_self = P('descendant-or-self::') * Cc(register_descendant_or_self ),
+ ancestor_or_self = P('ancestor-or-self::') * Cc(register_ancestor_or_self ),
+ -- attribute = P('attribute::') * Cc(register_attribute ),
+ -- namespace = P('namespace::') * Cc(register_namespace ),
+ following = P('following::') * Cc(register_following ),
+ following_sibling = P('following-sibling::') * Cc(register_following_sibling ),
+ preceding = P('preceding::') * Cc(register_preceding ),
+ preceding_sibling = P('preceding-sibling::') * Cc(register_preceding_sibling ),
+ reverse_sibling = P('reverse-sibling::') * Cc(register_reverse_sibling ),
+
+ nodes = (V("nodefunction") * spaces * P("(") * V("nodeset") * P(")") + V("nodetest") * V("nodeset")) / register_nodes,
+
+ expressions = expression / register_expression,
+
+ letters = R("az")^1,
+ name = (1-lpeg.S("/[]()|:*!"))^1,
+ negate = P("!") * Cc(false),
+
+ nodefunction = V("negate") + P("not") * Cc(false) + Cc(true),
+ nodetest = V("negate") + Cc(true),
+ nodename = (V("negate") + Cc(true)) * spaces * ((V("wildnodename") * P(":") * V("wildnodename")) + (Cc(false) * V("wildnodename"))),
+ wildnodename = (C(V("name")) + P("*") * Cc(false)) * #(1-P("(")),
+ nodeset = spaces * Ct(V("nodename") * (spaces * P("|") * spaces * V("nodename"))^0) * spaces,
+
+ finalizer = (Cb("protocol") * P("/")^-1 * C(V("name")) * arguments * P(-1)) / register_finalizer,
+
+}
+
+local cache = { }
+
+local function nodesettostring(set,nodetest)
+ local t = { }
+ for i=1,#set,3 do
+ local directive, ns, tg = set[i], set[i+1], set[i+2]
+ if not ns or ns == "" then ns = "*" end
+ if not tg or tg == "" then tg = "*" end
+ tg = (tg == "@rt@" and "[root]") or format("%s:%s",ns,tg)
+ t[#t+1] = (directive and tg) or format("not(%s)",tg)
+ end
+ if nodetest == false then
+ return format("not(%s)",concat(t,"|"))
+ else
+ return concat(t,"|")
+ end
+end
+
+local function tagstostring(list)
+ if #list == 0 then
+ return "no elements"
+ else
+ local t = { }
+ for i=1, #list do
+ local li = list[i]
+ local ns, tg = li.ns, li.tg
+ if not ns or ns == "" then ns = "*" end
+ if not tg or tg == "" then tg = "*" end
+ t[#t+1] = (tg == "@rt@" and "[root]") or format("%s:%s",ns,tg)
+ end
+ return concat(t," ")
+ end
+end
+
+xml.nodesettostring = nodesettostring
+
+local parse_pattern -- we have a harmless kind of circular reference
+
+local function lshow(parsed)
+ if type(parsed) == "string" then
+ parsed = parse_pattern(parsed)
+ end
+ local s = table.serialize_functions -- ugly
+ table.serialize_functions = false -- ugly
+ logs.report("lpath","%s://%s => %s",parsed.protocol or xml.defaultprotocol,parsed.pattern,table.serialize(parsed,false))
+ table.serialize_functions = s -- ugly
+end
+
+xml.lshow = lshow
+
+local function add_comment(p,str)
+ local pc = p.comment
+ if not pc then
+ p.comment = { str }
+ else
+ pc[#pc+1] = str
+ end
+end
+
+parse_pattern = function (pattern) -- the gain of caching is rather minimal
+ lpathcalls = lpathcalls + 1
+ if type(pattern) == "table" then
+ return pattern
+ else
+ local parsed = cache[pattern]
+ if parsed then
+ lpathcached = lpathcached + 1
+ else
+ parsed = lpegmatch(parser,pattern)
+ if parsed then
+ parsed.pattern = pattern
+ local np = #parsed
+ if np == 0 then
+ parsed = { pattern = pattern, register_self, state = "parsing error" }
+ logs.report("lpath","parsing error in '%s'",pattern)
+ lshow(parsed)
+ else
+ -- we could have done this with a more complex parser but this
+ -- is cleaner
+ local pi = parsed[1]
+ if pi.axis == "auto-child" then
+ if false then
+ add_comment(parsed, "auto-child replaced by auto-descendant-or-self")
+ parsed[1] = register_auto_descendant_or_self
+ else
+ add_comment(parsed, "auto-child replaced by auto-descendant")
+ parsed[1] = register_auto_descendant
+ end
+ elseif pi.axis == "initial-child" and np > 1 and parsed[2].axis then
+ add_comment(parsed, "initial-child removed") -- we could also make it a auto-self
+ remove(parsed,1)
+ end
+ local np = #parsed -- can have changed
+ if np > 1 then
+ local pnp = parsed[np]
+ if pnp.kind == "nodes" and pnp.nodetest == true then
+ local nodes = pnp.nodes
+ if nodes[1] == true and nodes[2] == false and nodes[3] == false then
+ add_comment(parsed, "redundant final wildcard filter removed")
+ remove(parsed,np)
+ end
+ end
+ end
+ end
+ else
+ parsed = { pattern = pattern }
+ end
+ cache[pattern] = parsed
+ if trace_lparse and not trace_lprofile then
+ lshow(parsed)
+ end
+ end
+ return parsed
+ end
+end
+
+-- we can move all calls inline and then merge the trace back
+-- technically we can combine axis and the next nodes which is
+-- what we did before but this a bit cleaner (but slower too)
+-- but interesting is that it's not that much faster when we
+-- go inline
+--
+-- beware: we need to return a collection even when we filter
+-- else the (simple) cache gets messed up
+
+-- caching found lookups saves not that much (max .1 sec on a 8 sec run)
+-- and it also messes up finalizers
+
+-- watch out: when there is a finalizer, it's always called as there
+-- can be cases that a finalizer returns (or does) something in case
+-- there is no match; an example of this is count()
+
+local profiled = { } xml.profiled = profiled
+
+local function profiled_apply(list,parsed,nofparsed,order)
+ local p = profiled[parsed.pattern]
+ if p then
+ p.tested = p.tested + 1
+ else
+ p = { tested = 1, matched = 0, finalized = 0 }
+ profiled[parsed.pattern] = p
+ end
+ local collected = list
+ for i=1,nofparsed do
+ local pi = parsed[i]
+ local kind = pi.kind
+ if kind == "axis" then
+ collected = apply_axis[pi.axis](collected)
+ elseif kind == "nodes" then
+ collected = apply_nodes(collected,pi.nodetest,pi.nodes)
+ elseif kind == "expression" then
+ collected = apply_expression(collected,pi.evaluator,order)
+ elseif kind == "finalizer" then
+ collected = pi.finalizer(collected)
+ p.matched = p.matched + 1
+ p.finalized = p.finalized + 1
+ return collected
+ end
+ if not collected or #collected == 0 then
+ local pn = i < nofparsed and parsed[nofparsed]
+ if pn and pn.kind == "finalizer" then
+ collected = pn.finalizer(collected)
+ p.finalized = p.finalized + 1
+ return collected
+ end
+ return nil
+ end
+ end
+ if collected then
+ p.matched = p.matched + 1
+ end
+ return collected
+end
+
+local function traced_apply(list,parsed,nofparsed,order)
+ if trace_lparse then
+ lshow(parsed)
+ end
+ logs.report("lpath", "collecting : %s",parsed.pattern)
+ logs.report("lpath", " root tags : %s",tagstostring(list))
+ logs.report("lpath", " order : %s",order or "unset")
+ local collected = list
+ for i=1,nofparsed do
+ local pi = parsed[i]
+ local kind = pi.kind
+ if kind == "axis" then
+ collected = apply_axis[pi.axis](collected)
+ logs.report("lpath", "% 10i : ax : %s",(collected and #collected) or 0,pi.axis)
+ elseif kind == "nodes" then
+ collected = apply_nodes(collected,pi.nodetest,pi.nodes)
+ logs.report("lpath", "% 10i : ns : %s",(collected and #collected) or 0,nodesettostring(pi.nodes,pi.nodetest))
+ elseif kind == "expression" then
+ collected = apply_expression(collected,pi.evaluator,order)
+ logs.report("lpath", "% 10i : ex : %s -> %s",(collected and #collected) or 0,pi.expression,pi.converted)
+ elseif kind == "finalizer" then
+ collected = pi.finalizer(collected)
+ logs.report("lpath", "% 10i : fi : %s : %s(%s)",(type(collected) == "table" and #collected) or 0,parsed.protocol or xml.defaultprotocol,pi.name,pi.arguments or "")
+ return collected
+ end
+ if not collected or #collected == 0 then
+ local pn = i < nofparsed and parsed[nofparsed]
+ if pn and pn.kind == "finalizer" then
+ collected = pn.finalizer(collected)
+ logs.report("lpath", "% 10i : fi : %s : %s(%s)",(type(collected) == "table" and #collected) or 0,parsed.protocol or xml.defaultprotocol,pn.name,pn.arguments or "")
+ return collected
+ end
+ return nil
+ end
+ end
+ return collected
+end
+
+local function normal_apply(list,parsed,nofparsed,order)
+ local collected = list
+ for i=1,nofparsed do
+ local pi = parsed[i]
+ local kind = pi.kind
+ if kind == "axis" then
+ local axis = pi.axis
+ if axis ~= "self" then
+ collected = apply_axis[axis](collected)
+ end
+ elseif kind == "nodes" then
+ collected = apply_nodes(collected,pi.nodetest,pi.nodes)
+ elseif kind == "expression" then
+ collected = apply_expression(collected,pi.evaluator,order)
+ elseif kind == "finalizer" then
+ return pi.finalizer(collected)
+ end
+ if not collected or #collected == 0 then
+ local pf = i < nofparsed and parsed[nofparsed].finalizer
+ if pf then
+ return pf(collected) -- can be anything
+ end
+ return nil
+ end
+ end
+ return collected
+end
+
+local function parse_apply(list,pattern)
+ -- we avoid an extra call
+ local parsed = cache[pattern]
+ if parsed then
+ lpathcalls = lpathcalls + 1
+ lpathcached = lpathcached + 1
+ elseif type(pattern) == "table" then
+ lpathcalls = lpathcalls + 1
+ parsed = pattern
+ else
+ parsed = parse_pattern(pattern) or pattern
+ end
+ if not parsed then
+ return
+ end
+ local nofparsed = #parsed
+ if nofparsed == 0 then
+ return -- something is wrong
+ end
+ local one = list[1]
+ if not one then
+ return -- something is wrong
+ elseif not trace_lpath then
+ return normal_apply(list,parsed,nofparsed,one.mi)
+ elseif trace_lprofile then
+ return profiled_apply(list,parsed,nofparsed,one.mi)
+ else
+ return traced_apply(list,parsed,nofparsed,one.mi)
+ end
+end
+
+-- internal (parsed)
+
+expressions.child = function(e,pattern)
+ return parse_apply({ e },pattern) -- todo: cache
+end
+expressions.count = function(e,pattern)
+ local collected = parse_apply({ e },pattern) -- todo: cache
+ return (collected and #collected) or 0
+end
+
+-- external
+
+expressions.oneof = function(s,...) -- slow
+ local t = {...} for i=1,#t do if s == t[i] then return true end end return false
+end
+expressions.error = function(str)
+ xml.error_handler("unknown function in lpath expression",tostring(str or "?"))
+ return false
+end
+expressions.undefined = function(s)
+ return s == nil
+end
+
+expressions.quit = function(s)
+ if s or s == nil then
+ quit_expression = true
+ end
+ return true
+end
+
+expressions.print = function(...)
+ print(...)
+ return true
+end
+
+expressions.contains = find
+expressions.find = find
+expressions.upper = upper
+expressions.lower = lower
+expressions.number = tonumber
+expressions.boolean = toboolean
+
+-- user interface
+
+local function traverse(root,pattern,handle)
+ logs.report("xml","use 'xml.selection' instead for '%s'",pattern)
+ local collected = parse_apply({ root },pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local r = e.__p__
+ handle(r,r.dt,e.ni)
+ end
+ end
+end
+
+local function selection(root,pattern,handle)
+ local collected = parse_apply({ root },pattern)
+ if collected then
+ if handle then
+ for c=1,#collected do
+ handle(collected[c])
+ end
+ else
+ return collected
+ end
+ end
+end
+
+xml.parse_parser = parser
+xml.parse_pattern = parse_pattern
+xml.parse_apply = parse_apply
+xml.traverse = traverse -- old method, r, d, k
+xml.selection = selection -- new method, simple handle
+
+local lpath = parse_pattern
+
+xml.lpath = lpath
+
+function xml.cached_patterns()
+ return cache
+end
+
+-- generic function finalizer (independant namespace)
+
+local function dofunction(collected,fnc)
+ if collected then
+ local f = functions[fnc]
+ if f then
+ for c=1,#collected do
+ f(collected[c])
+ end
+ else
+ logs.report("xml","unknown function '%s'",fnc)
+ end
+ end
+end
+
+xml.finalizers.xml["function"] = dofunction
+xml.finalizers.tex["function"] = dofunction
+
+-- functions
+
+expressions.text = function(e,n)
+ local rdt = e.__p__.dt
+ return (rdt and rdt[n]) or ""
+end
+
+expressions.name = function(e,n) -- ns + tg
+ local found = false
+ n = tonumber(n) or 0
+ if n == 0 then
+ found = type(e) == "table" and e
+ elseif n < 0 then
+ local d, k = e.__p__.dt, e.ni
+ for i=k-1,1,-1 do
+ local di = d[i]
+ if type(di) == "table" then
+ if n == -1 then
+ found = di
+ break
+ else
+ n = n + 1
+ end
+ end
+ end
+ else
+ local d, k = e.__p__.dt, e.ni
+ for i=k+1,#d,1 do
+ local di = d[i]
+ if type(di) == "table" then
+ if n == 1 then
+ found = di
+ break
+ else
+ n = n - 1
+ end
+ end
+ end
+ end
+ if found then
+ local ns, tg = found.rn or found.ns or "", found.tg
+ if ns ~= "" then
+ return ns .. ":" .. tg
+ else
+ return tg
+ end
+ else
+ return ""
+ end
+end
+
+expressions.tag = function(e,n) -- only tg
+ if not e then
+ return ""
+ else
+ local found = false
+ n = tonumber(n) or 0
+ if n == 0 then
+ found = (type(e) == "table") and e -- seems to fail
+ elseif n < 0 then
+ local d, k = e.__p__.dt, e.ni
+ for i=k-1,1,-1 do
+ local di = d[i]
+ if type(di) == "table" then
+ if n == -1 then
+ found = di
+ break
+ else
+ n = n + 1
+ end
+ end
+ end
+ else
+ local d, k = e.__p__.dt, e.ni
+ for i=k+1,#d,1 do
+ local di = d[i]
+ if type(di) == "table" then
+ if n == 1 then
+ found = di
+ break
+ else
+ n = n - 1
+ end
+ end
+ end
+ end
+ return (found and found.tg) or ""
+ end
+end
+
+--[[ldx--
+<p>This is the main filter function. It returns whatever is asked for.</p>
+--ldx]]--
+
+function xml.filter(root,pattern) -- no longer funny attribute handling here
+ return parse_apply({ root },pattern)
+end
+
+--[[ldx--
+<p>Often using an iterators looks nicer in the code than passing handler
+functions. The <l n='lua'/> book describes how to use coroutines for that
+purpose (<url href='http://www.lua.org/pil/9.3.html'/>). This permits
+code like:</p>
+
+<typing>
+for r, d, k in xml.elements(xml.load('text.xml'),"title") do
+ print(d[k]) -- old method
+end
+for e in xml.collected(xml.load('text.xml'),"title") do
+ print(e) -- new one
+end
+</typing>
+--ldx]]--
+
+local wrap, yield = coroutine.wrap, coroutine.yield
+
+function xml.elements(root,pattern,reverse) -- r, d, k
+ local collected = parse_apply({ root },pattern)
+ if collected then
+ if reverse then
+ return wrap(function() for c=#collected,1,-1 do
+ local e = collected[c] local r = e.__p__ yield(r,r.dt,e.ni)
+ end end)
+ else
+ return wrap(function() for c=1,#collected do
+ local e = collected[c] local r = e.__p__ yield(r,r.dt,e.ni)
+ end end)
+ end
+ end
+ return wrap(function() end)
+end
+
+function xml.collected(root,pattern,reverse) -- e
+ local collected = parse_apply({ root },pattern)
+ if collected then
+ if reverse then
+ return wrap(function() for c=#collected,1,-1 do yield(collected[c]) end end)
+ else
+ return wrap(function() for c=1,#collected do yield(collected[c]) end end)
+ end
+ end
+ return wrap(function() end)
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-mis.lua b/Master/texmf-dist/tex/context/base/lxml-mis.lua
index a117b1af92a..9fd4270af4a 100644
--- a/Master/texmf-dist/tex/context/base/lxml-mis.lua
+++ b/Master/texmf-dist/tex/context/base/lxml-mis.lua
@@ -8,17 +8,18 @@ if not modules then modules = { } end modules ['lxml-mis'] = {
local concat = table.concat
local type, next, tonumber, tostring, setmetatable, loadstring = type, next, tonumber, tostring, setmetatable, loadstring
-local format, gsub = string.format, string.gsub
+local format, gsub, match = string.format, string.gsub, string.match
+local lpegmatch = lpeg.match
--[[ldx--
-<p>The following helper functions best belong to the <t>lmxl-ini</t>
+<p>The following helper functions best belong to the <t>lxml-ini</t>
module. Some are here because we need then in the <t>mk</t>
document and other manuals, others came up when playing with
this module. Since this module is also used in <l n='mtxrun'/> we've
put them here instead of loading mode modules there then needed.</p>
--ldx]]--
-function xml.gsub(t,old,new)
+local function xmlgsub(t,old,new) -- will be replaced
local dt = t.dt
if dt then
for k=1,#dt do
@@ -26,28 +27,26 @@ function xml.gsub(t,old,new)
if type(v) == "string" then
dt[k] = gsub(v,old,new)
else
- xml.gsub(v,old,new)
+ xmlgsub(v,old,new)
end
end
end
end
+--~ xml.gsub = xmlgsub
+
function xml.strip_leading_spaces(dk,d,k) -- cosmetic, for manual
- if d and k and d[k-1] and type(d[k-1]) == "string" then
- local s = d[k-1]:match("\n(%s+)")
- xml.gsub(dk,"\n"..string.rep(" ",#s),"\n")
+ if d and k then
+ local dkm = d[k-1]
+ if dkm and type(dkm) == "string" then
+ local s = match(dkm,"\n(%s+)")
+ xmlgsub(dk,"\n"..rep(" ",#s),"\n")
+ end
end
end
-function xml.serialize_path(root,lpath,handle)
- local dk, r, d, k = xml.first(root,lpath)
- dk = xml.copy(dk)
- xml.strip_leading_spaces(dk,d,k)
- xml.serialize(dk,handle)
-end
-
--~ xml.escapes = { ['&'] = '&amp;', ['<'] = '&lt;', ['>'] = '&gt;', ['"'] = '&quot;' }
---~ xml.unescapes = { } for k,v in pairs(xml.escapes) do xml.unescapes[v] = k end
+--~ xml.unescapes = { } for k,v in next, xml.escapes do xml.unescapes[v] = k end
--~ function xml.escaped (str) return (gsub(str,"(.)" , xml.escapes )) end
--~ function xml.unescaped(str) return (gsub(str,"(&.-;)", xml.unescapes)) end
@@ -71,8 +70,6 @@ local escaped = Cs(normal * (special * normal)^0)
-- 100 * 1000 * "oeps&lt; oeps&gt; oeps&amp;" : gsub:lpeg == 0153:0280:0151:0080 (last one by roberto)
--- unescaped = Cs((S("&lt;")/"<" + S("&gt;")/">" + S("&amp;")/"&" + 1)^0)
--- unescaped = Cs((((P("&")/"") * (P("lt")/"<" + P("gt")/">" + P("amp")/"&") * (P(";")/"")) + 1)^0)
local normal = (1 - S"&")^0
local special = P("&lt;")/"<" + P("&gt;")/">" + P("&amp;")/"&"
local unescaped = Cs(normal * (special * normal)^0)
@@ -85,22 +82,18 @@ xml.escaped_pattern = escaped
xml.unescaped_pattern = unescaped
xml.cleansed_pattern = cleansed
-function xml.escaped (str) return escaped :match(str) end
-function xml.unescaped(str) return unescaped:match(str) end
-function xml.cleansed (str) return cleansed :match(str) end
+function xml.escaped (str) return lpegmatch(escaped,str) end
+function xml.unescaped(str) return lpegmatch(unescaped,str) end
+function xml.cleansed (str) return lpegmatch(cleansed,str) end
-function xml.join(t,separator,lastseparator)
- if #t > 0 then
- local result = { }
- for k,v in pairs(t) do
- result[k] = xml.tostring(v)
- end
- if lastseparator then
- return concat(result,separator or "",1,#result-1) .. (lastseparator or "") .. result[#result]
- else
- return concat(result,separator)
+-- this might move
+
+function xml.fillin(root,pattern,str,check)
+ local e = xml.first(root,pattern)
+ if e then
+ local n = #e.dt
+ if not check or n == 0 or (n == 1 and e.dt[1] == "") then
+ e.dt = { str }
end
- else
- return ""
end
end
diff --git a/Master/texmf-dist/tex/context/base/lxml-pth.lua b/Master/texmf-dist/tex/context/base/lxml-pth.lua
deleted file mode 100644
index b1afc8d6423..00000000000
--- a/Master/texmf-dist/tex/context/base/lxml-pth.lua
+++ /dev/null
@@ -1,1555 +0,0 @@
-if not modules then modules = { } end modules ['lxml-pth'] = {
- version = 1.001,
- comment = "this module is the basis for the lxml-* ones",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local concat, remove, insert = table.concat, table.remove, table.insert
-local type, next, tonumber, tostring, setmetatable, loadstring = type, next, tonumber, tostring, setmetatable, loadstring
-local format, lower, gmatch, gsub, find = string.format, string.lower, string.gmatch, string.gsub, string.find
-
---[[ldx--
-<p>This module can be used stand alone but also inside <l n='mkiv'/> in
-which case it hooks into the tracker code. Therefore we provide a few
-functions that set the tracers. Here we overload a previously defined
-function.</p>
---ldx]]--
-
-local trace_lpath = false
-
-if trackers then
- trackers.register("xml.lpath", function(v) trace_lpath = v end)
-end
-
-local settrace = xml.settrace -- lxml-tab
-
-function xml.settrace(str,value)
- if str == "lpath" then
- trace_lpath = value or false
- else
- settrace(str,value) -- lxml-tab
- end
-end
-
---[[ldx--
-<p>We've now arrived at an intersting part: accessing the tree using a subset
-of <l n='xpath'/> and since we're not compatible we call it <l n='lpath'/>. We
-will explain more about its usage in other documents.</p>
---ldx]]--
-
-local lpathcalls = 0 -- statistics
-local lpathcached = 0 -- statistics
-
-xml.functions = xml.functions or { }
-xml.expressions = xml.expressions or { }
-
-local functions = xml.functions
-local expressions = xml.expressions
-
-local actions = {
- [10] = "stay",
- [11] = "parent",
- [12] = "subtree root",
- [13] = "document root",
- [14] = "any",
- [15] = "many",
- [16] = "initial",
- [20] = "match",
- [21] = "match one of",
- [22] = "match and attribute eq",
- [23] = "match and attribute ne",
- [24] = "match one of and attribute eq",
- [25] = "match one of and attribute ne",
- [27] = "has attribute",
- [28] = "has value",
- [29] = "fast match",
- [30] = "select",
- [31] = "expression",
- [40] = "processing instruction",
-}
-
--- a rather dumb lpeg
-
-local P, S, R, C, V, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc
-
--- instead of using functions we just parse a few names which saves a call
--- later on
-
-local lp_position = P("position()") / "ps"
-local lp_index = P("index()") / "id"
-local lp_text = P("text()") / "tx"
-local lp_name = P("name()") / "(ns~='' and ns..':'..tg)" -- "((rt.ns~='' and rt.ns..':'..rt.tg) or '')"
-local lp_tag = P("tag()") / "tg" -- (rt.tg or '')
-local lp_ns = P("ns()") / "ns" -- (rt.ns or '')
-local lp_noequal = P("!=") / "~=" + P("<=") + P(">=") + P("==")
-local lp_doequal = P("=") / "=="
-local lp_attribute = P("@") / "" * Cc("(at['") * R("az","AZ","--","__")^1 * Cc("'] or '')")
-
-local lp_lua_function = C(R("az","AZ","--","__")^1 * (P(".") * R("az","AZ","--","__")^1)^1) * P("(") / function(t) -- todo: better . handling
- return t .. "("
-end
-
-local lp_function = C(R("az","AZ","--","__")^1) * P("(") / function(t) -- todo: better . handling
- if expressions[t] then
- return "expressions." .. t .. "("
- else
- return "expressions.error("
- end
-end
-
-local lparent = lpeg.P("(")
-local rparent = lpeg.P(")")
-local noparent = 1 - (lparent+rparent)
-local nested = lpeg.P{lparent * (noparent + lpeg.V(1))^0 * rparent}
-local value = lpeg.P(lparent * lpeg.C((noparent + nested)^0) * rparent) -- lpeg.P{"("*C(((1-S("()"))+V(1))^0)*")"}
-
--- if we use a dedicated namespace then we don't need to pass rt and k
-
-local lp_special = (C(P("name")+P("text")+P("tag"))) * value / function(t,s)
- if expressions[t] then
- if s then
- return "expressions." .. t .. "(r,k," .. s ..")"
- else
- return "expressions." .. t .. "(r,k)"
- end
- else
- return "expressions.error(" .. t .. ")"
- end
-end
-
-local converter = lpeg.Cs ( (
- lp_position +
- lp_index +
- lp_text + lp_name + -- fast one
- lp_special +
- lp_noequal + lp_doequal +
- lp_attribute +
- lp_lua_function +
- lp_function +
-1 )^1 )
-
--- expressions,root,rootdt,k,e,edt,ns,tg,idx,hsh[tg] or 1
-
-local template = [[
- return function(expressions,r,d,k,e,dt,ns,tg,id,ps)
- local at, tx = e.at or { }, dt[1] or ""
- return %s
- end
-]]
-
-local function make_expression(str)
- str = converter:match(str)
- return str, loadstring(format(template,str))()
-end
-
-local map = { }
-
-local space = S(' \r\n\t')
-local squote = S("'")
-local dquote = S('"')
-local lparent = P('(')
-local rparent = P(')')
-local atsign = P('@')
-local lbracket = P('[')
-local rbracket = P(']')
-local exclam = P('!')
-local period = P('.')
-local eq = P('==') + P('=')
-local ne = P('<>') + P('!=')
-local star = P('*')
-local slash = P('/')
-local colon = P(':')
-local bar = P('|')
-local hat = P('^')
-local valid = R('az', 'AZ', '09') + S('_-')
-local name_yes = C(valid^1 + star) * colon * C(valid^1 + star) -- permits ns:* *:tg *:*
-local name_nop = Cc("*") * C(valid^1)
-local name = name_yes + name_nop
-local number = C((S('+-')^0 * R('09')^1)) / tonumber
-local names = (bar^0 * name)^1
-local morenames = name * (bar^0 * name)^1
-local instructiontag = P('pi::')
-local spacing = C(space^0)
-local somespace = space^1
-local optionalspace = space^0
-local text = C(valid^0)
-local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote)
-local empty = 1-slash
-
-local is_eq = lbracket * atsign * name * eq * value * rbracket
-local is_ne = lbracket * atsign * name * ne * value * rbracket
-local is_attribute = lbracket * atsign * name * rbracket
-local is_value = lbracket * value * rbracket
-local is_number = lbracket * number * rbracket
-
-local nobracket = 1-(lbracket+rbracket) -- must be improved
-local is_expression = lbracket * C(((C(nobracket^1))/make_expression)) * rbracket
-
-local is_expression = lbracket * (C(nobracket^1))/make_expression * rbracket
-
-local is_one = name
-local is_none = exclam * name
-local is_one_of = ((lparent * names * rparent) + morenames)
-local is_none_of = exclam * ((lparent * names * rparent) + morenames)
-
-local stay = (period )
-local parent = (period * period ) / function( ) map[#map+1] = { 11 } end
-local subtreeroot = (slash + hat ) / function( ) map[#map+1] = { 12 } end
-local documentroot = (hat * hat ) / function( ) map[#map+1] = { 13 } end
-local any = (star ) / function( ) map[#map+1] = { 14 } end
-local many = (star * star ) / function( ) map[#map+1] = { 15 } end
-local initial = (hat * hat * hat ) / function( ) map[#map+1] = { 16 } end
-
-local match = (is_one ) / function(...) map[#map+1] = { 20, true , ... } end
-local match_one_of = (is_one_of ) / function(...) map[#map+1] = { 21, true , ... } end
-local dont_match = (is_none ) / function(...) map[#map+1] = { 20, false, ... } end
-local dont_match_one_of = (is_none_of ) / function(...) map[#map+1] = { 21, false, ... } end
-
-local match_and_eq = (is_one * is_eq ) / function(...) map[#map+1] = { 22, true , ... } end
-local match_and_ne = (is_one * is_ne ) / function(...) map[#map+1] = { 23, true , ... } end
-local dont_match_and_eq = (is_none * is_eq ) / function(...) map[#map+1] = { 22, false, ... } end
-local dont_match_and_ne = (is_none * is_ne ) / function(...) map[#map+1] = { 23, false, ... } end
-
-local match_one_of_and_eq = (is_one_of * is_eq ) / function(...) map[#map+1] = { 24, true , ... } end
-local match_one_of_and_ne = (is_one_of * is_ne ) / function(...) map[#map+1] = { 25, true , ... } end
-local dont_match_one_of_and_eq = (is_none_of * is_eq ) / function(...) map[#map+1] = { 24, false, ... } end
-local dont_match_one_of_and_ne = (is_none_of * is_ne ) / function(...) map[#map+1] = { 25, false, ... } end
-
-local has_attribute = (is_one * is_attribute) / function(...) map[#map+1] = { 27, true , ... } end
-local has_value = (is_one * is_value ) / function(...) map[#map+1] = { 28, true , ... } end
-local dont_has_attribute = (is_none * is_attribute) / function(...) map[#map+1] = { 27, false, ... } end
-local dont_has_value = (is_none * is_value ) / function(...) map[#map+1] = { 28, false, ... } end
-local position = (is_one * is_number ) / function(...) map[#map+1] = { 30, true, ... } end
-local dont_position = (is_none * is_number ) / function(...) map[#map+1] = { 30, false, ... } end
-
-local expression = (is_one * is_expression)/ function(...) map[#map+1] = { 31, true, ... } end
-local dont_expression = (is_none * is_expression)/ function(...) map[#map+1] = { 31, false, ... } end
-
-local self_expression = ( is_expression) / function(...) if #map == 0 then map[#map+1] = { 11 } end
- map[#map+1] = { 31, true, "*", "*", ... } end
-local dont_self_expression = (exclam * is_expression) / function(...) if #map == 0 then map[#map+1] = { 11 } end
- map[#map+1] = { 31, false, "*", "*", ... } end
-
-local instruction = (instructiontag * text ) / function(...) map[#map+1] = { 40, ... } end
-local nothing = (empty ) / function( ) map[#map+1] = { 15 } end -- 15 ?
-local crap = (1-slash)^1
-
--- a few ugly goodies:
-
-local docroottag = P('^^') / function( ) map[#map+1] = { 12 } end
-local subroottag = P('^') / function( ) map[#map+1] = { 13 } end
-local roottag = P('root::') / function( ) map[#map+1] = { 12 } end
-local parenttag = P('parent::') / function( ) map[#map+1] = { 11 } end
-local childtag = P('child::')
-local selftag = P('self::')
-
--- there will be more and order will be optimized
-
-local selector = (
- instruction +
--- many + any + -- brrr, not here !
- parent + stay +
- dont_position + position +
- dont_match_one_of_and_eq + dont_match_one_of_and_ne +
- match_one_of_and_eq + match_one_of_and_ne +
- dont_match_and_eq + dont_match_and_ne +
- match_and_eq + match_and_ne +
- dont_expression + expression +
- dont_self_expression + self_expression +
- has_attribute + has_value +
- dont_match_one_of + match_one_of +
- dont_match + match +
- many + any +
- crap + empty
-)
-
-local grammar = P { "startup",
- startup = (initial + documentroot + subtreeroot + roottag + docroottag + subroottag)^0 * V("followup"),
- followup = ((slash + parenttag + childtag + selftag)^0 * selector)^1,
-}
-
-local function compose(str)
- if not str or str == "" then
- -- wildcard
- return true
- elseif str == '/' then
- -- root
- return false
- else
- map = { }
- grammar:match(str)
- if #map == 0 then
- return true
- else
- local m = map[1][1]
- if #map == 1 then
- if m == 14 or m == 15 then
- -- wildcard
- return true
- elseif m == 12 then
- -- root
- return false
- end
- elseif #map == 2 and m == 12 and map[2][1] == 20 then
- -- return { { 29, map[2][2], map[2][3], map[2][4], map[2][5] } }
- map[2][1] = 29
- return { map[2] }
- end
- if m ~= 11 and m ~= 12 and m ~= 13 and m ~= 14 and m ~= 15 and m ~= 16 then
- insert(map, 1, { 16 })
- end
- -- print(gsub(table.serialize(map),"[ \n]+"," "))
- return map
- end
- end
-end
-
-local cache = { }
-
-function xml.lpath(pattern,trace)
- lpathcalls = lpathcalls + 1
- if type(pattern) == "string" then
- local result = cache[pattern]
- if result == nil then -- can be false which is valid -)
- result = compose(pattern)
- cache[pattern] = result
- lpathcached = lpathcached + 1
- end
- if trace or trace_lpath then
- xml.lshow(result)
- end
- return result
- else
- return pattern
- end
-end
-
-function xml.cached_patterns()
- return cache
-end
-
--- we run out of locals (limited to 200)
---
--- local fallbackreport = (texio and texio.write) or io.write
-
-function xml.lshow(pattern,report)
--- report = report or fallbackreport
- report = report or (texio and texio.write) or io.write
- local lp = xml.lpath(pattern)
- if lp == false then
- report(" -: root\n")
- elseif lp == true then
- report(" -: wildcard\n")
- else
- if type(pattern) == "string" then
- report(format("pattern: %s\n",pattern))
- end
- for k=1,#lp do
- local v = lp[k]
- if #v > 1 then
- local t = { }
- for i=2,#v do
- local vv = v[i]
- if type(vv) == "string" then
- t[#t+1] = (vv ~= "" and vv) or "#"
- elseif type(vv) == "boolean" then
- t[#t+1] = (vv and "==") or "<>"
- end
- end
- report(format("%2i: %s %s -> %s\n", k,v[1],actions[v[1]],concat(t," ")))
- else
- report(format("%2i: %s %s\n", k,v[1],actions[v[1]]))
- end
- end
- end
-end
-
-function xml.xshow(e,...) -- also handy when report is given, use () to isolate first e
- local t = { ... }
--- local report = (type(t[#t]) == "function" and t[#t]) or fallbackreport
- local report = (type(t[#t]) == "function" and t[#t]) or (texio and texio.write) or io.write
- if e == nil then
- report("<!-- no element -->\n")
- elseif type(e) ~= "table" then
- report(tostring(e))
- elseif e.tg then
- report(tostring(e) .. "\n")
- else
- for i=1,#e do
- report(tostring(e[i]) .. "\n")
- end
- end
-end
-
---[[ldx--
-<p>An <l n='lpath'/> is converted to a table with instructions for traversing the
-tree. Hoever, simple cases are signaled by booleans. Because we don't know in
-advance what we want to do with the found element the handle gets three arguments:</p>
-
-<lines>
-<t>r</t> : the root element of the data table
-<t>d</t> : the data table of the result
-<t>t</t> : the index in the data table of the result
-</lines>
-
-<p> Access to the root and data table makes it possible to construct insert and delete
-functions.</p>
---ldx]]--
-
-local functions = xml.functions
-local expressions = xml.expressions
-
-expressions.contains = string.find
-expressions.find = string.find
-expressions.upper = string.upper
-expressions.lower = string.lower
-expressions.number = tonumber
-expressions.boolean = toboolean
-
-expressions.oneof = function(s,...) -- slow
- local t = {...} for i=1,#t do if s == t[i] then return true end end return false
-end
-
-expressions.error = function(str)
- xml.error_handler("unknown function in lpath expression",str or "?")
- return false
-end
-
-functions.text = function(root,k,n) -- unchecked, maybe one deeper
- local t = type(t)
- if t == "string" then
- return t
- else -- todo n
- local rdt = root.dt
- return (rdt and rdt[k]) or root[k] or ""
- end
-end
-
-functions.name = function(d,k,n) -- ns + tg
- local found = false
- n = n or 0
- if not k then
- -- not found
- elseif n == 0 then
- local dk = d[k]
- found = dk and (type(dk) == "table") and dk
- elseif n < 0 then
- for i=k-1,1,-1 do
- local di = d[i]
- if type(di) == "table" then
- if n == -1 then
- found = di
- break
- else
- n = n + 1
- end
- end
- end
- else
- for i=k+1,#d,1 do
- local di = d[i]
- if type(di) == "table" then
- if n == 1 then
- found = di
- break
- else
- n = n - 1
- end
- end
- end
- end
- if found then
- local ns, tg = found.rn or found.ns or "", found.tg
- if ns ~= "" then
- return ns .. ":" .. tg
- else
- return tg
- end
- else
- return ""
- end
-end
-
-functions.tag = function(d,k,n) -- only tg
- local found = false
- n = n or 0
- if not k then
- -- not found
- elseif n == 0 then
- local dk = d[k]
- found = dk and (type(dk) == "table") and dk
- elseif n < 0 then
- for i=k-1,1,-1 do
- local di = d[i]
- if type(di) == "table" then
- if n == -1 then
- found = di
- break
- else
- n = n + 1
- end
- end
- end
- else
- for i=k+1,#d,1 do
- local di = d[i]
- if type(di) == "table" then
- if n == 1 then
- found = di
- break
- else
- n = n - 1
- end
- end
- end
- end
- return (found and found.tg) or ""
-end
-
-expressions.text = functions.text
-expressions.name = functions.name
-expressions.tag = functions.tag
-
-local function traverse(root,pattern,handle,reverse,index,parent,wildcard) -- multiple only for tags, not for namespaces
- if not root then -- error
- return false
- elseif pattern == false then -- root
- handle(root,root.dt,root.ri)
- return false
- elseif pattern == true then -- wildcard
- local rootdt = root.dt
- if rootdt then
- local start, stop, step = 1, #rootdt, 1
- if reverse then
- start, stop, step = stop, start, -1
- end
- for k=start,stop,step do
- if handle(root,rootdt,root.ri or k) then return false end
- if not traverse(rootdt[k],true,handle,reverse) then return false end
- end
- end
- return false
- elseif root.dt then
- index = index or 1
- local action = pattern[index]
- local command = action[1]
- if command == 29 then -- fast case /oeps
- local rootdt = root.dt
- for k=1,#rootdt do
- local e = rootdt[k]
- local tg = e.tg
- if e.tg then
- local ns = e.rn or e.ns
- local ns_a, tg_a = action[3], action[4]
- local matched = (ns_a == "*" or ns == ns_a) and (tg_a == "*" or tg == tg_a)
- if not action[2] then matched = not matched end
- if matched then
- if handle(root,rootdt,k) then return false end
- end
- end
- end
- elseif command == 11 then -- parent
- local ep = root.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- else
- if (command == 16 or command == 12) and index == 1 then -- initial
- -- wildcard = true
- wildcard = command == 16 -- ok?
- index = index + 1
- action = pattern[index]
- command = action and action[1] or 0 -- something is wrong
- end
- if command == 11 then -- parent
- local ep = root.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- else
- local rootdt = root.dt
- local start, stop, step, n, dn = 1, #rootdt, 1, 0, 1
- if command == 30 then
- if action[5] < 0 then
- start, stop, step = stop, start, -1
- dn = -1
- end
- elseif reverse and index == #pattern then
- start, stop, step = stop, start, -1
- end
- local idx = 0
- local hsh = { } -- this will slooow down the lot
- for k=start,stop,step do -- we used to have functions for all but a case is faster
- local e = rootdt[k]
- local ns, tg = e.rn or e.ns, e.tg
- if tg then
- -- we can optimize this for simple searches, but it probably does not pay off
- hsh[tg] = (hsh[tg] or 0) + 1
- idx = idx + 1
- if command == 30 then
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- if matched then
- n = n + dn
- if n == action[5] then
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- break
- end
- elseif wildcard then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- end
- else
- local matched, multiple = false, false
- if command == 20 then -- match
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- elseif command == 21 then -- match one of
- multiple = true
- for i=3,#action,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- elseif command == 22 then -- eq
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- matched = matched and e.at[action[6]] == action[7]
- elseif command == 23 then -- ne
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = mached and e.at[action[6]] ~= action[7]
- elseif command == 24 then -- one of eq
- multiple = true
- for i=3,#action-2,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[#action-1]] == action[#action]
- elseif command == 25 then -- one of ne
- multiple = true
- for i=3,#action-2,2 do
- local ns_a, tg_a = action[i], action[i+1]
- if (ns_a == "*" or ns == ns_a) and (tg == "*" or tg == tg_a) then
- matched = true
- break
- end
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[#action-1]] ~= action[#action]
- elseif command == 27 then -- has attribute
- local ns_a, tg_a = action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = matched and e.at[action[5]]
- elseif command == 28 then -- has value
- local edt, ns_a, tg_a = e.dt, action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- matched = matched and edt and edt[1] == action[5]
- elseif command == 31 then
- local edt, ns_a, tg_a = e.dt, action[3], action[4]
- if tg == tg_a then
- matched = ns_a == "*" or ns == ns_a
- elseif tg_a == '*' then
- matched, multiple = ns_a == "*" or ns == ns_a, true
- else
- matched = false
- end
- if not action[2] then matched = not matched end
- if matched then
- matched = action[6](expressions,root,rootdt,k,e,edt,ns,tg,idx,hsh[tg] or 1)
- end
- end
- if matched then -- combine tg test and at test
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- if wildcard then
- if multiple then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- else
- -- maybe or multiple; anyhow, check on (section|title) vs just section and title in example in lxml
- if not traverse(e,pattern,handle,reverse,index,root) then return false end
- end
- end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- elseif command == 14 then -- any
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root) then return false end
- end
- elseif command == 15 then -- many
- if index == #pattern then
- if handle(root,rootdt,root.ri or k) then return false end
- else
- if not traverse(e,pattern,handle,reverse,index+1,root,true) then return false end
- end
- -- not here : 11
- elseif command == 11 then -- parent
- local ep = e.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,root,index+1) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- elseif command == 40 and e.special and tg == "@pi@" then -- pi
- local pi = action[2]
- if pi ~= "" then
- local pt = e.dt[1]
- if pt and pt:find(pi) then
- if handle(root,rootdt,k) then
- return false
- end
- end
- elseif handle(root,rootdt,k) then
- return false
- end
- elseif wildcard then
- if not traverse(e,pattern,handle,reverse,index,root,true) then return false end
- end
- end
- else
- -- not here : 11
- if command == 11 then -- parent
- local ep = e.__p__ or parent
- if index < #pattern then
- if not traverse(ep,pattern,handle,reverse,index+1,root) then return false end
- elseif handle(root,rootdt,k) then
- return false
- end
- break -- else loop
- end
- end
- end
- end
- end
- end
- return true
-end
-
-xml.traverse = traverse
-
---[[ldx--
-<p>Next come all kind of locators and manipulators. The most generic function here
-is <t>xml.filter(root,pattern)</t>. All registers functions in the filters namespace
-can be path of a search path, as in:</p>
-
-<typing>
-local r, d, k = xml.filter(root,"/a/b/c/position(4)"
-</typing>
---ldx]]--
-
-local traverse, lpath, convert = xml.traverse, xml.lpath, xml.convert
-
-xml.filters = { }
-
-function xml.filters.default(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end)
- return dt and dt[dk], rt, dt, dk
-end
-
-function xml.filters.attributes(root,pattern,arguments)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk = r, d, k return true end)
- local ekat = (dt and dt[dk] and dt[dk].at) or (rt and rt.at)
- if ekat then
- if arguments then
- return ekat[arguments] or "", rt, dt, dk
- else
- return ekat, rt, dt, dk
- end
- else
- return { }, rt, dt, dk
- end
-end
-
-function xml.filters.reverse(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end, 'reverse')
- return dt and dt[dk], rt, dt, dk
-end
-
-function xml.filters.count(root,pattern,everything)
- local n = 0
- traverse(root, lpath(pattern), function(r,d,t)
- if everything or type(d[t]) == "table" then
- n = n + 1
- end
- end)
- return n
-end
-
-function xml.filters.elements(root, pattern) -- == all
- local t = { }
- traverse(root, lpath(pattern), function(r,d,k)
- local e = d[k]
- if e then
- t[#t+1] = e
- end
- end)
- return t
-end
-
-function xml.filters.texts(root, pattern)
- local t = { }
- traverse(root, lpath(pattern), function(r,d,k)
- local e = d[k]
- if e and e.dt then
- t[#t+1] = e.dt
- end
- end)
- return t
-end
-
-function xml.filters.first(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end)
- return dt and dt[dk], rt, dt, dk
-end
-
-function xml.filters.last(root,pattern)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt,dt,dk = r,d,k return true end, 'reverse')
- return dt and dt[dk], rt, dt, dk
-end
-
-function xml.filters.index(root,pattern,arguments)
- local rt, dt, dk, reverse, i = nil, nil, nil, false, tonumber(arguments or '1') or 1
- if i and i ~= 0 then
- if i < 0 then
- reverse, i = true, -i
- end
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk, i = r, d, k, i-1 return i == 0 end, reverse)
- if i == 0 then
- return dt and dt[dk], rt, dt, dk
- end
- end
- return nil, nil, nil, nil
-end
-
-function xml.filters.attribute(root,pattern,arguments)
- local rt, dt, dk
- traverse(root, lpath(pattern), function(r,d,k) rt, dt, dk = r, d, k return true end)
- local ekat = (dt and dt[dk] and dt[dk].at) or (rt and rt.at)
- return (ekat and (ekat[arguments] or ekat[gsub(arguments,"^([\"\'])(.*)%1$","%2")])) or ""
-end
-
-function xml.filters.text(root,pattern,arguments) -- ?? why index, tostring slow
- local dtk, rt, dt, dk = xml.filters.index(root,pattern,arguments)
- if dtk then -- n
- local dtkdt = dtk.dt
- if not dtkdt then
- return "", rt, dt, dk
- elseif #dtkdt == 1 and type(dtkdt[1]) == "string" then
- return dtkdt[1], rt, dt, dk
- else
- return xml.tostring(dtkdt), rt, dt, dk
- end
- else
- return "", rt, dt, dk
- end
-end
-
-function xml.filters.tag(root,pattern,n)
- local tag = ""
- traverse(root, lpath(pattern), function(r,d,k)
- tag = xml.functions.tag(d,k,n and tonumber(n))
- return true
- end)
- return tag
-end
-
-function xml.filters.name(root,pattern,n)
- local tag = ""
- traverse(root, lpath(pattern), function(r,d,k)
- tag = xml.functions.name(d,k,n and tonumber(n))
- return true
- end)
- return tag
-end
-
---[[ldx--
-<p>For splitting the filter function from the path specification, we can
-use string matching or lpeg matching. Here the difference in speed is
-neglectable but the lpeg variant is more robust.</p>
---ldx]]--
-
--- not faster but hipper ... although ... i can't get rid of the trailing / in the path
-
-local P, S, R, C, V, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc
-
-local slash = P('/')
-local name = (R("az","AZ","--","__"))^1
-local path = C(((1-slash)^0 * slash)^1)
-local argument = P { "(" * C(((1 - S("()")) + V(1))^0) * ")" }
-local action = Cc(1) * path * C(name) * argument
-local attribute = Cc(2) * path * P('@') * C(name)
-local direct = Cc(3) * Cc("../*") * slash^0 * C(name) * argument
-
-local parser = direct + action + attribute
-
-local filters = xml.filters
-local attribute_filter = xml.filters.attributes
-local default_filter = xml.filters.default
-
--- todo: also hash, could be gc'd
-
-function xml.filter(root,pattern)
- local kind, a, b, c = parser:match(pattern)
- if kind == 1 or kind == 3 then
- return (filters[b] or default_filter)(root,a,c)
- elseif kind == 2 then
- return attribute_filter(root,a,b)
- else
- return default_filter(root,pattern)
- end
-end
-
---~ slightly faster, but first we need a proper test file
---~
---~ local hash = { }
---~
---~ function xml.filter(root,pattern)
---~ local h = hash[pattern]
---~ if not h then
---~ local kind, a, b, c = parser:match(pattern)
---~ if kind == 1 then
---~ h = { kind, filters[b] or default_filter, a, b, c }
---~ elseif kind == 2 then
---~ h = { kind, attribute_filter, a, b, c }
---~ else
---~ h = { kind, default_filter, a, b, c }
---~ end
---~ hash[pattern] = h
---~ end
---~ local kind = h[1]
---~ if kind == 1 then
---~ return h[2](root,h[2],h[4])
---~ elseif kind == 2 then
---~ return h[2](root,h[2],h[3])
---~ else
---~ return h[2](root,pattern)
---~ end
---~ end
-
---[[ldx--
-<p>The following functions collect elements and texts.</p>
---ldx]]--
-
--- still somewhat bugged
-
-function xml.collect_elements(root, pattern, ignorespaces)
- local rr, dd = { }, { }
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d and d[k]
- if dk then
- if ignorespaces and type(dk) == "string" and dk:find("[^%S]") then
- -- ignore
- else
- local n = #rr+1
- rr[n], dd[n] = r, dk
- end
- end
- end)
- return dd, rr
-end
-
-function xml.collect_texts(root, pattern, flatten)
- local t = { } -- no r collector
- traverse(root, lpath(pattern), function(r,d,k)
- if d then
- local ek = d[k]
- local tx = ek and ek.dt
- if flatten then
- if tx then
- t[#t+1] = xml.tostring(tx) or ""
- else
- t[#t+1] = ""
- end
- else
- t[#t+1] = tx or ""
- end
- else
- t[#t+1] = ""
- end
- end)
- return t
-end
-
-function xml.collect_tags(root, pattern, nonamespace)
- local t = { }
- xml.traverse(root, xml.lpath(pattern), function(r,d,k)
- local dk = d and d[k]
- if dk and type(dk) == "table" then
- local ns, tg = e.ns, e.tg
- if nonamespace then
- t[#t+1] = tg -- if needed we can return an extra table
- elseif ns == "" then
- t[#t+1] = tg
- else
- t[#t+1] = ns .. ":" .. tg
- end
- end
- end)
- return #t > 0 and {}
-end
-
---[[ldx--
-<p>Often using an iterators looks nicer in the code than passing handler
-functions. The <l n='lua'/> book describes how to use coroutines for that
-purpose (<url href='http://www.lua.org/pil/9.3.html'/>). This permits
-code like:</p>
-
-<typing>
-for r, d, k in xml.elements(xml.load('text.xml'),"title") do
- print(d[k])
-end
-</typing>
-
-<p>Which will print all the titles in the document. The iterator variant takes
-1.5 times the runtime of the function variant which is due to the overhead in
-creating the wrapper. So, instead of:</p>
-
-<typing>
-function xml.filters.first(root,pattern)
- for rt,dt,dk in xml.elements(root,pattern)
- return dt and dt[dk], rt, dt, dk
- end
- return nil, nil, nil, nil
-end
-</typing>
-
-<p>We use the function variants in the filters.</p>
---ldx]]--
-
-local wrap, yield = coroutine.wrap, coroutine.yield
-
-function xml.elements(root,pattern,reverse)
- return wrap(function() traverse(root, lpath(pattern), yield, reverse) end)
-end
-
-function xml.elements_only(root,pattern,reverse)
- return wrap(function() traverse(root, lpath(pattern), function(r,d,k) yield(d[k]) end, reverse) end)
-end
-
-function xml.each_element(root, pattern, handle, reverse)
- local ok
- traverse(root, lpath(pattern), function(r,d,k) ok = true handle(r,d,k) end, reverse)
- return ok
-end
-
-function xml.process_elements(root, pattern, handle)
- traverse(root, lpath(pattern), function(r,d,k)
- local dkdt = d[k].dt
- if dkdt then
- for i=1,#dkdt do
- local v = dkdt[i]
- if v.tg then handle(v) end
- end
- end
- end)
-end
-
-function xml.process_attributes(root, pattern, handle)
- traverse(root, lpath(pattern), function(r,d,k)
- local ek = d[k]
- local a = ek.at or { }
- handle(a)
- if next(a) then -- next is faster than type (and >0 test)
- ek.at = a
- else
- ek.at = nil
- end
- end)
-end
-
---[[ldx--
-<p>We've now arrives at the functions that manipulate the tree.</p>
---ldx]]--
-
-function xml.inject_element(root, pattern, element, prepend)
- if root and element then
- local matches, collect = { }, nil
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element then
- collect = function(r,d,k) matches[#matches+1] = { r, d, k, element } end
- traverse(root, lpath(pattern), collect)
- for i=1,#matches do
- local m = matches[i]
- local r, d, k, element, edt = m[1], m[2], m[3], m[4], nil
- if element.ri then
- element = element.dt[element.ri].dt
- else
- element = element.dt
- end
- if r.ri then
- edt = r.dt[r.ri].dt
- else
- edt = d and d[k] and d[k].dt
- end
- if edt then
- local be, af
- if prepend then
- be, af = xml.copy(element), edt
- else
- be, af = edt, xml.copy(element)
- end
- for i=1,#af do
- be[#be+1] = af[i]
- end
- if r.ri then
- r.dt[r.ri].dt = be
- else
- d[k].dt = be
- end
- else
- -- r.dt = element.dt -- todo
- end
- end
- end
- end
-end
-
--- todo: copy !
-
-function xml.insert_element(root, pattern, element, before) -- todo: element als functie
- if root and element then
- if pattern == "/" then
- xml.inject_element(root, pattern, element, before)
- else
- local matches, collect = { }, nil
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element and element.ri then
- element = element.dt[element.ri]
- end
- if element then
- collect = function(r,d,k) matches[#matches+1] = { r, d, k, element } end
- traverse(root, lpath(pattern), collect)
- for i=#matches,1,-1 do
- local m = matches[i]
- local r, d, k, element = m[1], m[2], m[3], m[4]
- if not before then k = k + 1 end
- if element.tg then
- insert(d,k,element) -- untested
---~ elseif element.dt then
---~ for _,v in ipairs(element.dt) do -- i added
---~ insert(d,k,v)
---~ k = k + 1
---~ end
---~ end
- else
- local edt = element.dt
- if edt then
- for i=1,#edt do
- insert(d,k,edt[i])
- k = k + 1
- end
- end
- end
- end
- end
- end
- end
-end
-
-xml.insert_element_after = xml.insert_element
-xml.insert_element_before = function(r,p,e) xml.insert_element(r,p,e,true) end
-xml.inject_element_after = xml.inject_element
-xml.inject_element_before = function(r,p,e) xml.inject_element(r,p,e,true) end
-
-function xml.delete_element(root, pattern)
- local matches, deleted = { }, { }
- local collect = function(r,d,k) matches[#matches+1] = { r, d, k } end
- traverse(root, lpath(pattern), collect)
- for i=#matches,1,-1 do
- local m = matches[i]
- deleted[#deleted+1] = remove(m[2],m[3])
- end
- return deleted
-end
-
-function xml.replace_element(root, pattern, element)
- if type(element) == "string" then
- element = convert(element,true)
- end
- if element and element.ri then
- element = element.dt[element.ri]
- end
- if element then
- traverse(root, lpath(pattern), function(rm, d, k)
- d[k] = element.dt -- maybe not clever enough
- end)
- end
-end
-
-local function load_data(name) -- == io.loaddata
- local f, data = io.open(name), ""
- if f then
- data = f:read("*all",'b') -- 'b' ?
- f:close()
- end
- return data
-end
-
-function xml.include(xmldata,pattern,attribute,recursive,loaddata)
- -- parse="text" (default: xml), encoding="" (todo)
- -- attribute = attribute or 'href'
- pattern = pattern or 'include'
- loaddata = loaddata or load_data
- local function include(r,d,k)
- local ek, name = d[k], nil
- if not attribute or attribute == "" then
- local ekdt = ek.dt
- name = (type(ekdt) == "table" and ekdt[1]) or ekdt
- end
- if not name then
- if ek.at then
- for a in gmatch(attribute or "href","([^|]+)") do
- name = ek.at[a]
- if name then break end
- end
- end
- end
- local data = (name and name ~= "" and loaddata(name)) or ""
- if data == "" then
- xml.empty(d,k)
- elseif ek.at["parse"] == "text" then -- for the moment hard coded
- d[k] = xml.escaped(data)
- else
- local xi = xml.convert(data)
- if not xi then
- xml.empty(d,k)
- else
- if recursive then
- xml.include(xi,pattern,attribute,recursive,loaddata)
- end
- xml.assign(d,k,xi)
- end
- end
- end
- xml.each_element(xmldata, pattern, include)
-end
-
-function xml.strip_whitespace(root, pattern, nolines) -- strips all leading and trailing space !
- traverse(root, lpath(pattern), function(r,d,k)
- local dkdt = d[k].dt
- if dkdt then -- can be optimized
- local t = { }
- for i=1,#dkdt do
- local str = dkdt[i]
- if type(str) == "string" then
-
- if str == "" then
- -- stripped
- else
- if nolines then
- str = gsub(str,"[ \n\r\t]+"," ")
- end
- if str == "" then
- -- stripped
- else
- t[#t+1] = str
- end
- end
- else
- t[#t+1] = str
- end
- end
- d[k].dt = t
- end
- end)
-end
-
-local function rename_space(root, oldspace, newspace) -- fast variant
- local ndt = #root.dt
- for i=1,ndt or 0 do
- local e = root[i]
- if type(e) == "table" then
- if e.ns == oldspace then
- e.ns = newspace
- if e.rn then
- e.rn = newspace
- end
- end
- local edt = e.dt
- if edt then
- rename_space(edt, oldspace, newspace)
- end
- end
- end
-end
-
-xml.rename_space = rename_space
-
-function xml.remap_tag(root, pattern, newtg)
- traverse(root, lpath(pattern), function(r,d,k)
- d[k].tg = newtg
- end)
-end
-function xml.remap_namespace(root, pattern, newns)
- traverse(root, lpath(pattern), function(r,d,k)
- d[k].ns = newns
- end)
-end
-function xml.check_namespace(root, pattern, newns)
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d[k]
- if (not dk.rn or dk.rn == "") and dk.ns == "" then
- dk.rn = newns
- end
- end)
-end
-function xml.remap_name(root, pattern, newtg, newns, newrn)
- traverse(root, lpath(pattern), function(r,d,k)
- local dk = d[k]
- dk.tg = newtg
- dk.ns = newns
- dk.rn = newrn
- end)
-end
-
-function xml.filters.found(root,pattern,check_content)
- local found = false
- traverse(root, lpath(pattern), function(r,d,k)
- if check_content then
- local dk = d and d[k]
- found = dk and dk.dt and next(dk.dt) and true
- else
- found = true
- end
- return true
- end)
- return found
-end
-
---[[ldx--
-<p>Here are a few synonyms.</p>
---ldx]]--
-
-xml.filters.position = xml.filters.index
-
-xml.count = xml.filters.count
-xml.index = xml.filters.index
-xml.position = xml.filters.index
-xml.first = xml.filters.first
-xml.last = xml.filters.last
-xml.found = xml.filters.found
-
-xml.each = xml.each_element
-xml.process = xml.process_element
-xml.strip = xml.strip_whitespace
-xml.collect = xml.collect_elements
-xml.all = xml.collect_elements
-
-xml.insert = xml.insert_element_after
-xml.inject = xml.inject_element_after
-xml.after = xml.insert_element_after
-xml.before = xml.insert_element_before
-xml.delete = xml.delete_element
-xml.replace = xml.replace_element
-
---[[ldx--
-<p>The following helper functions best belong to the <t>lmxl-ini</t>
-module. Some are here because we need then in the <t>mk</t>
-document and other manuals, others came up when playing with
-this module. Since this module is also used in <l n='mtxrun'/> we've
-put them here instead of loading mode modules there then needed.</p>
---ldx]]--
-
-function xml.gsub(t,old,new)
- local dt = t.dt
- if dt then
- for k=1,#dt do
- local v = dt[k]
- if type(v) == "string" then
- dt[k] = gsub(v,old,new)
- else
- xml.gsub(v,old,new)
- end
- end
- end
-end
-
-function xml.strip_leading_spaces(dk,d,k) -- cosmetic, for manual
- if d and k and d[k-1] and type(d[k-1]) == "string" then
- local s = d[k-1]:match("\n(%s+)")
- xml.gsub(dk,"\n"..string.rep(" ",#s),"\n")
- end
-end
-
-function xml.serialize_path(root,lpath,handle)
- local dk, r, d, k = xml.first(root,lpath)
- dk = xml.copy(dk)
- xml.strip_leading_spaces(dk,d,k)
- xml.serialize(dk,handle)
-end
-
---~ xml.escapes = { ['&'] = '&amp;', ['<'] = '&lt;', ['>'] = '&gt;', ['"'] = '&quot;' }
---~ xml.unescapes = { } for k,v in pairs(xml.escapes) do xml.unescapes[v] = k end
-
---~ function xml.escaped (str) return (gsub(str,"(.)" , xml.escapes )) end
---~ function xml.unescaped(str) return (gsub(str,"(&.-;)", xml.unescapes)) end
---~ function xml.cleansed (str) return (gsub(str,"<.->" , '' )) end -- "%b<>"
-
-local P, S, R, C, V, Cc, Cs = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Cs
-
--- 100 * 2500 * "oeps< oeps> oeps&" : gsub:lpeg|lpeg|lpeg
---
--- 1021:0335:0287:0247
-
--- 10 * 1000 * "oeps< oeps> oeps& asfjhalskfjh alskfjh alskfjh alskfjh ;al J;LSFDJ"
---
--- 1559:0257:0288:0190 (last one suggested by roberto)
-
--- escaped = Cs((S("<&>") / xml.escapes + 1)^0)
--- escaped = Cs((S("<")/"&lt;" + S(">")/"&gt;" + S("&")/"&amp;" + 1)^0)
-local normal = (1 - S("<&>"))^0
-local special = P("<")/"&lt;" + P(">")/"&gt;" + P("&")/"&amp;"
-local escaped = Cs(normal * (special * normal)^0)
-
--- 100 * 1000 * "oeps&lt; oeps&gt; oeps&amp;" : gsub:lpeg == 0153:0280:0151:0080 (last one by roberto)
-
--- unescaped = Cs((S("&lt;")/"<" + S("&gt;")/">" + S("&amp;")/"&" + 1)^0)
--- unescaped = Cs((((P("&")/"") * (P("lt")/"<" + P("gt")/">" + P("amp")/"&") * (P(";")/"")) + 1)^0)
-local normal = (1 - S"&")^0
-local special = P("&lt;")/"<" + P("&gt;")/">" + P("&amp;")/"&"
-local unescaped = Cs(normal * (special * normal)^0)
-
--- 100 * 5000 * "oeps <oeps bla='oeps' foo='bar'> oeps </oeps> oeps " : gsub:lpeg == 623:501 msec (short tags, less difference)
-
-local cleansed = Cs(((P("<") * (1-P(">"))^0 * P(">"))/"" + 1)^0)
-
-function xml.escaped (str) return escaped :match(str) end
-function xml.unescaped(str) return unescaped:match(str) end
-function xml.cleansed (str) return cleansed :match(str) end
-
-function xml.join(t,separator,lastseparator)
- if #t > 0 then
- local result = { }
- for k,v in pairs(t) do
- result[k] = xml.tostring(v)
- end
- if lastseparator then
- return concat(result,separator or "",1,#result-1) .. (lastseparator or "") .. result[#result]
- else
- return concat(result,separator)
- end
- else
- return ""
- end
-end
-
-function xml.statistics()
- return {
- lpathcalls = lpathcalls,
- lpathcached = lpathcached,
- }
-end
-
--- xml.set_text_cleanup(xml.show_text_entities)
--- xml.set_text_cleanup(xml.resolve_text_entities)
-
---~ xml.lshow("/../../../a/(b|c)[@d='e']/f")
---~ xml.lshow("/../../../a/!(b|c)[@d='e']/f")
---~ xml.lshow("/../../../a/!b[@d!='e']/f")
-
---~ x = xml.convert([[
---~ <a>
---~ <b n='01'>01</b>
---~ <b n='02'>02</b>
---~ <b n='03'>03</b>
---~ <b n='04'>OK</b>
---~ <b n='05'>05</b>
---~ <b n='06'>06</b>
---~ <b n='07'>ALSO OK</b>
---~ </a>
---~ ]])
-
---~ xml.settrace("lpath",true)
-
---~ xml.xshow(xml.first(x,"b[position() > 2 and position() < 5 and text() == 'ok']"))
---~ xml.xshow(xml.first(x,"b[position() > 2 and position() < 5 and text() == upper('ok')]"))
---~ xml.xshow(xml.first(x,"b[@n=='03' or @n=='08']"))
---~ xml.xshow(xml.all (x,"b[number(@n)>2 and number(@n)<6]"))
---~ xml.xshow(xml.first(x,"b[find(text(),'ALSO')]"))
-
---~ str = [[
---~ <?xml version="1.0" encoding="utf-8"?>
---~ <story line='mojca'>
---~ <windows>my secret</mouse>
---~ </story>
---~ ]]
-
---~ x = xml.convert([[
---~ <a><b n='01'>01</b><b n='02'>02</b><x>xx</x><b n='03'>03</b><b n='04'>OK</b></a>
---~ ]])
---~ xml.xshow(xml.first(x,"b[tag(2) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(1) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(-1) == 'x']"))
---~ xml.xshow(xml.first(x,"b[tag(-2) == 'x']"))
-
---~ print(xml.filter(x,"b/tag(2)"))
---~ print(xml.filter(x,"b/tag(1)"))
diff --git a/Master/texmf-dist/tex/context/base/lxml-sor.lua b/Master/texmf-dist/tex/context/base/lxml-sor.lua
new file mode 100644
index 00000000000..e220bfad616
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-sor.lua
@@ -0,0 +1,158 @@
+if not modules then modules = { } end modules ['lxml-sor'] = {
+ version = 1.001,
+ comment = "companion to lxml-sor.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, concat = string.format, table.concat
+local lpegmatch = lpeg.match
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+
+lxml.sorters = lxml.sorters or { }
+
+if not lxml.splitid then
+ local splitter = lpeg.C((1-lpeg.P(":"))^1) * lpeg.P("::") * lpeg.C(lpeg.P(1)^1)
+ function lxml.splitid(id)
+ local d, i = lpegmatch(splitter,id)
+ if d then
+ return d, i
+ else
+ return "", id
+ end
+ end
+end
+
+local lists = { }
+
+function lxml.sorters.reset(name)
+ lists[name] = {
+ sorted = false,
+ entries = { },
+ reverse = { },
+ results = { },
+ }
+end
+
+function lxml.sorters.add(name,n,key)
+ local list = lists[name]
+ if list.sorted then
+ -- reverse is messed up, we could regenerate it and go on
+ else
+ local entries = list and list.entries
+ if entries then
+ local reverse = list.reverse
+ local e = reverse[n]
+ if e then
+ local keys = entries[e][2]
+ keys[#keys+1] = key
+ else
+ entries[#entries+1] = { n, { key } }
+ reverse[n] = #entries
+ end
+ end
+ end
+end
+
+function lxml.sorters.show(name)
+ local list = lists[name]
+ local entries = list and list.entries
+ local NC, NR, bold = context.NC, context.NR, context.bold -- somehow bold is not working
+ if entries then
+ local maxn = 1
+ for i=1,#entries do
+ if #entries[i][2] > maxn then maxn = #entries[i][2] end
+ end
+ context.starttabulate { "|Tr|Tr|" .. string.rep("Tlp|",maxn) }
+ NC() bold("n")
+ NC() bold("id")
+ if maxn > 1 then
+ for i=1,maxn do
+ NC() bold("entry " .. i)
+ end
+ else
+ NC() bold("entry")
+ end
+ NC() NR()
+ context.HL()
+ for i=1,#entries do
+ local entry = entries[i]
+ local document, node = lxml.splitid(entry[1])
+ NC() context(i)
+ NC() context(node)
+ local e = entry[2]
+ for i=1,#e do
+ NC() context.detokenize(e[i])
+ end
+ NC() NR()
+ end
+ context.stoptabulate()
+ end
+end
+
+lxml.sorters.compare = sorters.comparers.basic -- (a,b)
+
+function lxml.sorters.sort(name)
+ local list = lists[name]
+ local entries = list and list.entries
+ if entries then
+ -- filtering
+ local results = { }
+ list.results = results
+ for i=1,#entries do
+ local entry = entries[i]
+ results[i] = {
+ entry = entry[1],
+ key = concat(entry[2], " "),
+ }
+ end
+ -- preparation
+ local strip = sorters.strip
+ local splitter = sorters.splitters.utf
+ local firstofsplit = sorters.firstofsplit
+ for i=1, #results do
+ local r = results[i]
+ r.split = splitter(strip(r.key))
+ end
+ -- sorting
+ sorters.sort(results,lxml.sorters.compare)
+ -- finalizing
+ list.nofsorted = #results
+ local split = { }
+ for k=1,#results do -- rather generic so maybe we need a function
+ local v = results[k]
+ local entry, tag = firstofsplit(v)
+ local s = split[entry] -- keeps track of change
+ if not s then
+ s = { tag = tag, data = { } }
+ split[entry] = s
+ end
+ s.data[#s.data+1] = v
+ end
+ list.results = split
+ -- done
+ list.sorted = true
+ end
+end
+
+function lxml.sorters.flush(name,setup)
+ local list = lists[name]
+ local results = list and list.results
+ local xmlw = context.xmlw
+ if results and next(results) then
+ for key, result in next, results do
+ local tag, data = result.tag, result.data
+ for d=1,#data do
+ xmlw(setup,data[d].entry)
+ end
+ end
+ else
+ local entries = list and list.entries
+ if entries then
+ for i=1,#entries do
+ xmlw(setup,entries[i][1])
+ end
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-sor.mkiv b/Master/texmf-dist/tex/context/base/lxml-sor.mkiv
new file mode 100644
index 00000000000..14425967bd9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-sor.mkiv
@@ -0,0 +1,94 @@
+%D \module
+%D [ file=lxml-sor,
+%D version=2009.08.24,
+%D title=\CONTEXT\ \XML\ Support,
+%D subtitle=Sorting,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D THIS IS VERY EXPERIMENTAL!
+
+\writestatus{loading}{ConTeXt XML Support / Sorting}
+
+\registerctxluafile{lxml-sor}{1.001}
+
+\unprotect
+
+\def\xmlresetsorter #1{\ctxlua{lxml.sorters.reset("#1")}}
+\def\xmladdsortentry#1#2#3{\ctxlua{lxml.sorters.add("#1","#2",\!!bs#3\!!es)}}
+\def\xmlshowsorter #1{\ctxlua{lxml.sorters.show("#1")}}
+\def\xmlflushsorter #1#2{\ctxlua{lxml.sorters.flush("#1","#2")}}
+\def\xmlsortentries #1{\ctxlua{lxml.sorters.sort("#1")}}
+
+\protect \endinput
+
+\startbuffer[test]
+<demo>
+ <entry>
+ <category>one</category>
+ <key>alpha</key>
+ <content>alpha indeed</content>
+ </entry>
+ <entry>
+ <category>one</category>
+ <key>gamma</key>
+ <content>gamma indeed</content>
+ </entry>
+ <entry>
+ <category>one</category>
+ <key>beta</key>
+ <content>beta indeed</content>
+ </entry>
+ <entry>
+ <category>two</category>
+ <key>alpha</key>
+ <content>alpha again</content>
+ </entry>
+ <entry>
+ <category>two</category>
+ <key>gamma</key>
+ <content>gamma again</content>
+ </entry>
+ <entry>
+ <category>two</category>
+ <key>beta</key>
+ <content>beta again</content>
+ </entry>
+</demo>
+\stopbuffer
+
+\startxmlsetups xml:mysetups
+ \xmlsetsetup{\xmldocument}{demo|entry|content}{xml:*}
+\stopxmlsetups
+
+\xmlregistersetup{xml:mysetups}
+
+\startxmlsetups xml:demo
+ \xmlresetsorter{demo}
+ \xmlfilter{#1}{entry/command(xml:entry:getkeys)}
+ \blank sortkeys: \blank\xmlshowsorter{demo}\blank
+ \xmlsortentries{demo}
+ \xmlflushsorter{demo}{xml:entry:flush}
+\stopxmlsetups
+
+\startxmlsetups xml:entry:getkeys
+ \xmladdsortentry{demo}{#1}{\xmltext{#1}{category}}
+ \xmladdsortentry{demo}{#1}{\xmltext{#1}{key|entry}}
+\stopxmlsetups
+
+\startxmlsetups xml:entry:flush
+ \xmltext{#1}{content}\par
+\stopxmlsetups
+
+\startxmlsetups xml:entry
+ \xmltext{#1}{content}\par
+\stopxmlsetups
+
+\starttext
+ \xmlprocessbuffer{main}{test}{}
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/lxml-tab.lua b/Master/texmf-dist/tex/context/base/lxml-tab.lua
index 77c28f8d3b7..23cd1cf0471 100644
--- a/Master/texmf-dist/tex/context/base/lxml-tab.lua
+++ b/Master/texmf-dist/tex/context/base/lxml-tab.lua
@@ -6,6 +6,12 @@ if not modules then modules = { } end modules ['lxml-tab'] = {
license = "see context related readme files"
}
+-- this module needs a cleanup: check latest lpeg, passing args, (sub)grammar, etc etc
+-- stripping spaces from e.g. cont-en.xml saves .2 sec runtime so it's not worth the
+-- trouble
+
+local trace_entities = false trackers.register("xml.entities", function(v) trace_entities = v end)
+
--[[ldx--
<p>The parser used here is inspired by the variant discussed in the lua book, but
handles comment and processing instructions, has a different structure, provides
@@ -13,18 +19,6 @@ parent access; a first version used different trickery but was less optimized to
went this route. First we had a find based parser, now we have an <l n='lpeg'/> based one.
The find based parser can be found in l-xml-edu.lua along with other older code.</p>
-<p>Expecially the lpath code is experimental, we will support some of xpath, but
-only things that make sense for us; as compensation it is possible to hook in your
-own functions. Apart from preprocessing content for <l n='context'/> we also need
-this module for process management, like handling <l n='ctx'/> and <l n='rlx'/>
-files.</p>
-
-<typing>
-a/b/c /*/c
-a/b/c/first() a/b/c/last() a/b/c/index(n) a/b/c/index(-n)
-a/b/c/text() a/b/c/text(1) a/b/c/text(-1) a/b/c/text(n)
-</typing>
-
<p>Beware, the interface may change. For instance at, ns, tg, dt may get more
verbose names. Once the code is stable we will also remove some tracing and
optimize the code.</p>
@@ -35,26 +29,11 @@ xml = xml or { }
--~ local xml = xml
local concat, remove, insert = table.concat, table.remove, table.insert
-local type, next, setmetatable = type, next, setmetatable
-local format, lower, find = string.format, string.lower, string.find
-
---[[ldx--
-<p>This module can be used stand alone but also inside <l n='mkiv'/> in
-which case it hooks into the tracker code. Therefore we provide a few
-functions that set the tracers.</p>
---ldx]]--
-
-local trace_remap = false
-
-if trackers then
- trackers.register("xml.remap", function(v) trace_remap = v end)
-end
-
-function xml.settrace(str,value)
- if str == "remap" then
- trace_remap = value or false
- end
-end
+local type, next, setmetatable, getmetatable, tonumber = type, next, setmetatable, getmetatable, tonumber
+local format, lower, find, match, gsub = string.format, string.lower, string.find, string.match, string.gsub
+local utfchar = unicode.utf8.char
+local lpegmatch = lpeg.match
+local P, S, R, C, V, C, Cs = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V, lpeg.C, lpeg.Cs
--[[ldx--
<p>First a hack to enable namespace resolving. A namespace is characterized by
@@ -66,7 +45,7 @@ much cleaner.</p>
xml.xmlns = xml.xmlns or { }
-local check = lpeg.P(false)
+local check = P(false)
local parse = check
--[[ldx--
@@ -79,8 +58,8 @@ xml.registerns("mml","mathml")
--ldx]]--
function xml.registerns(namespace, pattern) -- pattern can be an lpeg
- check = check + lpeg.C(lpeg.P(lower(pattern))) / namespace
- parse = lpeg.P { lpeg.P(check) + 1 * lpeg.V(1) }
+ check = check + C(P(lower(pattern))) / namespace
+ parse = P { P(check) + 1 * V(1) }
end
--[[ldx--
@@ -94,7 +73,7 @@ xml.checkns("m","http://www.w3.org/mathml")
--ldx]]--
function xml.checkns(namespace,url)
- local ns = parse:match(lower(url))
+ local ns = lpegmatch(parse,lower(url))
if ns and namespace ~= ns then
xml.xmlns[namespace] = ns
end
@@ -112,7 +91,7 @@ This returns <t>mml</t>.
--ldx]]--
function xml.resolvens(url)
- return parse:match(lower(url)) or ""
+ return lpegmatch(parse,lower(url)) or ""
end
--[[ldx--
@@ -151,27 +130,36 @@ local x = xml.convert(somestring)
<p>An optional second boolean argument tells this function not to create a root
element.</p>
---ldx]]--
-xml.strip_cm_and_dt = false -- an extra global flag, in case we have many includes
+<p>Valid entities are:</p>
+
+<typing>
+<!ENTITY xxxx SYSTEM "yyyy" NDATA zzzz>
+<!ENTITY xxxx PUBLIC "yyyy" >
+<!ENTITY xxxx "yyyy" >
+</typing>
+--ldx]]--
-- not just one big nested table capture (lpeg overflow)
local nsremap, resolvens = xml.xmlns, xml.resolvens
-local stack, top, dt, at, xmlns, errorstr, entities = {}, {}, {}, {}, {}, nil, {}
+local stack, top, dt, at, xmlns, errorstr, entities = { }, { }, { }, { }, { }, nil, { }
+local strip, cleanup, utfize, resolve, resolve_predefined, unify_predefined = false, false, false, false, false, false
+local dcache, hcache, acache = { }, { }, { }
-local mt = { __tostring = xml.text }
+local mt = { }
-function xml.check_error(top,toclose)
- return ""
+function initialize_mt(root)
+ mt = { __index = root } -- will be redefined later
end
-local strip = false
-local cleanup = false
+function xml.setproperty(root,k,v)
+ getmetatable(root).__index[k] = v
+end
-function xml.set_text_cleanup(fnc)
- cleanup = fnc
+function xml.check_error(top,toclose)
+ return ""
end
local function add_attribute(namespace,tag,value)
@@ -181,12 +169,31 @@ local function add_attribute(namespace,tag,value)
if tag == "xmlns" then
xmlns[#xmlns+1] = resolvens(value)
at[tag] = value
+ elseif namespace == "" then
+ at[tag] = value
elseif namespace == "xmlns" then
xml.checkns(tag,value)
at["xmlns:" .. tag] = value
else
- at[tag] = value
+ -- for the moment this way:
+ at[namespace .. ":" .. tag] = value
+ end
+end
+
+local function add_empty(spacing, namespace, tag)
+ if #spacing > 0 then
+ dt[#dt+1] = spacing
end
+ local resolved = (namespace == "" and xmlns[#xmlns]) or nsremap[namespace] or namespace
+ top = stack[#stack]
+ dt = top.dt
+ local t = { ns=namespace or "", rn=resolved, tg=tag, at=at, dt={}, __p__ = top }
+ dt[#dt+1] = t
+ setmetatable(t, mt)
+ if at.xmlns then
+ remove(xmlns)
+ end
+ at = { }
end
local function add_begin(spacing, namespace, tag)
@@ -214,28 +221,12 @@ local function add_end(spacing, namespace, tag)
end
dt = top.dt
dt[#dt+1] = toclose
- dt[0] = top
+ -- dt[0] = top -- nasty circular reference when serializing table
if toclose.at.xmlns then
remove(xmlns)
end
end
-local function add_empty(spacing, namespace, tag)
- if #spacing > 0 then
- dt[#dt+1] = spacing
- end
- local resolved = (namespace == "" and xmlns[#xmlns]) or nsremap[namespace] or namespace
- top = stack[#stack]
- dt = top.dt
- local t = { ns=namespace or "", rn=resolved, tg=tag, at=at, dt={}, __p__ = top }
- dt[#dt+1] = t
- setmetatable(t, mt)
- if at.xmlns then
- remove(xmlns)
- end
- at = { }
-end
-
local function add_text(text)
if cleanup and #text > 0 then
dt[#dt+1] = cleanup(text)
@@ -251,7 +242,7 @@ local function add_special(what, spacing, text)
if strip and (what == "@cm@" or what == "@dt@") then
-- forget it
else
- dt[#dt+1] = { special=true, ns="", tg=what, dt={text} }
+ dt[#dt+1] = { special=true, ns="", tg=what, dt={ text } }
end
end
@@ -259,7 +250,199 @@ local function set_message(txt)
errorstr = "garbage at the end of the file: " .. gsub(txt,"([ \n\r\t]*)","")
end
-local P, S, R, C, V = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.V
+local reported_attribute_errors = { }
+
+local function attribute_value_error(str)
+ if not reported_attribute_errors[str] then
+ logs.report("xml","invalid attribute value: %q",str)
+ reported_attribute_errors[str] = true
+ at._error_ = str
+ end
+ return str
+end
+local function attribute_specification_error(str)
+ if not reported_attribute_errors[str] then
+ logs.report("xml","invalid attribute specification: %q",str)
+ reported_attribute_errors[str] = true
+ at._error_ = str
+ end
+ return str
+end
+
+function xml.unknown_dec_entity_format(str) return (str == "" and "&error;") or format("&%s;",str) end
+function xml.unknown_hex_entity_format(str) return format("&#x%s;",str) end
+function xml.unknown_any_entity_format(str) return format("&#x%s;",str) end
+
+local function fromhex(s)
+ local n = tonumber(s,16)
+ if n then
+ return utfchar(n)
+ else
+ return format("h:%s",s), true
+ end
+end
+
+local function fromdec(s)
+ local n = tonumber(s)
+ if n then
+ return utfchar(n)
+ else
+ return format("d:%s",s), true
+ end
+end
+
+-- one level expansion (simple case), no checking done
+
+local rest = (1-P(";"))^0
+local many = P(1)^0
+
+local parsedentity =
+ P("&") * (P("#x")*(rest/fromhex) + P("#")*(rest/fromdec)) * P(";") * P(-1) +
+ (P("#x")*(many/fromhex) + P("#")*(many/fromdec))
+
+-- parsing in the xml file
+
+local predefined_unified = {
+ [38] = "&amp;",
+ [42] = "&quot;",
+ [47] = "&apos;",
+ [74] = "&lt;",
+ [76] = "&gr;",
+}
+
+local predefined_simplified = {
+ [38] = "&", amp = "&",
+ [42] = '"', quot = '"',
+ [47] = "'", apos = "'",
+ [74] = "<", lt = "<",
+ [76] = ">", gt = ">",
+}
+
+local function handle_hex_entity(str)
+ local h = hcache[str]
+ if not h then
+ local n = tonumber(str,16)
+ h = unify_predefined and predefined_unified[n]
+ if h then
+ if trace_entities then
+ logs.report("xml","utfize, converting hex entity &#x%s; into %s",str,h)
+ end
+ elseif utfize then
+ h = (n and utfchar(n)) or xml.unknown_hex_entity_format(str) or ""
+ if not n then
+ logs.report("xml","utfize, ignoring hex entity &#x%s;",str)
+ elseif trace_entities then
+ logs.report("xml","utfize, converting hex entity &#x%s; into %s",str,h)
+ end
+ else
+ if trace_entities then
+ logs.report("xml","found entity &#x%s;",str)
+ end
+ h = "&#x" .. str .. ";"
+ end
+ hcache[str] = h
+ end
+ return h
+end
+
+local function handle_dec_entity(str)
+ local d = dcache[str]
+ if not d then
+ local n = tonumber(str)
+ d = unify_predefined and predefined_unified[n]
+ if d then
+ if trace_entities then
+ logs.report("xml","utfize, converting dec entity &#%s; into %s",str,d)
+ end
+ elseif utfize then
+ d = (n and utfchar(n)) or xml.unknown_dec_entity_format(str) or ""
+ if not n then
+ logs.report("xml","utfize, ignoring dec entity &#%s;",str)
+ elseif trace_entities then
+ logs.report("xml","utfize, converting dec entity &#%s; into %s",str,h)
+ end
+ else
+ if trace_entities then
+ logs.report("xml","found entity &#%s;",str)
+ end
+ d = "&#" .. str .. ";"
+ end
+ dcache[str] = d
+ end
+ return d
+end
+
+xml.parsedentitylpeg = parsedentity
+
+local function handle_any_entity(str)
+ if resolve then
+ local a = acache[str] -- per instance ! todo
+ if not a then
+ a = resolve_predefined and predefined_simplified[str]
+ if a then
+ -- one of the predefined
+ elseif type(resolve) == "function" then
+ a = resolve(str) or entities[str]
+ else
+ a = entities[str]
+ end
+ if a then
+ if trace_entities then
+ logs.report("xml","resolved entity &%s; -> %s (internal)",str,a)
+ end
+ a = lpegmatch(parsedentity,a) or a
+ else
+ if xml.unknown_any_entity_format then
+ a = xml.unknown_any_entity_format(str) or ""
+ end
+ if a then
+ if trace_entities then
+ logs.report("xml","resolved entity &%s; -> %s (external)",str,a)
+ end
+ else
+ if trace_entities then
+ logs.report("xml","keeping entity &%s;",str)
+ end
+ if str == "" then
+ a = "&error;"
+ else
+ a = "&" .. str .. ";"
+ end
+ end
+ end
+ acache[str] = a
+ elseif trace_entities then
+ if not acache[str] then
+ logs.report("xml","converting entity &%s; into %s",str,a)
+ acache[str] = a
+ end
+ end
+ return a
+ else
+ local a = acache[str]
+ if not a then
+ if trace_entities then
+ logs.report("xml","found entity &%s;",str)
+ end
+ a = resolve_predefined and predefined_simplified[str]
+ if a then
+ -- one of the predefined
+ acache[str] = a
+ elseif str == "" then
+ a = "&error;"
+ acache[str] = a
+ else
+ a = "&" .. str .. ";"
+ acache[str] = a
+ end
+ end
+ return a
+ end
+end
+
+local function handle_end_entity(chr)
+ logs.report("xml","error in entity, %q found instead of ';'",chr)
+end
local space = S(' \r\n\t')
local open = P('<')
@@ -269,24 +452,50 @@ local dquote = S('"')
local equal = P('=')
local slash = P('/')
local colon = P(':')
+local semicolon = P(';')
+local ampersand = P('&')
local valid = R('az', 'AZ', '09') + S('_-.')
local name_yes = C(valid^1) * colon * C(valid^1)
local name_nop = C(P(true)) * C(valid^1)
local name = name_yes + name_nop
+local utfbom = lpeg.patterns.utfbom -- no capture
+local spacing = C(space^0)
-local utfbom = P('\000\000\254\255') + P('\255\254\000\000') +
- P('\255\254') + P('\254\255') + P('\239\187\191') -- no capture
+----- entitycontent = (1-open-semicolon)^0
+local anyentitycontent = (1-open-semicolon-space-close)^0
+local hexentitycontent = R("AF","af","09")^0
+local decentitycontent = R("09")^0
+local parsedentity = P("#")/"" * (
+ P("x")/"" * (hexentitycontent/handle_hex_entity) +
+ (decentitycontent/handle_dec_entity)
+ ) + (anyentitycontent/handle_any_entity)
+local entity = ampersand/"" * parsedentity * ( (semicolon/"") + #(P(1)/handle_end_entity))
+
+local text_unparsed = C((1-open)^1)
+local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1)
-local spacing = C(space^0)
-local justtext = C((1-open)^1)
local somespace = space^1
local optionalspace = space^0
-local value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote)
-local attribute = (somespace * name * optionalspace * equal * optionalspace * value) / add_attribute
-local attributes = attribute^0
+----- value = (squote * C((1 - squote)^0) * squote) + (dquote * C((1 - dquote)^0) * dquote) -- ampersand and < also invalid in value
+local value = (squote * Cs((entity + (1 - squote))^0) * squote) + (dquote * Cs((entity + (1 - dquote))^0) * dquote) -- ampersand and < also invalid in value
+
+local endofattributes = slash * close + close -- recovery of flacky html
+local whatever = space * name * optionalspace * equal
+local wrongvalue = C(P(1-whatever-close)^1 + P(1-close)^1) / attribute_value_error
+----- wrongvalue = C(P(1-whatever-endofattributes)^1 + P(1-endofattributes)^1) / attribute_value_error
+----- wrongvalue = C(P(1-space-endofattributes)^1) / attribute_value_error
+local wrongvalue = Cs(P(entity + (1-space-endofattributes))^1) / attribute_value_error
+
+local attributevalue = value + wrongvalue
+
+local attribute = (somespace * name * optionalspace * equal * optionalspace * attributevalue) / add_attribute
+----- attributes = (attribute)^0
-local text = justtext / add_text
+local attributes = (attribute + somespace^-1 * (((1-endofattributes)^1)/attribute_specification_error))^0
+
+local parsedtext = text_parsed / add_text
+local unparsedtext = text_unparsed / add_text
local balanced = P { "[" * ((1 - S"[]") + V(1))^0 * "]" } -- taken from lpeg manual, () example
local emptyelement = (spacing * open * name * attributes * optionalspace * slash * close) / add_empty
@@ -304,19 +513,27 @@ local someinstruction = C((1 - endinstruction)^0)
local somecomment = C((1 - endcomment )^0)
local somecdata = C((1 - endcdata )^0)
-local function entity(k,v) entities[k] = v end
+local function normalentity(k,v ) entities[k] = v end
+local function systementity(k,v,n) entities[k] = v end
+local function publicentity(k,v,n) entities[k] = v end
local begindoctype = open * P("!DOCTYPE")
local enddoctype = close
local beginset = P("[")
local endset = P("]")
-local doctypename = C((1-somespace)^0)
+local doctypename = C((1-somespace-close)^0)
local elementdoctype = optionalspace * P("<!ELEMENT") * (1-close)^0 * close
-local entitydoctype = optionalspace * P("<!ENTITY") * somespace * (doctypename * somespace * value)/entity * optionalspace * close
-local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * value * somespace * value * somespace
-local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace
-local definitiondoctype= doctypename * somespace * beginset * P(elementdoctype + entitydoctype)^0 * optionalspace * endset
-local simpledoctype = (1-close)^1 -- * balanced^0
+
+local normalentitytype = (doctypename * somespace * value)/normalentity
+local publicentitytype = (doctypename * somespace * P("PUBLIC") * somespace * value)/publicentity
+local systementitytype = (doctypename * somespace * P("SYSTEM") * somespace * value * somespace * P("NDATA") * somespace * doctypename)/systementity
+local entitydoctype = optionalspace * P("<!ENTITY") * somespace * (systementitytype + publicentitytype + normalentitytype) * optionalspace * close
+
+local doctypeset = beginset * optionalspace * P(elementdoctype + entitydoctype + space)^0 * optionalspace * endset
+local definitiondoctype= doctypename * somespace * doctypeset
+local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * value * somespace * value * somespace * doctypeset
+local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
+local simpledoctype = (1-close)^1 -- * balanced^0
local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
@@ -326,60 +543,116 @@ local doctype = (spacing * begindoctype * somedoctype * enddoct
-- nicer but slower:
--
--- local instruction = (lpeg.Cc("@pi@") * spacing * begininstruction * someinstruction * endinstruction) / add_special
--- local comment = (lpeg.Cc("@cm@") * spacing * begincomment * somecomment * endcomment ) / add_special
--- local cdata = (lpeg.Cc("@cd@") * spacing * begincdata * somecdata * endcdata ) / add_special
--- local doctype = (lpeg.Cc("@dt@") * spacing * begindoctype * somedoctype * enddoctype ) / add_special
+-- local instruction = (Cc("@pi@") * spacing * begininstruction * someinstruction * endinstruction) / add_special
+-- local comment = (Cc("@cm@") * spacing * begincomment * somecomment * endcomment ) / add_special
+-- local cdata = (Cc("@cd@") * spacing * begincdata * somecdata * endcdata ) / add_special
+-- local doctype = (Cc("@dt@") * spacing * begindoctype * somedoctype * enddoctype ) / add_special
-local trailer = space^0 * (justtext/set_message)^0
+local trailer = space^0 * (text_unparsed/set_message)^0
-- comment + emptyelement + text + cdata + instruction + V("parent"), -- 6.5 seconds on 40 MB database file
-- text + comment + emptyelement + cdata + instruction + V("parent"), -- 5.8
-- text + V("parent") + emptyelement + comment + cdata + instruction, -- 5.5
-local grammar = P { "preamble",
+local grammar_parsed_text = P { "preamble",
preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer,
parent = beginelement * V("children")^0 * endelement,
- children = text + V("parent") + emptyelement + comment + cdata + instruction,
+ children = parsedtext + V("parent") + emptyelement + comment + cdata + instruction,
}
--- todo: xml.new + properties like entities and strip and such (store in root)
+local grammar_unparsed_text = P { "preamble",
+ preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer,
+ parent = beginelement * V("children")^0 * endelement,
+ children = unparsedtext + V("parent") + emptyelement + comment + cdata + instruction,
+}
-function xml.convert(data, no_root, strip_cm_and_dt, given_entities) -- maybe use table met k/v (given_entities may disapear)
- strip = strip_cm_and_dt or xml.strip_cm_and_dt
- stack, top, at, xmlns, errorstr, result, entities = {}, {}, {}, {}, nil, nil, given_entities or {}
+-- maybe we will add settinsg to result as well
+
+local function xmlconvert(data, settings)
+ settings = settings or { } -- no_root strip_cm_and_dt given_entities parent_root error_handler
+ strip = settings.strip_cm_and_dt
+ utfize = settings.utfize_entities
+ resolve = settings.resolve_entities
+ resolve_predefined = settings.resolve_predefined_entities -- in case we have escaped entities
+ unify_predefined = settings.unify_predefined_entities -- &#038; -> &amp;
+ cleanup = settings.text_cleanup
+ stack, top, at, xmlns, errorstr, result, entities = { }, { }, { }, { }, nil, nil, settings.entities or { }
+ acache, hcache, dcache = { }, { }, { } -- not stored
+ reported_attribute_errors = { }
+ if settings.parent_root then
+ mt = getmetatable(settings.parent_root)
+ else
+ initialize_mt(top)
+ end
stack[#stack+1] = top
top.dt = { }
dt = top.dt
if not data or data == "" then
errorstr = "empty xml file"
- elseif not grammar:match(data) then
- errorstr = "invalid xml file"
+ elseif utfize or resolve then
+ if lpegmatch(grammar_parsed_text,data) then
+ errorstr = ""
+ else
+ errorstr = "invalid xml file - parsed text"
+ end
+ elseif type(data) == "string" then
+ if lpegmatch(grammar_unparsed_text,data) then
+ errorstr = ""
+ else
+ errorstr = "invalid xml file - unparsed text"
+ end
else
- errorstr = ""
+ errorstr = "invalid xml file - no text at all"
end
if errorstr and errorstr ~= "" then
- result = { dt = { { ns = "", tg = "error", dt = { errorstr }, at={}, er = true } }, error = true }
+ result = { dt = { { ns = "", tg = "error", dt = { errorstr }, at={ }, er = true } } }
setmetatable(stack, mt)
- if xml.error_handler then xml.error_handler("load",errorstr) end
+ local error_handler = settings.error_handler
+ if error_handler == false then
+ -- no error message
+ else
+ error_handler = error_handler or xml.error_handler
+ if error_handler then
+ xml.error_handler("load",errorstr)
+ end
+ end
else
result = stack[1]
end
- if not no_root then
- result = { special = true, ns = "", tg = '@rt@', dt = result.dt, at={}, entities = entities }
+ if not settings.no_root then
+ result = { special = true, ns = "", tg = '@rt@', dt = result.dt, at={ }, entities = entities, settings = settings }
setmetatable(result, mt)
local rdt = result.dt
for k=1,#rdt do
local v = rdt[k]
if type(v) == "table" and not v.special then -- always table -)
result.ri = k -- rootindex
+v.__p__ = result -- new, experiment, else we cannot go back to settings, we need to test this !
break
end
end
end
+ if errorstr and errorstr ~= "" then
+ result.error = true
+ end
return result
end
+xml.convert = xmlconvert
+
+function xml.inheritedconvert(data,xmldata)
+ local settings = xmldata.settings
+ settings.parent_root = xmldata -- to be tested
+ -- settings.no_root = true
+ local xc = xmlconvert(data,settings)
+ -- xc.settings = nil
+ -- xc.entities = nil
+ -- xc.special = nil
+ -- xc.ri = nil
+ -- print(xc.tg)
+ return xc
+end
+
--[[ldx--
<p>Packaging data in an xml like table is done with the following
function. Maybe it will go away (when not used).</p>
@@ -390,7 +663,7 @@ function xml.is_valid(root)
end
function xml.package(tag,attributes,data)
- local ns, tg = tag:match("^(.-):?([^:]+)$")
+ local ns, tg = match(tag,"^(.-):?([^:]+)$")
local t = { ns = ns, tg = tg, dt = data or "", at = attributes or {} }
setmetatable(t, mt)
return t
@@ -408,21 +681,19 @@ the whole file first. The function accepts a string representing
a filename or a file handle.</p>
--ldx]]--
-function xml.load(filename)
+function xml.load(filename,settings)
+ local data = ""
if type(filename) == "string" then
+ -- local data = io.loaddata(filename) - -todo: check type in io.loaddata
local f = io.open(filename,'r')
if f then
- local root = xml.convert(f:read("*all"))
+ data = f:read("*all")
f:close()
- return root
- else
- return xml.convert("")
end
elseif filename then -- filehandle
- return xml.convert(filename:read("*all"))
- else
- return xml.convert("")
+ data = filename:read("*all")
end
+ return xmlconvert(data,settings)
end
--[[ldx--
@@ -430,9 +701,11 @@ end
valid trees, which is what the next function does.</p>
--ldx]]--
+local no_root = { no_root = true }
+
function xml.toxml(data)
if type(data) == "string" then
- local root = { xml.convert(data,true) }
+ local root = { xmlconvert(data,no_root) }
return (#root > 1 and root) or root[1]
else
return data
@@ -452,7 +725,7 @@ local function copy(old,tables)
if not tables[old] then
tables[old] = new
end
- for k,v in pairs(old) do
+ for k,v in next, old do
new[k] = (type(v) == "table" and (tables[v] or copy(v, tables))) or v
end
local mt = getmetatable(old)
@@ -477,217 +750,304 @@ alternative.</p>
-- todo: add <?xml version='1.0' standalone='yes'?> when not present
-local fallbackhandle = (tex and tex.sprint) or io.write
-
-local function serialize(e, handle, textconverter, attributeconverter, specialconverter, nocommands)
- if not e then
- return
- elseif not nocommands then
- local ec = e.command
- if ec ~= nil then -- we can have all kind of types
- if e.special then
- local etg, edt = e.tg, e.dt
- local spc = specialconverter and specialconverter[etg]
- if spc then
- local result = spc(edt[1])
- if result then
- handle(result)
- return
- else
- -- no need to handle any further
- end
- end
- end
- local xc = xml.command
- if xc then
- xc(e,ec)
- return
+function xml.checkbom(root) -- can be made faster
+ if root.ri then
+ local dt, found = root.dt, false
+ for k=1,#dt do
+ local v = dt[k]
+ if type(v) == "table" and v.special and v.tg == "@pi@" and find(v.dt[1],"xml.*version=") then
+ found = true
+ break
end
end
+ if not found then
+ insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } )
+ insert(dt, 2, "\n" )
+ end
end
- handle = handle or fallbackhandle
- local etg = e.tg
- if etg then
- if e.special then
- local edt = e.dt
- local spc = specialconverter and specialconverter[etg]
- if spc then
- local result = spc(edt[1])
- if result then
- handle(result)
+end
+
+--[[ldx--
+<p>At the cost of some 25% runtime overhead you can first convert the tree to a string
+and then handle the lot.</p>
+--ldx]]--
+
+-- new experimental reorganized serialize
+
+local function verbose_element(e,handlers)
+ local handle = handlers.handle
+ local serialize = handlers.serialize
+ local ens, etg, eat, edt, ern = e.ns, e.tg, e.at, e.dt, e.rn
+ local ats = eat and next(eat) and { }
+ if ats then
+ for k,v in next, eat do
+ ats[#ats+1] = format('%s=%q',k,v)
+ end
+ end
+ if ern and trace_remap and ern ~= ens then
+ ens = ern
+ end
+ if ens ~= "" then
+ if edt and #edt > 0 then
+ if ats then
+ handle("<",ens,":",etg," ",concat(ats," "),">")
+ else
+ handle("<",ens,":",etg,">")
+ end
+ for i=1,#edt do
+ local e = edt[i]
+ if type(e) == "string" then
+ handle(e)
else
- -- no need to handle any further
+ serialize(e,handlers)
end
- elseif etg == "@pi@" then
- -- handle(format("<?%s?>",edt[1]))
- handle("<?" .. edt[1] .. "?>")
- elseif etg == "@cm@" then
- -- handle(format("<!--%s-->",edt[1]))
- handle("<!--" .. edt[1] .. "-->")
- elseif etg == "@cd@" then
- -- handle(format("<![CDATA[%s]]>",edt[1]))
- handle("<![CDATA[" .. edt[1] .. "]]>")
- elseif etg == "@dt@" then
- -- handle(format("<!DOCTYPE %s>",edt[1]))
- handle("<!DOCTYPE " .. edt[1] .. ">")
- elseif etg == "@rt@" then
- serialize(edt,handle,textconverter,attributeconverter,specialconverter,nocommands)
end
+ handle("</",ens,":",etg,">")
else
- local ens, eat, edt, ern = e.ns, e.at, e.dt, e.rn
- local ats = eat and next(eat) and { } -- type test maybe faster
if ats then
- if attributeconverter then
- for k,v in next, eat do
- ats[#ats+1] = format('%s=%q',k,attributeconverter(v))
- end
- else
- for k,v in next, eat do
- ats[#ats+1] = format('%s=%q',k,v)
- end
- end
+ handle("<",ens,":",etg," ",concat(ats," "),"/>")
+ else
+ handle("<",ens,":",etg,"/>")
end
- if ern and trace_remap and ern ~= ens then
- ens = ern
+ end
+ else
+ if edt and #edt > 0 then
+ if ats then
+ handle("<",etg," ",concat(ats," "),">")
+ else
+ handle("<",etg,">")
end
- if ens ~= "" then
- if edt and #edt > 0 then
- if ats then
- -- handle(format("<%s:%s %s>",ens,etg,concat(ats," ")))
- handle("<" .. ens .. ":" .. etg .. " " .. concat(ats," ") .. ">")
- else
- -- handle(format("<%s:%s>",ens,etg))
- handle("<" .. ens .. ":" .. etg .. ">")
- end
- for i=1,#edt do
- local e = edt[i]
- if type(e) == "string" then
- if textconverter then
- handle(textconverter(e))
- else
- handle(e)
- end
- else
- serialize(e,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- end
- -- handle(format("</%s:%s>",ens,etg))
- handle("</" .. ens .. ":" .. etg .. ">")
+ for i=1,#edt do
+ local ei = edt[i]
+ if type(ei) == "string" then
+ handle(ei)
else
- if ats then
- -- handle(format("<%s:%s %s/>",ens,etg,concat(ats," ")))
- handle("<" .. ens .. ":" .. etg .. " " .. concat(ats," ") .. "/>")
- else
- -- handle(format("<%s:%s/>",ens,etg))
- handle("<" .. ens .. ":" .. etg .. "/>")
- end
+ serialize(ei,handlers)
end
+ end
+ handle("</",etg,">")
+ else
+ if ats then
+ handle("<",etg," ",concat(ats," "),"/>")
else
- if edt and #edt > 0 then
- if ats then
- -- handle(format("<%s %s>",etg,concat(ats," ")))
- handle("<" .. etg .. " " .. concat(ats," ") .. ">")
- else
- -- handle(format("<%s>",etg))
- handle("<" .. etg .. ">")
- end
- for i=1,#edt do
- local ei = edt[i]
- if type(ei) == "string" then
- if textconverter then
- handle(textconverter(ei))
- else
- handle(ei)
- end
- else
- serialize(ei,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
- end
- -- handle(format("</%s>",etg))
- handle("</" .. etg .. ">")
- else
- if ats then
- -- handle(format("<%s %s/>",etg,concat(ats," ")))
- handle("<" .. etg .. " " .. concat(ats," ") .. "/>")
- else
- -- handle(format("<%s/>",etg))
- handle("<" .. etg .. "/>")
- end
- end
+ handle("<",etg,"/>")
end
end
- elseif type(e) == "string" then
- if textconverter then
- handle(textconverter(e))
+ end
+end
+
+local function verbose_pi(e,handlers)
+ handlers.handle("<?",e.dt[1],"?>")
+end
+
+local function verbose_comment(e,handlers)
+ handlers.handle("<!--",e.dt[1],"-->")
+end
+
+local function verbose_cdata(e,handlers)
+ handlers.handle("<![CDATA[", e.dt[1],"]]>")
+end
+
+local function verbose_doctype(e,handlers)
+ handlers.handle("<!DOCTYPE ",e.dt[1],">")
+end
+
+local function verbose_root(e,handlers)
+ handlers.serialize(e.dt,handlers)
+end
+
+local function verbose_text(e,handlers)
+ handlers.handle(e)
+end
+
+local function verbose_document(e,handlers)
+ local serialize = handlers.serialize
+ local functions = handlers.functions
+ for i=1,#e do
+ local ei = e[i]
+ if type(ei) == "string" then
+ functions["@tx@"](ei,handlers)
else
- handle(e)
+ serialize(ei,handlers)
end
- else
- for i=1,#e do
- local ei = e[i]
- if type(ei) == "string" then
- if textconverter then
- handle(textconverter(ei))
- else
- handle(ei)
- end
- else
- serialize(ei,handle,textconverter,attributeconverter,specialconverter,nocommands)
- end
+ end
+end
+
+local function serialize(e,handlers,...)
+ local initialize = handlers.initialize
+ local finalize = handlers.finalize
+ local functions = handlers.functions
+ if initialize then
+ local state = initialize(...)
+ if not state == true then
+ return state
end
end
+ local etg = e.tg
+ if etg then
+ (functions[etg] or functions["@el@"])(e,handlers)
+ -- elseif type(e) == "string" then
+ -- functions["@tx@"](e,handlers)
+ else
+ functions["@dc@"](e,handlers)
+ end
+ if finalize then
+ return finalize()
+ end
end
-xml.serialize = serialize
+local function xserialize(e,handlers)
+ local functions = handlers.functions
+ local etg = e.tg
+ if etg then
+ (functions[etg] or functions["@el@"])(e,handlers)
+ -- elseif type(e) == "string" then
+ -- functions["@tx@"](e,handlers)
+ else
+ functions["@dc@"](e,handlers)
+ end
+end
-function xml.checkbom(root) -- can be made faster
- if root.ri then
- local dt, found = root.dt, false
- for k=1,#dt do
- local v = dt[k]
- if type(v) == "table" and v.special and v.tg == "@pi" and find(v.dt,"xml.*version=") then
- found = true
- break
+local handlers = { }
+
+local function newhandlers(settings)
+ local t = table.copy(handlers.verbose or { }) -- merge
+ if settings then
+ for k,v in next, settings do
+ if type(v) == "table" then
+ tk = t[k] if not tk then tk = { } t[k] = tk end
+ for kk,vv in next, v do
+ tk[kk] = vv
+ end
+ else
+ t[k] = v
end
end
- if not found then
- insert(dt, 1, { special=true, ns="", tg="@pi@", dt = { "xml version='1.0' standalone='yes'"} } )
- insert(dt, 2, "\n" )
+ if settings.name then
+ handlers[settings.name] = t
end
end
+ return t
+end
+
+local nofunction = function() end
+
+function xml.sethandlersfunction(handler,name,fnc)
+ handler.functions[name] = fnc or nofunction
+end
+
+function xml.gethandlersfunction(handler,name)
+ return handler.functions[name]
+end
+
+function xml.gethandlers(name)
+ return handlers[name]
end
+newhandlers {
+ name = "verbose",
+ initialize = false, -- faster than nil and mt lookup
+ finalize = false, -- faster than nil and mt lookup
+ serialize = xserialize,
+ handle = print,
+ functions = {
+ ["@dc@"] = verbose_document,
+ ["@dt@"] = verbose_doctype,
+ ["@rt@"] = verbose_root,
+ ["@el@"] = verbose_element,
+ ["@pi@"] = verbose_pi,
+ ["@cm@"] = verbose_comment,
+ ["@cd@"] = verbose_cdata,
+ ["@tx@"] = verbose_text,
+ }
+}
+
--[[ldx--
-<p>At the cost of some 25% runtime overhead you can first convert the tree to a string
-and then handle the lot.</p>
+<p>How you deal with saving data depends on your preferences. For a 40 MB database
+file the timing on a 2.3 Core Duo are as follows (time in seconds):</p>
+
+<lines>
+1.3 : load data from file to string
+6.1 : convert string into tree
+5.3 : saving in file using xmlsave
+6.8 : converting to string using xml.tostring
+3.6 : saving converted string in file
+</lines>
+
+<p>Beware, these were timing with the old routine but measurements will not be that
+much different I guess.</p>
--ldx]]--
-function xml.tostring(root) -- 25% overhead due to collecting
+-- maybe this will move to lxml-xml
+
+local result
+
+local xmlfilehandler = newhandlers {
+ name = "file",
+ initialize = function(name) result = io.open(name,"wb") return result end,
+ finalize = function() result:close() return true end,
+ handle = function(...) result:write(...) end,
+}
+
+-- no checking on writeability here but not faster either
+--
+-- local xmlfilehandler = newhandlers {
+-- initialize = function(name) io.output(name,"wb") return true end,
+-- finalize = function() io.close() return true end,
+-- handle = io.write,
+-- }
+
+
+function xml.save(root,name)
+ serialize(root,xmlfilehandler,name)
+end
+
+local result
+
+local xmlstringhandler = newhandlers {
+ name = "string",
+ initialize = function() result = { } return result end,
+ finalize = function() return concat(result) end,
+ handle = function(...) result[#result+1] = concat { ... } end
+}
+
+local function xmltostring(root) -- 25% overhead due to collecting
if root then
if type(root) == 'string' then
return root
- elseif next(root) then -- next is faster than type (and >0 test)
- local result = { }
- serialize(root,function(s) result[#result+1] = s end) -- brrr, slow (direct printing is faster)
- return concat(result,"")
+ else -- if next(root) then -- next is faster than type (and >0 test)
+ return serialize(root,xmlstringhandler) or ""
end
end
return ""
end
+local function xmltext(root) -- inline
+ return (root and xmltostring(root)) or ""
+end
+
+function initialize_mt(root)
+ mt = { __tostring = xmltext, __index = root }
+end
+
+xml.defaulthandlers = handlers
+xml.newhandlers = newhandlers
+xml.serialize = serialize
+xml.tostring = xmltostring
+
--[[ldx--
<p>The next function operated on the content only and needs a handle function
that accepts a string.</p>
--ldx]]--
-function xml.string(e,handle)
+local function xmlstring(e,handle)
if not handle or (e.special and e.tg ~= "@rt@") then
-- nothing
elseif e.tg then
local edt = e.dt
if edt then
for i=1,#edt do
- xml.string(edt[i],handle)
+ xmlstring(edt[i],handle)
end
end
else
@@ -695,54 +1055,52 @@ function xml.string(e,handle)
end
end
---[[ldx--
-<p>How you deal with saving data depends on your preferences. For a 40 MB database
-file the timing on a 2.3 Core Duo are as follows (time in seconds):</p>
+xml.string = xmlstring
-<lines>
-1.3 : load data from file to string
-6.1 : convert string into tree
-5.3 : saving in file using xmlsave
-6.8 : converting to string using xml.tostring
-3.6 : saving converted string in file
-</lines>
-
-<p>The save function is given below.</p>
+--[[ldx--
+<p>A few helpers:</p>
--ldx]]--
-function xml.save(root,name)
- local f = io.open(name,"w")
- if f then
- xml.serialize(root,function(s) f:write(s) end)
- f:close()
+--~ xmlsetproperty(root,"settings",settings)
+
+function xml.settings(e)
+ while e do
+ local s = e.settings
+ if s then
+ return s
+ else
+ e = e.__p__
+ end
end
+ return nil
end
---[[ldx--
-<p>A few helpers:</p>
---ldx]]--
-
-function xml.body(root)
- return (root.ri and root.dt[root.ri]) or root
+function xml.root(e)
+ local r = e
+ while e do
+ e = e.__p__
+ if e then
+ r = e
+ end
+ end
+ return r
end
-function xml.text(root)
- return (root and xml.tostring(root)) or ""
+function xml.parent(root)
+ return root.__p__
end
-function xml.content(root) -- bugged
- return (root and root.dt and xml.tostring(root.dt)) or ""
+function xml.body(root)
+ return (root.ri and root.dt[root.ri]) or root -- not ok yet
end
-function xml.isempty(root, pattern)
- if pattern == "" or pattern == "*" then
- pattern = nil
- end
- if pattern then
- -- todo
- return false
+function xml.name(root)
+ if not root then
+ return ""
+ elseif root.ns == "" then
+ return root.tg
else
- return not root or not root.dt or #root.dt == 0 or root.dt == ""
+ return root.ns .. ":" .. root.tg
end
end
@@ -750,18 +1108,15 @@ end
<p>The next helper erases an element but keeps the table as it is,
and since empty strings are not serialized (effectively) it does
not harm. Copying the table would take more time. Usage:</p>
-
-<typing>
-dt[k] = xml.empty() or xml.empty(dt,k)
-</typing>
--ldx]]--
-function xml.empty(dt,k)
- if dt and k then
- dt[k] = ""
- return dt[k]
- else
- return ""
+function xml.erase(dt,k)
+ if dt then
+ if k then
+ dt[k] = ""
+ else for k=1,#dt do
+ dt[1] = { "" }
+ end end
end
end
@@ -781,3 +1136,39 @@ function xml.assign(dt,k,root)
return xml.body(root)
end
end
+
+-- the following helpers may move
+
+--[[ldx--
+<p>The next helper assigns a tree (or string). Usage:</p>
+<typing>
+xml.tocdata(e)
+xml.tocdata(e,"error")
+</typing>
+--ldx]]--
+
+function xml.tocdata(e,wrapper)
+ local whatever = xmltostring(e.dt)
+ if wrapper then
+ whatever = format("<%s>%s</%s>",wrapper,whatever,wrapper)
+ end
+ local t = { special = true, ns = "", tg = "@cd@", at = {}, rn = "", dt = { whatever }, __p__ = e }
+ setmetatable(t,getmetatable(e))
+ e.dt = { t }
+end
+
+function xml.makestandalone(root)
+ if root.ri then
+ local dt = root.dt
+ for k=1,#dt do
+ local v = dt[k]
+ if type(v) == "table" and v.special and v.tg == "@pi@" then
+ local txt = v.dt[1]
+ if find(txt,"xml.*version=") then
+ v.dt[1] = txt .. " standalone='yes'"
+ break
+ end
+ end
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-tex.lua b/Master/texmf-dist/tex/context/base/lxml-tex.lua
new file mode 100644
index 00000000000..aaa90217fec
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-tex.lua
@@ -0,0 +1,1410 @@
+if not modules then modules = { } end modules ['lxml-tst'] = {
+ version = 1.001,
+ comment = "companion to lxml-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local utf = unicode.utf8
+
+local utfchar = utf.char
+local concat, insert, remove, gsub, find = table.concat, table.insert, table.remove
+local format, sub, gsub, find, gmatch, match = string.format, string.sub, string.gsub, string.find, string.gmatch, string.match
+local type, next, tonumber, tostring = type, next, tonumber, tostring
+local lpegmatch = lpeg.match
+local P, S, C, Cc = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc
+
+if not tex and not tex.sprint then
+ tex = {
+ sprint = function(catcodes,...) texio.write(table.concat{...}) end,
+ print = function(catcodes,...) texio.write(table.concat{...}) end,
+ write = function( ...) texio.write(table.concat{...}) end,
+ }
+ commands = {
+ writestatus = logs.report
+ }
+ resolvers.loadbinfile = function(filename) return true, io.loaddata(filename) end
+end
+
+local texsprint, texprint, texwrite = tex.sprint, tex.print, tex.write
+local texcatcodes, ctxcatcodes, vrbcatcodes, notcatcodes = tex.texcatcodes, tex.ctxcatcodes, tex.vrbcatcodes, tex.notcatcodes
+
+local xmlelements, xmlcollected, xmlsetproperty = xml.elements, xml.collected, xml.setproperty
+local xmlparseapply, xmlwithelements = xml.parse_apply, xml.withelements
+local xmlserialize, xmlcollect, xmltext, xmltostring = xml.serialize, xml.collect, xml.text, xml.tostring
+
+local variables = (interfaces and interfaces.variables) or { }
+
+local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
+
+local trace_setups = false trackers.register("lxml.setups", function(v) trace_setups = v end)
+local trace_loading = false trackers.register("lxml.loading", function(v) trace_loading = v end)
+local trace_access = false trackers.register("lxml.access", function(v) trace_access = v end)
+local trace_comments = false trackers.register("lxml.comments", function(v) trace_comments = v end)
+
+lxml = lxml or { }
+lxml.loaded = lxml.loaded or { }
+
+local loaded = lxml.loaded
+
+-- print(contextdirective("context-mathml-directive function reduction yes "))
+-- print(contextdirective("context-mathml-directive function "))
+
+xml.defaultprotocol = "tex"
+
+local finalizers = xml.finalizers
+
+finalizers.xml = finalizers.xml or { }
+finalizers.tex = finalizers.tex or { }
+
+-- this might look inefficient but it's actually rather efficient
+-- because we avoid tokenization of leading spaces and xml can be
+-- rather verbose (indented)
+
+local newline = lpeg.patterns.newline
+local space = lpeg.patterns.spacer
+local ampersand = P("&")
+local semicolon = P(";")
+local spacing = newline * space^0
+local content = C((1-spacing-ampersand)^1)
+local verbose = C((1-(space+newline))^1)
+local entity = ampersand * C((1-semicolon)^1) * semicolon
+
+local xmltextcapture = (
+ space^0 * newline^2 * Cc("") / texprint + -- better ^-2 ?
+ space^0 * newline * space^0 * Cc(" ") / texsprint +
+ content / function(str) return texsprint(notcatcodes,str) end + -- was just texsprint, current catcodes regime is notcatcodes
+ entity / xml.resolved_entity
+)^0
+
+local ctxtextcapture = (
+ space^0 * newline^2 * Cc("") / texprint + -- better ^-2 ?
+ space^0 * newline * space^0 * Cc(" ") / texsprint +
+ content / function(str) return texsprint(ctxcatcodes,str) end + -- was just texsprint, current catcodes regime is notcatcodes
+ entity / xml.resolved_entity
+)^0
+
+local forceraw, rawroot = false, nil
+
+function lxml.startraw()
+ forceraw = true
+end
+
+function lxml.stopraw()
+ forceraw = false
+end
+
+function lxml.rawroot()
+ return rawroot
+end
+
+--~ function lxml.rawpath(rootid)
+--~ if rawroot and type(rawroot) == "table" then
+--~ local text, path, rp
+--~ if not rawroot.dt then
+--~ text, path, rp = "text", "", rawroot[0]
+--~ else
+--~ path, rp = "tree", "", rawroot.__p__
+--~ end
+--~ while rp do
+--~ local rptg = rp.tg
+--~ if rptg then
+--~ path = rptg .. "/" .. path
+--~ end
+--~ rp = rp.__p__
+--~ end
+--~ return { rootid, "/" .. path, text }
+--~ end
+--~ end
+
+-- cdata
+
+local linecommand = "\\obeyedline"
+local spacecommand = "\\obeyedspace" -- "\\strut\\obeyedspace"
+local beforecommand = ""
+local aftercommand = ""
+
+local xmlverbosecapture = (
+ newline / function( ) texsprint(texcatcodes,linecommand,"{}") end +
+ verbose / function(s) texsprint(vrbcatcodes,s) end +
+ space / function( ) texsprint(texcatcodes,spacecommand,"{}") end
+)^0
+
+local function toverbatim(str)
+ if beforecommand then texsprint(texcatcodes,beforecommand,"{}") end
+ lpegmatch(xmlverbosecapture,str)
+ if aftercommand then texsprint(texcatcodes,aftercommand,"{}") end
+end
+
+function lxml.set_verbatim(before,after,obeyedline,obeyedspace)
+ beforecommand, aftercommand, linecommand, spacecommand = before, after, obeyedline, obeyedspace
+end
+
+local obeycdata = true
+
+function lxml.set_cdata()
+ obeycdata = true
+end
+
+function lxml.reset_cdata()
+ obeycdata = false
+end
+
+-- cdata and verbatim
+
+lxml.set_verbatim("\\xmlcdatabefore", "\\xmlcdataafter", "\\xmlcdataobeyedline", "\\xmlcdataobeyedspace")
+
+-- local capture = (space^0*newline)^0 * capture * (space+newline)^0 * -1
+
+function lxml.toverbatim(str)
+ if beforecommand then texsprint(texcatcodes,beforecommand,"{}") end
+ -- todo: add this to capture
+ str = gsub(str,"^[ \t]+[\n\r]+","")
+ str = gsub(str,"[ \t\n\r]+$","")
+ lpegmatch(xmlverbosecapture,str)
+ if aftercommand then texsprint(texcatcodes,aftercommand,"{}") end
+end
+
+-- storage
+
+function lxml.store(id,root,filename)
+ loaded[id] = root
+ xmlsetproperty(root,"name",id)
+ if filename then
+ xmlsetproperty(root,"filename",filename)
+ end
+end
+
+local splitter = lpeg.splitat("::")
+
+lxml.idsplitter = splitter
+
+function lxml.splitid(id)
+ local d, i = lpegmatch(splitter,id)
+ if d then
+ return d, i
+ else
+ return "", id
+ end
+end
+
+local function get_id(id, qualified)
+ if id then
+ local lid = loaded[id]
+ if lid then
+ return lid
+ elseif type(id) == "table" then
+ return id
+ else
+ local d, i = lpegmatch(splitter,id)
+ if d then
+ local ld = loaded[d]
+ if ld then
+ local ldi = ld.index
+ if ldi then
+ local root = ldi[tonumber(i)]
+ if root then
+ if qualified then -- we need this else two args that confuse others
+ return root, d
+ else
+ return root
+ end
+ elseif trace_access then
+ logs.report("lxml","'%s' has no index entry '%s'",d,i)
+ end
+ elseif trace_access then
+ logs.report("lxml","'%s' has no index",d)
+ end
+ elseif trace_access then
+ logs.report("lxml","'%s' is not loaded",d)
+ end
+ elseif trace_access then
+ logs.report("lxml","'%s' is not loaded",i)
+ end
+ end
+ elseif trace_access then
+ logs.report("lxml","invalid id (nil)")
+ end
+end
+
+lxml.id = get_id
+lxml.get_id = get_id
+
+function lxml.root(id)
+ return loaded[id]
+end
+
+-- index
+
+local nofindices = 0
+
+local function addindex(name,check_sum,force)
+ local root = get_id(name)
+ if root and (not root.index or force) then -- weird, only called once
+ local n, index, maxindex, check = 0, root.index or { }, root.maxindex or 0, root.check or { }
+ local function nest(root)
+ local dt = root.dt
+ if not root.ix then
+ maxindex = maxindex + 1
+ root.ix = maxindex
+ check[maxindex] = root.tg -- still needed ?
+ index[maxindex] = root
+ n = n + 1
+ end
+ if dt then
+ for k=1,#dt do
+ local dk = dt[k]
+ if type(dk) == "table" then
+ nest(dk)
+ end
+ end
+ end
+ end
+ nest(root)
+ nofindices = nofindices + n
+ --
+ if type(name) ~= "string" then
+ name = "unknown"
+ end
+ root.index = index
+ root.maxindex = maxindex
+ if trace_access then
+ logs.report("lxml","%s indexed, %s nodes",tostring(name),maxindex)
+ end
+ end
+end
+
+lxml.addindex = addindex
+
+-- another cache
+
+local function lxmlparseapply(id,pattern) -- better inline, saves call
+ return xmlparseapply({ get_id(id) }, pattern)
+end
+
+lxml.filter = lxmlparseapply
+
+function lxml.filterlist(list,pattern)
+ for s in gmatch(list,"[^, ]+") do -- we could cache a table
+ lxmlparseapply(s,pattern)
+ end
+end
+
+lxml["function"] = function(id,name)
+ local f = xml.functions[name]
+ return f and f(get_id(id))
+end
+
+-- rather new, indexed storage (backward refs), maybe i will merge this
+
+function lxml.checkindex(name)
+ local root = get_id(name)
+ return (root and root.index) or 0
+end
+
+function lxml.withindex(name,n,command) -- will change as name is always there now
+ local i, p = lpegmatch(splitter,n)
+ if p then
+ texsprint(ctxcatcodes,"\\xmlw{",command,"}{",n,"}")
+ else
+ texsprint(ctxcatcodes,"\\xmlw{",command,"}{",name,"::",n,"}")
+ end
+end
+
+function lxml.getindex(name,n) -- will change as name is always there now
+ local i, p = lpegmatch(splitter,n)
+ if p then
+ texsprint(ctxcatcodes,n)
+ else
+ texsprint(ctxcatcodes,name,"::",n)
+ end
+end
+
+-- loading (to be redone, no overload)
+
+xml.originalload = xml.originalload or xml.load
+
+local noffiles, nofconverted = 0, 0
+
+function xml.load(filename,settings)
+ noffiles, nofconverted = noffiles + 1, nofconverted + 1
+ starttiming(xml)
+ local ok, data = resolvers.loadbinfile(filename)
+ local xmltable = xml.convert((ok and data) or "",settings)
+ stoptiming(xml)
+ return xmltable
+end
+
+local entities = xml.entities
+
+local function entityconverter(id,str)
+ return entities[str] and "&"..str..";" -- feed back into tex end later
+end
+
+function lxml.convert(id,data,entities,compress)
+ local settings = {
+ unify_predefined_entities = true,
+ }
+ if compress and compress == variables.yes then
+ settings.strip_cm_and_dt = true
+ end
+ if entities and entities == variables.yes then
+ settings.utfize_entities = true
+ settings.resolve_entities = function (str) return entityconverter(id,str) end
+ end
+ return xml.convert(data,settings)
+end
+
+function lxml.load(id,filename,compress,entities)
+ filename = commands.preparedfile(filename)
+ if trace_loading then
+ commands.writestatus("lxml","loading file '%s' as '%s'",filename,id)
+ end
+ noffiles, nofconverted = noffiles + 1, nofconverted + 1
+ -- local xmltable = xml.load(filename)
+ local ok, data = resolvers.loadbinfile(filename)
+ local xmltable = lxml.convert(id,(ok and data) or "",compress,entities)
+ lxml.store(id,xmltable,filename)
+ return xmltable, filename
+end
+
+function lxml.register(id,xmltable,filename)
+ lxml.store(id,xmltable,filename)
+ return xmltable
+end
+
+function lxml.include(id,pattern,attribute,recurse)
+ starttiming(xml)
+ local root = get_id(id)
+ xml.include(root,pattern,attribute,recurse,function(filename)
+ if filename then
+ filename = commands.preparedfile(filename)
+ if file.dirname(filename) == "" and root.filename then
+ local dn = file.dirname(root.filename)
+ if dn ~= "" then
+ filename = file.join(dn,filename)
+ end
+ end
+ if trace_loading then
+ commands.writestatus("lxml","including file: %s",filename)
+ end
+ noffiles, nofconverted = noffiles + 1, nofconverted + 1
+ return resolvers.loadtexfile(filename) or ""
+ else
+ return ""
+ end
+ end)
+ stoptiming(xml)
+end
+
+function xml.getbuffer(name,compress,entities) -- we need to make sure that commands are processed
+ if not name or name == "" then
+ name = tex.jobname
+ end
+ nofconverted = nofconverted + 1
+ xmltostring(lxml.convert(name,concat(buffers.data[name] or {},""),compress,entities))
+end
+
+function lxml.loadbuffer(id,name,compress,entities)
+ if not name or name == "" then
+ name = tex.jobname
+ end
+ starttiming(xml)
+ nofconverted = nofconverted + 1
+ local xmltable = lxml.convert(id,buffers.collect(name or id,"\n"),compress,entities)
+ lxml.store(id,xmltable)
+ stoptiming(xml)
+ return xmltable, name or id
+end
+
+function lxml.loaddata(id,str,compress,entities)
+ starttiming(xml)
+ nofconverted = nofconverted + 1
+ local xmltable = lxml.convert(id,str or "",compress,entities)
+ lxml.store(id,xmltable)
+ stoptiming(xml)
+ return xmltable, id
+end
+
+function lxml.loadregistered(id)
+ return loaded[id], id
+end
+
+-- e.command:
+--
+-- string : setup
+-- true : text (no <self></self>)
+-- false : ignore
+-- function : call
+
+local function tex_doctype(e,handlers)
+ -- ignore
+end
+
+local function tex_comment(e,handlers)
+ if trace_comments then
+ logs.report("lxml","comment: %s",e.dt[1])
+ end
+end
+
+local default_element_handler = xml.gethandlers("verbose").functions["@el@"]
+
+local function tex_element(e,handlers)
+ local command = e.command
+ if command == nil then
+ default_element_handler(e,handlers)
+ elseif command == true then
+ -- text (no <self></self>) / so, no mkii fallback then
+ handlers.serialize(e.dt,handlers)
+ elseif command == false then
+ -- ignore
+ else
+ local tc = type(command)
+ if tc == "string" then
+ local rootname, ix = e.name, e.ix
+ if rootname then
+ if not ix then
+ addindex(rootname,false,true)
+ ix = e.ix
+ end
+ texsprint(ctxcatcodes,"\\xmlw{",command,"}{",rootname,"::",ix,"}")
+ else
+ logs.report("lxml", "fatal error: no index for '%s'",command)
+ texsprint(ctxcatcodes,"\\xmlw{",command,"}{",ix or 0,"}")
+ end
+ elseif tc == "function" then
+ command(e)
+ end
+ end
+end
+
+local pihandlers = { } xml.pihandlers = pihandlers
+
+local kind = P("context-") * C((1-P("-"))^1) * P("-directive")
+local space = S(" \n\r")
+local spaces = space^0
+local class = C((1-space)^0)
+local key = class
+local value = C(P(1-(space * -1))^0)
+
+local parser = kind * spaces * class * spaces * key * spaces * value
+
+pihandlers[#pihandlers+1] = function(str)
+-- local kind, class, key, value = lpegmatch(parser,str)
+ if str then
+ local a, b, c, d = lpegmatch(parser,str)
+ if d then
+ texsprint(ctxcatcodes,"\\xmlcontextdirective{",a",}{",b,"}{",c,"}{",d,"}")
+ end
+ end
+end
+
+local function tex_pi(e,handlers)
+ local str = e.dt[1]
+ for i=1,#pihandlers do
+ pihandlers[i](str)
+ end
+end
+
+local function tex_cdata(e,handlers)
+ if obeycdata then
+ toverbatim(e.dt[1])
+ end
+end
+
+local function tex_text(e)
+ lpegmatch(xmltextcapture,e)
+end
+
+local function ctx_text(e)
+ lpegmatch(ctxtextcapture,e)
+end
+
+local function tex_handle(...)
+-- logs.report("lxml", "error while flushing: %s", concat { ... })
+ texsprint(...) -- notcatcodes is active anyway
+end
+
+local xmltexhandler = xml.newhandlers {
+ name = "tex",
+ handle = tex_handle,
+ functions = {
+ -- ["@dc@"] = tex_document,
+ ["@dt@"] = tex_doctype,
+ -- ["@rt@"] = tex_root,
+ ["@el@"] = tex_element,
+ ["@pi@"] = tex_pi,
+ ["@cm@"] = tex_comment,
+ ["@cd@"] = tex_cdata,
+ ["@tx@"] = tex_text,
+ }
+}
+
+lxml.xmltexhandler = xmltexhandler
+
+function lxml.serialize(root)
+ xmlserialize(root,xmltexhandler)
+end
+
+function lxml.setaction(id,pattern,action)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ for c=1,#collected do
+ collected[c].command = action
+ end
+ end
+end
+
+local function sprint(root)
+ if root then
+ local tr = type(root)
+ if tr == "string" then -- can also be result of lpath
+ -- rawroot = false
+ lpegmatch(xmltextcapture,root)
+ elseif tr == "table" then
+ if forceraw then
+ rawroot = root
+ texwrite(xmltostring(root))
+ else
+ xmlserialize(root,xmltexhandler)
+ end
+ end
+ end
+end
+
+local function tprint(root) -- we can move sprint inline
+ local tr = type(root)
+ if tr == "table" then
+ local n = #root
+ if n == 0 then
+ -- skip
+ else
+ for i=1,n do
+ sprint(root[i])
+ end
+ end
+ elseif tr == "string" then
+ lpegmatch(xmltextcapture,root)
+ end
+end
+
+local function cprint(root) -- content
+ if not root then
+ -- rawroot = false
+ -- quit
+ elseif type(root) == 'string' then
+ -- rawroot = false
+ lpegmatch(xmltextcapture,root)
+ else
+ local rootdt = root.dt
+ if forceraw then
+ rawroot = root
+ texwrite(xmltostring(rootdt or root))
+ else
+ xmlserialize(rootdt or root,xmltexhandler)
+ end
+ end
+end
+
+xml.sprint = sprint local xmlsprint = sprint -- redo these names
+xml.tprint = tprint local xmltprint = tprint
+xml.cprint = cprint local xmlcprint = cprint
+
+-- now we can flush
+
+function lxml.main(id)
+ xmlserialize(get_id(id),xmltexhandler) -- the real root (@rt@)
+end
+
+--~ -- lines (untested)
+--~
+--~ local buffer = { }
+--~
+--~ local xmllinescapture = (
+--~ newline^2 / function() buffer[#buffer+1] = "" end +
+--~ newline / function() buffer[#buffer] = buffer[#buffer] .. " " end +
+--~ content / function(s) buffer[#buffer] = buffer[#buffer] .. s end
+--~ )^0
+--~
+--~ local xmllineshandler = table.copy(xmltexhandler)
+--~
+--~ xmllineshandler.handle = function(...) lpegmatch(xmllinescapture,concat{ ... }) end
+--~
+--~ function lines(root)
+--~ if not root then
+--~ -- rawroot = false
+--~ -- quit
+--~ elseif type(root) == 'string' then
+--~ -- rawroot = false
+--~ lpegmatch(xmllinescapture,root)
+--~ elseif next(root) then -- tr == 'table'
+--~ xmlserialize(root,xmllineshandler)
+--~ end
+--~ end
+--~
+--~ function xml.lines(root) -- used at all?
+--~ buffer = { "" }
+--~ lines(root)
+--~ return result
+--~ end
+
+local function to_text(e)
+ if e.command == nil then
+ local etg = e.tg
+ if etg and e.special and etg ~= "@rt@" then
+ e.command = false -- i.e. skip
+ else
+ e.command = true -- i.e. no <self></self>
+ end
+ end
+end
+
+local function to_none(e)
+ if e.command == nil then
+ e.command = false -- i.e. skip
+ end
+end
+
+-- setups
+
+local setups = { }
+
+function lxml.set_command_to_text(id)
+ xmlwithelements(get_id(id),to_text)
+end
+
+function lxml.set_command_to_none(id)
+ xmlwithelements(get_id(id),to_none)
+end
+
+function lxml.installsetup(what,document,setup,where)
+ document = document or "*"
+ local sd = setups[document]
+ if not sd then sd = { } setups[document] = sd end
+ for k=1,#sd do
+ if sd[k] == setup then sd[k] = nil break end
+ end
+ if what == 1 then
+ if trace_loading then
+ commands.writestatus("lxml","prepending setup %s for %s",setup,document)
+ end
+ insert(sd,1,setup)
+ elseif what == 2 then
+ if trace_loading then
+ commands.writestatus("lxml","appending setup %s for %s",setup,document)
+ end
+ insert(sd,setup)
+ elseif what == 3 then
+ if trace_loading then
+ commands.writestatus("lxml","inserting setup %s for %s before %s",setup,document,where)
+ end
+ table.insert_before_value(sd,setup,where)
+ elseif what == 4 then
+ if trace_loading then
+ commands.writestatus("lxml","inserting setup %s for %s after %s",setup,document,where)
+ end
+ table.insert_after_value(sd,setup,where)
+ end
+end
+
+function lxml.flushsetups(id,...)
+ local done, list = { }, { ... }
+ for i=1,#list do
+ local document = list[i]
+ local sd = setups[document]
+ if sd then
+ for k=1,#sd do
+ local v= sd[k]
+ if not done[v] then
+ if trace_loading then
+ commands.writestatus("lxml","applying setup %02i = %s to %s",k,v,document)
+ end
+ texsprint(ctxcatcodes,"\\xmlsetup{",id,"}{",v,"}")
+ done[v] = true
+ end
+ end
+ elseif trace_loading then
+ commands.writestatus("lxml","no setups for %s",document)
+ end
+ end
+end
+
+function lxml.resetsetups(document)
+ if trace_loading then
+ commands.writestatus("lxml","resetting all setups for %s",document)
+ end
+ setups[document] = { }
+end
+
+function lxml.removesetup(document,setup)
+ local s = setups[document]
+ if s then
+ for i=1,#s do
+ if s[i] == setup then
+ if trace_loading then
+ commands.writestatus("lxml","removing setup %s for %s",setup,document)
+ end
+ remove(t,i)
+ break
+ end
+ end
+ end
+end
+
+function lxml.setsetup(id,pattern,setup)
+ if not setup or setup == "" or setup == "*" or setup == "-" or setup == "+" then
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ if trace_setups then
+ for c=1, #collected do
+ local e = collected[c]
+ local ix = e.ix or 0
+ if setup == "-" then
+ e.command = false
+ logs.report("lxml","lpath matched (a) %5i: %s = %s -> skipped",c,ix,setup)
+ elseif setup == "+" then
+ e.command = true
+ logs.report("lxml","lpath matched (b) %5i: %s = %s -> text",c,ix,setup)
+ else
+ local tg = e.tg
+ if tg then -- to be sure
+ e.command = tg
+ local ns = e.rn or e.ns
+ if ns == "" then
+ logs.report("lxml","lpath matched (c) %5i: %s = %s -> %s",c,ix,tg,tg)
+ else
+ logs.report("lxml","lpath matched (d) %5i: %s = %s:%s -> %s",c,ix,ns,tg,tg)
+ end
+ end
+ end
+ end
+ else
+ for c=1, #collected do
+ local e = collected[c]
+ if setup == "-" then
+ e.command = false
+ elseif setup == "+" then
+ e.command = true
+ else
+ e.command = e.tg
+ end
+ end
+ end
+ elseif trace_setups then
+ logs.report("lxml","no lpath matches for %s",pattern)
+ end
+ else
+ local a, b = match(setup,"^(.+:)([%*%-])$")
+ if a and b then
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ if trace_setups then
+ for c=1, #collected do
+ local e = collected[c]
+ local ns, tg, ix = e.rn or e.ns, e.tg, e.ix or 0
+ if b == "-" then
+ e.command = false
+ if ns == "" then
+ logs.report("lxml","lpath matched (e) %5i: %s = %s -> skipped",c,ix,tg)
+ else
+ logs.report("lxml","lpath matched (f) %5i: %s = %s:%s -> skipped",c,ix,ns,tg)
+ end
+ elseif b == "+" then
+ e.command = true
+ if ns == "" then
+ logs.report("lxml","lpath matched (g) %5i: %s = %s -> text",c,ix,tg)
+ else
+ logs.report("lxml","lpath matched (h) %5i: %s = %s:%s -> text",c,ix,ns,tg)
+ end
+ else
+ e.command = a .. tg
+ if ns == "" then
+ logs.report("lxml","lpath matched (i) %5i: %s = %s -> %s",c,ix,tg,e.command)
+ else
+ logs.report("lxml","lpath matched (j) %5i: %s = %s:%s -> %s",c,ix,ns,tg,e.command)
+ end
+ end
+ end
+ else
+ for c=1, #collected do
+ local e = collected[c]
+ if b == "-" then
+ e.command = false
+ elseif b == "+" then
+ e.command = true
+ else
+ e.command = a .. e.tg
+ end
+ end
+ end
+ elseif trace_setups then
+ logs.report("lxml","no lpath matches for %s",pattern)
+ end
+ else
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ if trace_setups then
+ for c=1, #collected do
+ local e = collected[c]
+ e.command = setup
+ local ns, tg, ix = e.rn or e.ns, e.tg, e.ix or 0
+ if ns == "" then
+ logs.report("lxml","lpath matched (k) %5i: %s = %s -> %s",c,ix,tg,setup)
+ else
+ logs.report("lxml","lpath matched (l) %5i: %s = %s:%s -> %s",c,ix,ns,tg,setup)
+ end
+ end
+ else
+ for c=1, #collected do
+ collected[c].command = setup
+ end
+ end
+ elseif trace_setups then
+ logs.report("lxml","no lpath matches for %s",pattern)
+ end
+ end
+ end
+end
+
+-- finalizers
+
+local finalizers = xml.finalizers.tex
+
+local function first(collected)
+ if collected then
+ xmlsprint(collected[1])
+ end
+end
+
+local function last(collected)
+ if collected then
+ xmlsprint(collected[#collected])
+ end
+end
+
+local function all(collected)
+ if collected then
+ for c=1,#collected do
+ xmlsprint(collected[c])
+ end
+ end
+end
+
+local function reverse(collected)
+ if collected then
+ for c=#collected,1,-1 do
+ xmlsprint(collected[c])
+ end
+ end
+end
+
+local function count(collected)
+ texwrite((collected and #collected) or 0)
+end
+
+local function position(collected,n)
+ -- todo: if not n then == match
+ if collected then
+ n = tonumber(n) or 0
+ if n < 0 then
+ n = #collected + n + 1
+ end
+ if n > 0 then
+ xmlsprint(collected[n])
+ end
+ end
+end
+
+local function match(collected) -- is match in preceding collected, never change, see bibxml
+ texwrite((collected and collected[1].mi) or 0)
+end
+
+local function index(collected,n)
+ if collected then
+ n = tonumber(n) or 0
+ if n < 0 then
+ n = #collected + n + 1
+ end
+ if n > 0 then
+ texwrite(collected[n].ni or 0)
+ end
+ end
+end
+
+local function command(collected,cmd)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local ix = e.ix
+ if not ix then
+ lxml.addindex(e.name,false,true)
+ ix = e.ix
+ end
+ texsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",e.name,"::",ix,"}")
+ end
+ end
+end
+
+local function attribute(collected,a,default)
+ if collected and #collected > 0 then
+ local at = collected[1].at
+ local str = (at and at[a]) or default
+ if str and str ~= "" then
+ texsprint(notcatcodes,str)
+ end
+ elseif default then
+ texsprint(notcatcodes,default)
+ end
+end
+
+local function chainattribute(collected,arguments) -- todo: optional levels
+ if collected then
+ local e = collected[1]
+ while e do
+ local at = e.at
+ if at then
+ local a = at[arguments]
+ if a then
+ texsprint(notcatcodes,a)
+ end
+ else
+ break -- error
+ end
+ e = e.__p__
+ end
+ end
+end
+
+local function text(collected)
+ if collected then
+ local nc = #collected
+ if nc == 1 then -- hardly any gain so this will go
+ cprint(collected[1])
+ else for c=1,nc do
+ cprint(collected[c])
+ end end
+ end
+end
+
+local function ctxtext(collected)
+ if collected then
+ for c=1,#collected do
+ texsprint(ctxcatcodes,collected[1].dt)
+ end
+ end
+end
+
+local lowerchars, upperchars = characters.lower, characters.upper
+
+local function lower(collected)
+ if collected then
+ for c=1,#collected do
+ texsprint(ctxcatcodes,lowerchars(collected[1].dt[1]))
+ end
+ end
+end
+
+local function upper(collected)
+ if collected then
+ for c=1,#collected do
+ texsprint(ctxcatcodes,upperchars(collected[1].dt[1]))
+ end
+ end
+end
+
+local function number(collected)
+ if collected then
+ local n = 0
+ for c=1,#collected do
+ n = n + tonumber(collected[c].dt[1] or 0)
+ end
+ texwrite(n)
+ end
+end
+
+local function concatrange(collected,start,stop,separator,lastseparator,textonly) -- test this on mml
+ if collected then
+ local nofcollected = #collected
+ local separator = separator or ""
+ local lastseparator = lastseparator or separator or ""
+ start, stop = (start == "" and 1) or tonumber(start) or 1, (stop == "" and nofcollected) or tonumber(stop) or nofcollected
+ if stop < 0 then stop = nofcollected + stop end -- -1 == last-1
+ for i=start,stop do
+ if textonly then
+ xmlcprint(collected[i])
+ else
+ xmlsprint(collected[i])
+ end
+ if i == nofcollected then
+ -- nothing
+ elseif i == nofcollected-1 and lastseparator ~= "" then
+ texsprint(ctxcatcodes,lastseparator)
+ elseif separator ~= "" then
+ texsprint(ctxcatcodes,separator)
+ end
+ end
+ end
+end
+
+local function concat(collected,separator,lastseparator,textonly) -- test this on mml
+ concatrange(collected,false,false,separator,lastseparator,textonly)
+end
+
+finalizers.first = first
+finalizers.last = last
+finalizers.all = all
+finalizers.reverse = reverse
+finalizers.count = count
+finalizers.command = command
+finalizers.attribute = attribute
+finalizers.text = text
+finalizers.lower = lower
+finalizers.upper = upper
+finalizers.ctxtext = ctxtext
+finalizers.context = ctxtext
+finalizers.position = position
+finalizers.match = match
+finalizers.index = index
+finalizers.concat = concat
+finalizers.concatrange = concatrange
+finalizers.chainattribute = chainattribute
+finalizers.default = all -- !!
+
+local concat = table.concat
+
+function finalizers.tag(collected)
+ if collected then
+ local c
+ if n == 0 or not n then
+ c = collected[1]
+ elseif n > 1 then
+ c = collected[n]
+ else
+ c = collected[#collected-n+1]
+ end
+ if c then
+ texsprint(c.tg)
+ end
+ end
+end
+
+function finalizers.name(collected)
+ if collected then
+ local c
+ if n == 0 or not n then
+ c = collected[1]
+ elseif n > 1 then
+ c = collected[n]
+ else
+ c = collected[#collected-n+1]
+ end
+ if c then
+ if c.ns == "" then
+ texsprint(c.tg)
+ else
+ texsprint(c.ns,":",c.tg)
+ end
+ end
+ end
+end
+
+function finalizers.tags(collected,nonamespace)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local ns, tg = e.ns, e.tg
+ if nonamespace or ns == "" then
+ texsprint(tg)
+ else
+ texsprint(ns,":",tg)
+ end
+ end
+ end
+end
+
+--
+
+local function verbatim(id,before,after)
+ local root = get_id(id)
+ if root then
+ if before then texsprint(ctxcatcodes,before,"[",root.tg or "?","]") end
+ lxml.toverbatim(xmltostring(root.dt))
+ if after then texsprint(ctxcatcodes,after) end
+ end
+end
+function lxml.inlineverbatim(id)
+ verbatim(id,"\\startxmlinlineverbatim","\\stopxmlinlineverbatim")
+end
+function lxml.displayverbatim(id)
+ verbatim(id,"\\startxmldisplayverbatim","\\stopxmldisplayverbatim")
+end
+
+lxml.verbatim = verbatim
+
+-- helpers
+
+function lxml.first(id,pattern)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ first(collected)
+ end
+end
+
+function lxml.last(id,pattern)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ last(collected)
+ end
+end
+
+function lxml.all(id,pattern)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ all(collected)
+ end
+end
+
+function lxml.count(id,pattern)
+ -- always needs to produce a result so no test here
+ count(lxmlparseapply(id,pattern))
+end
+
+function lxml.attribute(id,pattern,a,default)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ attribute(collected,a,default)
+ end
+end
+
+function lxml.raw(id,pattern) -- the content, untouched by commands
+ local collected = (pattern and lxmlparseapply(id,pattern)) or get_id(id)
+ if collected then
+ texsprint(xmltostring(collected[1].dt))
+ end
+end
+
+function lxml.context(id,pattern) -- the content, untouched by commands
+ if not pattern then
+ local collected = get_id(id)
+ -- texsprint(ctxcatcodes,collected.dt[1])
+ ctx_text(collected.dt[1])
+ else
+ local collected = lxmlparseapply(id,pattern) or get_id(id)
+ if collected and #collected > 0 then
+ texsprint(ctxcatcodes,collected[1].dt)
+ end
+ end
+end
+
+function lxml.text(id,pattern)
+ local collected = (pattern and lxmlparseapply(id,pattern)) or get_id(id)
+ if collected then
+ text(collected)
+ end
+end
+
+lxml.content = text
+
+function lxml.position(id,pattern,n)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ position(collected,n)
+ end
+end
+
+function lxml.chainattribute(id,pattern,a,default)
+ local collected = lxmlparseapply(id,pattern)
+ if collected then
+ chainattribute(collected,a,default)
+ end
+end
+
+function lxml.concatrange(id,pattern,start,stop,separator,lastseparator,textonly) -- test this on mml
+ concatrange(lxmlparseapply(id,pattern),start,stop,separator,lastseparator,textonly)
+end
+
+function lxml.concat(id,pattern,separator,lastseparator,textonly)
+ concatrange(lxmlparseapply(id,pattern),false,false,separator,lastseparator,textonly)
+end
+
+function lxml.element(id,n)
+ position(lxmlparseapply(id,"/*"),n)
+end
+
+lxml.index = lxml.position
+
+function lxml.pos(id)
+ local root = get_id(id)
+ texwrite((root and root.ni) or 0)
+end
+
+function lxml.att(id,a,default)
+ local root = get_id(id)
+ if root then
+ local at = root.at
+ local str = (at and at[a]) or default
+ if str and str ~= "" then
+ texsprint(notcatcodes,str)
+ end
+ elseif default then
+ texsprint(notcatcodes,default)
+ end
+end
+
+function lxml.name(id) -- or remapped name? -> lxml.info, combine
+ local r = get_id(id)
+ local ns = r.rn or r.ns or ""
+ if ns ~= "" then
+ texsprint(ns,":",r.tg)
+ else
+ texsprint(r.tg)
+ end
+end
+
+function lxml.match(id) -- or remapped name? -> lxml.info, combine
+ texsprint(get_id(id).mi or 0)
+end
+
+function lxml.tag(id) -- tag vs name -> also in l-xml tag->name
+ texsprint(get_id(id).tg or "")
+end
+
+function lxml.namespace(id) -- or remapped name?
+ local root = get_id(id)
+ texsprint(root.rn or root.ns or "")
+end
+
+function lxml.flush(id)
+ id = get_id(id)
+ local dt = id and id.dt
+ if dt then
+ xmlsprint(dt)
+ end
+end
+
+function lxml.snippet(id,i)
+ local e = get_id(id)
+ if e then
+ local edt = e.dt
+ if edt then
+ xmlsprint(edt[i])
+ end
+ end
+end
+
+function lxml.direct(id)
+ xmlsprint(get_id(id))
+end
+
+function lxml.command(id,pattern,cmd)
+ local i, p = get_id(id,true)
+ local collected = lxmlparseapply(i,pattern)
+ if collected then
+ local rootname = p or i.name
+ for c=1,#collected do
+ local e = collected[c]
+ local ix = e.ix
+ if not ix then
+ addindex(rootname,false,true)
+ ix = e.ix
+ end
+ texsprint(ctxcatcodes,"\\xmlw{",cmd,"}{",rootname,"::",ix,"}")
+ end
+ end
+end
+
+-- loops
+
+function lxml.collected(id,pattern,reverse)
+ return xmlcollected(get_id(id),pattern,reverse)
+end
+
+function lxml.elements(id,pattern,reverse)
+ return xmlelements(get_id(id),pattern,reverse)
+end
+
+-- obscure ones
+
+lxml.info = lxml.name
+
+-- testers
+
+local found, empty = xml.found, xml.empty
+
+local doif, doifnot, doifelse = commands.doif, commands.doifnot, commands.doifelse
+
+function lxml.doif (id,pattern) doif (found(get_id(id),pattern)) end
+function lxml.doifnot (id,pattern) doifnot (found(get_id(id),pattern)) end
+function lxml.doifelse (id,pattern) doifelse(found(get_id(id),pattern)) end
+function lxml.doiftext (id,pattern) doif (not empty(get_id(id),pattern)) end
+function lxml.doifnottext (id,pattern) doifnot (not empty(get_id(id),pattern)) end
+function lxml.doifelsetext (id,pattern) doifelse(not empty(get_id(id),pattern)) end
+
+-- special case: "*" and "" -> self else lpath lookup
+
+--~ function lxml.doifelseempty(id,pattern) doifelse(isempty(get_id(id),pattern ~= "" and pattern ~= nil)) end -- not yet done, pattern
+
+-- status info
+
+statistics.register("xml load time", function()
+ if noffiles > 0 or nofconverted > 0 then
+ return format("%s seconds, %s files, %s converted", statistics.elapsedtime(xml), noffiles, nofconverted)
+ else
+ return nil
+ end
+end)
+
+statistics.register("lxml preparation time", function()
+ local calls, cached = xml.lpathcalls(), xml.lpathcached()
+ if calls > 0 or cached > 0 then
+ return format("%s seconds, %s nodes, %s lpath calls, %s cached calls",
+ statistics.elapsedtime(lxml), nofindices, calls, cached)
+ else
+ return nil
+ end
+end)
+
+statistics.register("lxml lpath profile", function()
+ local p = xml.profiled
+ if p and next(p) then
+ local s = table.sortedkeys(p)
+ local tested, matched, finalized = 0, 0, 0
+ texio.write_nl("log","\nbegin of lxml profile\n")
+ texio.write_nl("log","\n tested matched finalized pattern\n\n")
+ for i=1,#s do
+ local pattern = s[i]
+ local pp = p[pattern]
+ local t, m, f = pp.tested, pp.matched, pp.finalized
+ tested, matched, finalized = tested + t, matched + m, finalized + f
+ texio.write_nl("log",format("%9i %9i %9i %s",t,m,f,pattern))
+ end
+ texio.write_nl("log","\nend of lxml profile\n")
+ return format("%s patterns, %s tested, %s matched, %s finalized (see log for details)",#s,tested,matched,finalized)
+ else
+ return nil
+ end
+end)
+
+-- misc
+
+function lxml.nonspace(id,pattern) -- slow, todo loop
+ xmltprint(xmlcollect(get_id(id),pattern,true))
+end
+
+function lxml.strip(id,pattern,nolines,anywhere)
+ xml.strip(get_id(id),pattern,nolines,anywhere)
+end
+
+function lxml.stripped(id,pattern,nolines)
+ local str = xmltext(get_id(id),pattern) or ""
+ str = gsub(str,"^%s*(.-)%s*$","%1")
+ if nolines then
+ str = gsub(str,"%s+"," ")
+ end
+ xmlsprint(str)
+end
+
+function lxml.delete(id,pattern)
+ xml.delete(get_id(id),pattern)
+end
diff --git a/Master/texmf-dist/tex/context/base/lxml-xml.lua b/Master/texmf-dist/tex/context/base/lxml-xml.lua
new file mode 100644
index 00000000000..f791ec0f83f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lxml-xml.lua
@@ -0,0 +1,288 @@
+if not modules then modules = { } end modules ['lxml-xml'] = {
+ version = 1.001,
+ comment = "this module is the basis for the lxml-* ones",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local finalizers = xml.finalizers.xml
+local xmlfilter = xml.filter -- we could inline this one for speed
+local xmltostring = xml.tostring
+local xmlserialize = xml.serialize
+
+local function first(collected) -- wrong ?
+ return collected and collected[1]
+end
+
+local function last(collected)
+ return collected and collected[#collected]
+end
+
+local function all(collected)
+ return collected
+end
+
+local function reverse(collected)
+ if collected then
+ local reversed = { }
+ for c=#collected,1,-1 do
+ reversed[#reversed+1] = collected[c]
+ end
+ return reversed
+ end
+end
+
+local function attribute(collected,name)
+ if collected and #collected > 0 then
+ local at = collected[1].at
+ return at and at[name]
+ end
+end
+
+local function att(id,name)
+ local at = id.at
+ return at and at[name]
+end
+
+local function count(collected)
+ return (collected and #collected) or 0
+end
+
+local function position(collected,n)
+ if collected then
+ n = tonumber(n) or 0
+ if n < 0 then
+ return collected[#collected + n + 1]
+ elseif n > 0 then
+ return collected[n]
+ else
+ return collected[1].mi or 0
+ end
+ end
+end
+
+local function match(collected)
+ return (collected and collected[1].mi) or 0 -- match
+end
+
+local function index(collected)
+ if collected then
+ return collected[1].ni
+ end
+end
+
+local function attributes(collected,arguments)
+ if collected then
+ local at = collected[1].at
+ if arguments then
+ return at[arguments]
+ elseif next(at) then
+ return at -- all of them
+ end
+ end
+end
+
+local function chainattribute(collected,arguments) -- todo: optional levels
+ if collected then
+ local e = collected[1]
+ while e do
+ local at = e.at
+ if at then
+ local a = at[arguments]
+ if a then
+ return a
+ end
+ else
+ break -- error
+ end
+ e = e.__p__
+ end
+ end
+ return ""
+end
+
+local function raw(collected) -- hybrid
+ if collected then
+ local e = collected[1] or collected
+ return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
+ else
+ return ""
+ end
+end
+
+local function text(collected) -- hybrid
+ if collected then
+ local e = collected[1] or collected
+ return (e and xmltostring(e.dt)) or ""
+ else
+ return ""
+ end
+end
+
+local function texts(collected)
+ if collected then
+ local t = { }
+ for c=1,#collected do
+ local e = collection[c]
+ if e and e.dt then
+ t[#t+1] = e.dt
+ end
+ end
+ return t
+ end
+end
+
+local function tag(collected,n)
+ if collected then
+ local c
+ if n == 0 or not n then
+ c = collected[1]
+ elseif n > 1 then
+ c = collected[n]
+ else
+ c = collected[#collected-n+1]
+ end
+ return c and c.tg
+ end
+end
+
+local function name(collected,n)
+ if collected then
+ local c
+ if n == 0 or not n then
+ c = collected[1]
+ elseif n > 1 then
+ c = collected[n]
+ else
+ c = collected[#collected-n+1]
+ end
+ if c then
+ if c.ns == "" then
+ return c.tg
+ else
+ return c.ns .. ":" .. c.tg
+ end
+ end
+ end
+end
+
+local function tags(collected,nonamespace)
+ if collected then
+ local t = { }
+ for c=1,#collected do
+ local e = collected[c]
+ local ns, tg = e.ns, e.tg
+ if nonamespace or ns == "" then
+ t[#t+1] = tg
+ else
+ t[#t+1] = ns .. ":" .. tg
+ end
+ end
+ return t
+ end
+end
+
+local function empty(collected)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ if e then
+ local edt = e.dt
+ if edt then
+ local n = #edt
+ if n == 1 then
+ local edk = edt[1]
+ local typ = type(edk)
+ if typ == "table" then
+ return false
+ elseif edk ~= "" then -- maybe an extra tester for spacing only
+ return false
+ end
+ elseif n > 1 then
+ return false
+ end
+ end
+ end
+ end
+ end
+ return true
+end
+
+finalizers.first = first
+finalizers.last = last
+finalizers.all = all
+finalizers.reverse = reverse
+finalizers.elements = all
+finalizers.default = all
+finalizers.attribute = attribute
+finalizers.att = att
+finalizers.count = count
+finalizers.position = position
+finalizers.match = match
+finalizers.index = index
+finalizers.attributes = attributes
+finalizers.chainattribute = chainattribute
+finalizers.text = text
+finalizers.texts = texts
+finalizers.tag = tag
+finalizers.name = name
+finalizers.tags = tags
+finalizers.empty = empty
+
+-- shortcuts -- we could support xmlfilter(id,pattern,first)
+
+function xml.first(id,pattern)
+ return first(xmlfilter(id,pattern))
+end
+
+function xml.last(id,pattern)
+ return last(xmlfilter(id,pattern))
+end
+
+function xml.count(id,pattern)
+ return count(xmlfilter(id,pattern))
+end
+
+function xml.attribute(id,pattern,a,default)
+ return attribute(xmlfilter(id,pattern),a,default)
+end
+
+function xml.raw(id,pattern)
+ if pattern then
+ return raw(xmlfilter(id,pattern))
+ else
+ return raw(id)
+ end
+end
+
+function xml.text(id,pattern)
+ if pattern then
+ -- return text(xmlfilter(id,pattern))
+ local collected = xmlfilter(id,pattern)
+ return (collected and xmltostring(collected[1].dt)) or ""
+ elseif id then
+ -- return text(id)
+ return xmltostring(id.dt) or ""
+ else
+ return ""
+ end
+end
+
+xml.content = text
+
+function xml.position(id,pattern,n) -- element
+ return position(xmlfilter(id,pattern),n)
+end
+
+function xml.match(id,pattern) -- number
+ return match(xmlfilter(id,pattern))
+end
+
+function xml.empty(id,pattern)
+ return empty(xmlfilter(id,pattern))
+end
+
+xml.all = xml.filter
+xml.index = xml.position
+xml.found = xml.filter
diff --git a/Master/texmf-dist/tex/context/base/m-barcodes.mkiv b/Master/texmf-dist/tex/context/base/m-barcodes.mkiv
new file mode 100644
index 00000000000..b0eae148558
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-barcodes.mkiv
@@ -0,0 +1,122 @@
+%D \module
+%D [ file=m-pstricks,
+%D version=2010.03.14,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Barcodes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% \startTEXpage
+% \startPSTRICKS
+% \pspicture(-4mm,-1mm)(38mm,26mm)
+% \psbarcode{9781860742712}{includetext guardwhitespace}{ean13}%
+% \endpspicture
+% \stopPSTRICKS
+% \stopTEXpage
+
+% 978-94-90688-01-1
+%
+% 978 = ean isbn identifier (979 also)
+% 94 = country code
+% 90688 = publisher code
+% 01 = title 1
+% 1 = checksum
+
+\usemodule[pstricks]
+
+\usePSTRICKSmodule[pst-barcode]
+
+\definefont[barcodefont][file:ocrb10]
+% \definefont[barcodefont][file:texgyreheros-regular]
+
+\startluacode
+plugins.barcodes = { }
+
+local function split(code)
+ local t = { string.byte(code,1,#code) }
+ if #t >= 12 then
+ local s = 0
+ for i=1,11,2 do
+ s = s + (t[i]-48)
+ end
+ for i=2,12,2 do
+ s = s + 3 * (t[i]-48)
+ end
+ local m = s % 10
+ local c = (m > 0 and (10 - m)) or 0
+ return t, s, m, c
+ end
+end
+
+function plugins.barcodes.isbn_1(original)
+ local code = string.gsub(original,"%-","")
+ local t, s, m, c = split(code)
+ if t then
+ if #t == 13 then
+ local e = ((c == t[13] - 48) and "correct") or "wrong"
+ logs.report("isbn code","code=%s, sum=%s, checksum=%s, modulo=%s, status=%s",original,s,m,c,e)
+ else
+ logs.report("isbn code","code=%s, sum=%s, checksum=%s, modulo=%s",original,s,m,c)
+ code= code .. c
+ end
+ end
+ tex.sprint(code)
+end
+
+function plugins.barcodes.isbn_2(original)
+ local code = string.gsub(original,"%-","")
+ local t, s, m, c = split(code)
+ if t and #t == 12 then
+ original = original .. "-" .. c
+ end
+ tex.sprint(original)
+end
+\stopluacode
+
+\startsetups barcode:isbn
+ \scale
+ [width=5cm]
+ {
+ \vbox {
+ \hbox {
+ \hskip3.7mm
+ \scale[width=34mm]{\barcodefont ISBN \ctxlua{plugins.barcodes.isbn_2("\getvariable{barcode}{code}")}}
+ }
+ \par
+ \normalexpanded { \noexpand \setPSTRICKS {
+ \noexpand \pspicture(-4mm,-1mm)(38mm,26mm)
+ \noexpand \psbarcode {
+ \ctxlua{plugins.barcodes.isbn_1("\getvariable{barcode}{code}")}
+ } {
+ includetext guardwhitespace
+ } {
+ ean13
+ }
+ \noexpand \endpspicture
+ }
+ \noexpand \processPSTRICKS }
+ }
+ }
+\stopsetups
+
+\def\barcode[#1]%
+ {\bgroup
+ \setvariables[barcode][type=isbn,#1]%
+ \directsetup{barcode:\getvariable{barcode}{type}}%
+ \egroup}
+
+% \usemodule[barcodes]
+%
+% \starttext
+% \startTEXpage
+% \barcode[type=isbn,code=978-94-90688-01-1]
+% \stopTEXpage
+% \stoptext
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/context/base/m-chart.mkii b/Master/texmf-dist/tex/context/base/m-chart.mkii
new file mode 100644
index 00000000000..2554fa2d4b7
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-chart.mkii
@@ -0,0 +1,48 @@
+%D \module
+%D [ file=m-chart,
+%D version=1998.10.10,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Flow Charts,
+%D author={Hans Hagen \& Ton Otten},
+%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 The \XML\ interface:
+
+\unprotect
+
+\startXMLdefinitions flowchart
+
+\defineXMLargument [flowchartdefinition]
+ {\defineFLOWchart[\XMLpar{flowchartdefinition}{identifier}{unknown}]}
+
+\defineXMLpickup [flowcell]
+ {\startFLOWcell
+ \defineXMLargument[name]{\unspaceafter\name}%
+ \defineXMLargument[shape]{\unspaceafter\shape}%
+ \defineXMLnestedargument[text]{\text}}
+ {\stopFLOWcell}
+
+\defineXMLenvironment [location] % global unspace/store
+ {\bgroup\defineXMLpush[x]\defineXMLpush[y]}
+ {\XMLunspace{x}\XMLunspace{y}%
+ \expanded{\egroup\noexpand\location{\XMLpop{x},\XMLpop{y}}}}
+
+\defineXMLenvironment [connection]
+ {\bgroup\defineXMLpush[type]\defineXMLpush[name]}%
+ {\XMLunspace{type}\XMLunspace{name}%
+ \expanded{\egroup\noexpand\connection[\XMLpop{type}]{\XMLpop{name}}}}
+
+\defineXMLsingular [flowchart]
+ {\expanded{\FLOWchart[\XMLpar{flowchart}{identifier}{unknown}]}}
+
+\defineXMLdirective [flowchart] [shapes] \setupFLOWshapes
+\defineXMLdirective [flowchart] [lines] \setupFLOWlines
+
+\stopXMLdefinitions
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-chart.mkiv b/Master/texmf-dist/tex/context/base/m-chart.mkiv
new file mode 100644
index 00000000000..4c008a5eef3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-chart.mkiv
@@ -0,0 +1,20 @@
+%D \module
+%D [ file=m-chart,
+%D version=1998.10.10,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Flow Charts,
+%D author={Hans Hagen \& Ton Otten},
+%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 The \XML\ interface:
+
+\unprotect
+
+\writestatus\m!systems{The chart mkiv xml interface is not yet defined!}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-chart.tex b/Master/texmf-dist/tex/context/base/m-chart.tex
index c8928f2d5ee..5ccf4c2ad2b 100644
--- a/Master/texmf-dist/tex/context/base/m-chart.tex
+++ b/Master/texmf-dist/tex/context/base/m-chart.tex
@@ -15,8 +15,8 @@
% todo: make mkiv variant
% todo: use dimexpr/numspr
-% will be redone with layers and dimexpr ro even better, by just using
-% textext
+% will be redone with layers and dimexpr or even better, by just using
+% textext .. a nice example of old code
%D This is an experimental module. Pieces of code will be moved
%D to other modules. More features are possible but will be
@@ -1280,36 +1280,6 @@
% \def\processFLOWbuffer#1{\getvalue{\FLOWbufferprefix#1}}
% \def\typeFLOWbuffer #1{[Sorry, no verbatim chart #1 available.]}
-%D The XML interface [will be mode protected or separate x-chart file]
-
-\startXMLdefinitions flowchart
-
-\defineXMLargument [flowchartdefinition]
- {\defineFLOWchart[\XMLpar{flowchartdefinition}{identifier}{unknown}]}
-
-\defineXMLpickup [flowcell]
- {\startFLOWcell
- \defineXMLargument[name]{\unspaceafter\name}%
- \defineXMLargument[shape]{\unspaceafter\shape}%
- \defineXMLnestedargument[text]{\text}}
- {\stopFLOWcell}
-
-\defineXMLenvironment [location] % global unspace/store
- {\bgroup\defineXMLpush[x]\defineXMLpush[y]}
- {\XMLunspace{x}\XMLunspace{y}%
- \expanded{\egroup\noexpand\location{\XMLpop{x},\XMLpop{y}}}}
-
-\defineXMLenvironment [connection]
- {\bgroup\defineXMLpush[type]\defineXMLpush[name]}%
- {\XMLunspace{type}\XMLunspace{name}%
- \expanded{\egroup\noexpand\connection[\XMLpop{type}]{\XMLpop{name}}}}
-
-\defineXMLsingular [flowchart]
- {\expanded{\FLOWchart[\XMLpar{flowchart}{identifier}{unknown}]}}
-
-\defineXMLdirective [flowchart] [shapes] \setupFLOWshapes
-\defineXMLdirective [flowchart] [lines] \setupFLOWlines
-
-\stopXMLdefinitions
+\loadmarkfile{m-chart}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-chemic.mkiv b/Master/texmf-dist/tex/context/base/m-chemic.mkiv
index 4cc1e3bd898..bd4cb093e4d 100644
--- a/Master/texmf-dist/tex/context/base/m-chemic.mkiv
+++ b/Master/texmf-dist/tex/context/base/m-chemic.mkiv
@@ -12,8 +12,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\usemodule[pictex] % we will get rid of this
+\writestatus{ppchtex}{not loaded as support for chemistry in now built in}
-\input ppchtex.mkiv \relax
+% \usemodule[pictex] % we will get rid of this
+% \input ppchtex.mkiv \relax
\endinput
diff --git a/Master/texmf-dist/tex/context/base/m-database.tex b/Master/texmf-dist/tex/context/base/m-database.tex
index c4fba132a24..3bb050f142a 100644
--- a/Master/texmf-dist/tex/context/base/m-database.tex
+++ b/Master/texmf-dist/tex/context/base/m-database.tex
@@ -85,34 +85,20 @@
\appendseparatedlistcontent{#1}%
\appendseparatedlistparameter\c!right}
+% a version more robust with regard to {a a} b c d situations:
-% % % so far
-
-% \def\dodefineprocessseplist#1#2% separator \docommand
-% {\def\dodoprocessseplist##1##2#1%
-% {\ifx\relax##1%
-% \expandafter\nodoprocessseplist
-% \else\ifx##1#1%
-% #2{}%
-% #2{##2}%
-% \expandafter\expandafter\expandafter\dodoprocessseplist
-% \else
-% #2{##1##2}%
-% \expandafter\expandafter\expandafter\dodoprocessseplist
-% \fi\fi}%
-% \def\doprocessseplist##1\relax
-% {\dodoprocessseplist##1#1\relax#1\relax\relax\end}}
-%
-% a version more robust with regard to {a a} b c d situations
+\edef\detokenizedrelax{\detokenize{\relax}}
-\def\edef@relax{\relax}
+\edef\processseplistseparator{\detokenize{,}}%
\def\dodefineprocessseplist#1#2% separator \docommand
- {\def\dodoprocessseplist##1##2#1%
- {\edef\!!stringa{##1}%
- \ifx\edef@relax\!!stringa
+ {\edef\processseplistseparator{\detokenize{#1}}%
+ \def\dodoprocessseplist##1##2#1%
+ {\edef\!!stringa{\detokenize{##1}}%
+ \ifx\detokenizedrelax\!!stringa
\expandafter\nodoprocessseplist
- \else\ifx\!!stringa#1%
+ % \else\ifx\!!stringa#1%
+ \else\ifx\!!stringa\processseplistseparator
#2{}%
#2{##2}%
\expandafter\expandafter\expandafter\dodoprocessseplist
@@ -404,4 +390,32 @@ a,b,c
d,e,f
\stopseparatedlist
+\defineseparatedlist[CSV]
+ [separator=comma,
+ before=\bTABLE, after=\eTABLE,
+ first=\bTR, last=\eTR,
+ left=\bTD, right=\eTD]
+
+\startCSV
+a,b,c,č
+d,e,f,š
+\stopCSV
+
+\enableregime[utf]
+
+\defineseparatedlist[X][separator=X,left=(,right=),first=\endgraf,last=\endgraf]
+\defineseparatedlist[Y][separator=Y,left=(,right=),first=\endgraf,last=\endgraf]
+
+\startX
+aXb
+Xc
+čXš
+\stopX
+
+\startY
+aYb
+Yc
+čYš
+\stopY
+
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-directives.tex b/Master/texmf-dist/tex/context/base/m-directives.tex
new file mode 100644
index 00000000000..c958f6cad51
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-directives.tex
@@ -0,0 +1,5 @@
+\doifnotmode{mkiv} {\endinput}
+
+\starttext
+ \showdirectives
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-graph.mkiv b/Master/texmf-dist/tex/context/base/m-graph.mkiv
index 39a1271d765..c9223488480 100644
--- a/Master/texmf-dist/tex/context/base/m-graph.mkiv
+++ b/Master/texmf-dist/tex/context/base/m-graph.mkiv
@@ -17,7 +17,7 @@
\startluacode
local function strip(s)
- return "\times10^{"..(s:gsub("%+*0*","")).."}"
+ return "\\times10^{"..(s:gsub("%+*0*","")).."}"
end
function metapost.format_n(fmt,str)
fmt = fmt:gsub("@","%%")
diff --git a/Master/texmf-dist/tex/context/base/m-narrowtt.tex b/Master/texmf-dist/tex/context/base/m-narrowtt.tex
index 6c14c97c529..2e11b99ad19 100644
--- a/Master/texmf-dist/tex/context/base/m-narrowtt.tex
+++ b/Master/texmf-dist/tex/context/base/m-narrowtt.tex
@@ -31,7 +31,7 @@
\definetypeface
[narrowtt] [tt]
- [mono] [modern-cond] [default] [encoding=\defaultencoding]
+ [mono] [modern-condensed] [default] [encoding=\defaultencoding]
\definetyping[n\v!typing] \setuptyping[n\v!typing][style=\narrowtt]
\definetype [n\v!type] \setuptype [n\v!type] [style=\narrowtt]
diff --git a/Master/texmf-dist/tex/context/base/m-obsolete.tex b/Master/texmf-dist/tex/context/base/m-obsolete.tex
new file mode 100644
index 00000000000..a97002cf64c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-obsolete.tex
@@ -0,0 +1,5 @@
+\unprotect
+
+\writestatus\m!systems{skipping obsolete module}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-pstricks.lua b/Master/texmf-dist/tex/context/base/m-pstricks.lua
new file mode 100644
index 00000000000..35cae93f65f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-pstricks.lua
@@ -0,0 +1,73 @@
+if not modules then modules = { } end modules ['m-pstricks'] = {
+ version = 1.001,
+ comment = "companion to m-pstricks.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The following will be done when I need ps tricks figures
+-- in large quantities:
+--
+-- + hash graphics and only process them once
+-- + save md5 checksums in tuc file
+--
+-- It's no big deal but has a low priority.
+
+local format, lower, concat, gmatch = string.format, string.lower, table.concat, string.gmatch
+local variables = interfaces.variables
+
+plugins = plugins or { }
+plugins.pstricks = plugins.pstricks or { }
+
+local template = [[
+\starttext
+ \pushcatcodetable
+ \setcatcodetable\texcatcodes
+ \usemodule[pstric]
+ %s
+ \popcatcodetable
+ \startTEXpage
+ \hbox\bgroup
+ \ignorespaces
+ %s
+ \removeunwantedspaces
+ \egroup
+ \obeydepth %% temp hack as we need to figure this out
+ \stopTEXpage
+\stoptext
+]]
+
+local modules = { }
+local graphics = 0
+
+function plugins.pstricks.usemodule(names)
+ for name in gmatch(names,"([^%s,]+)") do
+ modules[#modules+1] = format([[\readfile{%s}{}{}]],name)
+ end
+end
+
+function plugins.pstricks.process(n)
+ graphics = graphics + 1
+ local name = string.format("%s-pstricks-%04i",tex.jobname,graphics)
+ local data = buffers.collect("def-"..n)
+ local tmpfile = name .. ".tmp"
+ local epsfile = name .. ".ps"
+ local pdffile = name .. ".pdf"
+ local modules = concat(modules,"\n")
+ os.remove(epsfile)
+ os.remove(pdffile)
+ io.savedata(tmpfile,format(template,modules,data))
+ os.execute(format("mtxrun --script texexec %s --once --dvips",tmpfile))
+ if lfs.isfile(epsfile) then
+ os.execute(format("ps2pdf %s %s",epsfile,pdffile))
+ -- todo: direct call but not now
+ if lfs.isfile(pdffile) then
+ context.externalfigure( { pdffile }, { object = variables.no } )
+ else
+ logs.report("plugins","pstricks run failed, no pdf file")
+ end
+ else
+ logs.report("plugins","pstricks run failed, no ps file")
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/m-pstric.tex b/Master/texmf-dist/tex/context/base/m-pstricks.mkii
index ac018fe074e..3ada9e07ec7 100644
--- a/Master/texmf-dist/tex/context/base/m-pstric.tex
+++ b/Master/texmf-dist/tex/context/base/m-pstricks.mkii
@@ -11,8 +11,15 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% pstricks is not supported in context mkii (it's no problem doing that
+% but as we also need to support latex it would become quite messy so for
+% context we use metapost and for latex pstricks)
+
%M \usemodule[pstric]
+\letvalue{@unused}\plussixteen
+\letvalue{alloc@}\gobblefivearguments
+
\chardef\oldbarcode\the\catcode`\| \catcode`\|=12
\def\loadpstrickscolors#1%
@@ -41,6 +48,12 @@
\catcode`\|=\oldbarcode
+\def\loadpstricksmodule[#1]%
+ {\chardef\oldbarcode\the\catcode`\|
+ \catcode`\|=12
+ \readfile{#1}{}{}%
+ \catcode`\|=\oldbarcode}
+
%D The next piece of code is for John Culleton who suggested to
%D handle \PSTRICKS\ in a similar fashion as \METAPOST, i.e.\
%D using a child process. For the moment there is no support
@@ -108,6 +121,7 @@
\long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
{\doifelse{\jobsuffix}{dvi} % will some day move to app as switch
{\hbox{#2}}
- {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
+% {\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
+ {\startTEXapplication[#1]{}#2\stopTEXapplication}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-pstricks.mkiv b/Master/texmf-dist/tex/context/base/m-pstricks.mkiv
new file mode 100644
index 00000000000..c800ec19935
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-pstricks.mkiv
@@ -0,0 +1,66 @@
+%D \module
+%D [ file=m-pstricks,
+%D version=2010.03.14,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\PSTRICKS\ Connections,
+%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.
+
+\ctxloadluafile{m-pstricks}{}
+
+%D \startbuffer
+%D \usePSTRICKSmodule[pst-barcode]
+%D
+%D \startPSTRICKS
+%D \pspicture(-4mm,-1mm)(38mm,26mm)
+%D \psbarcode{9781860742712}{includetext guardwhitespace}{ean13}%
+%D \endpspicture
+%D \stopPSTRICKS
+%D \stopbuffer
+%D
+%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
+
+\unprotect
+
+% best we can make a special colors module
+%
+% \let\@unused\plussixteen
+% \let\alloc@ \gobblefivearguments
+%
+% \def\loadpstrickscolors#1%
+% {\pushmacro\dodefinecolor
+% \pushmacro\dodefinepalet
+% \pushmacro\dodefinecolorgroup
+% \def\dodefinecolor[##1][##2]%
+% {\doifassignmentelse{##2}
+% {\getparameters[pstricks][r=0,g=0,b=0,##2]%
+% \expanded{\newrgbcolor{##1}{{\pstricksr} {\pstricksg} {\pstricksb}}}}%
+% {}}%
+% \def\dodefinepalet [##1][##2]{}%
+% \def\dodefinecolorgroup[##1][##2][##3]{}%
+% \writestatus{pstricks}{loading colors from #1}%
+% \input #1 \relax
+% \popmacro\dodefinecolorgroup
+% \popmacro\dodefinepalet
+% \popmacro\dodefinecolor}
+%
+% \input multido \relax
+% \input pstricks \relax
+% \input pst-plot \relax
+%
+% \loadpstrickscolors{colo-rgb}
+
+\definebuffer[PSTRICKS]
+
+\unexpanded\def\processPSTRICKS {\ctxlua{plugins.pstricks.process(\thebuffernumber{PSTRICKS})}}
+\unexpanded\def\usePSTRICKSmodule[#1]{\ctxlua{plugins.pstricks.usemodule("#1")}}
+\unexpanded\def\setPSTRICKS #1{\setbuffer[def-\thebuffernumber{PSTRICKS}]#1\endbuffer}
+
+\let\stopPSTRICKS\processPSTRICKS
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-one.tex b/Master/texmf-dist/tex/context/base/m-pstricks.tex
index bd18eb2810f..28bc9f30f2f 100644
--- a/Master/texmf-dist/tex/context/base/type-one.tex
+++ b/Master/texmf-dist/tex/context/base/m-pstricks.tex
@@ -1,8 +1,8 @@
%D \module
-%D [ file=type-one,
-%D version=2007.07.30,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Type One Definitions,
+%D [ file=m-pstricks,
+%D version=1997.01.15,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\PSTRICKS\ Connections,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,6 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\loadmarkfile{type-one}
+\loadmarkfile{m-pstricks}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/m-punk.mkiv b/Master/texmf-dist/tex/context/base/m-punk.mkiv
new file mode 100644
index 00000000000..65bf0397419
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-punk.mkiv
@@ -0,0 +1,243 @@
+%D \module
+%D [ file=m-punk,
+%D version=2008.04.15,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Punk Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ifx\luaversion\undefined \endinput \fi
+
+% At some point the font generation code will move into the
+% ConTeXt MkIV kernel.
+
+\startluacode
+do
+ local concat = table.concat
+ local chardata = characters.data
+ local fontdata = fonts.ids
+
+ fonts.mp = fonts.mp or { }
+
+ fonts.mp.version = fonts.mp.version or 1.11
+ fonts.mp.inline = true
+ fonts.mp.cache = containers.define("fonts", "mp", fonts.mp.version, true)
+
+ metapost.characters = metapost.characters or { }
+
+-- todo: use table share as in otf
+
+ local characters, descriptions = { }, { }
+ local factor, l, n, w, h, d, total, variants = 100, { }, 0, 0, 0, 0, 0, 0, true
+
+ -- A next version of mplib will provide the tfm font information which
+ -- gives better glyph dimensions, plus additional kerning information.
+
+ local flusher = {
+ startfigure = function(chrnum,llx,lly,urx,ury)
+ l, n = { }, chrnum
+ w, h, d = urx - llx, ury, -lly
+ total = total + 1
+ inline = fonts.mp.inline
+ end,
+ flushfigure = function(t)
+ for i=1, #t do
+ l[#l+1] = t[i]
+ end
+ end,
+ stopfigure = function()
+ local cd = chardata[n]
+ if inline then
+ descriptions[n] = {
+ -- unicode = n,
+ name = cd and cd.adobename,
+ width = w*100,
+ height = h*100,
+ depth = d*100,
+ boundingbox = { 0, -d, w, h },
+ }
+ characters[n] = {
+ commands = { -- todo: xforms, should happen in backend
+ { "special", "pdf: " .. concat(l," ") },
+ }
+ }
+ else
+ descriptions[n] = {
+ -- unicode = n,
+ name = cd and cd.adobename,
+ width = w*100,
+ height = h*100,
+ depth = d*100,
+ boundingbox = { 0, -d, w, h },
+ }
+ characters[n] = {
+ commands = {
+ { "image", { stream = concat(l," "), bbox = { 0, -d*65536, w*65536, h*65536 } } },
+ }
+ }
+ end
+ end
+ }
+
+ metapost.characters.instances = metapost.characters.instances or 10
+
+ function metapost.characters.process(mpxformat, name, instances, scalefactor)
+ statistics.starttiming(metapost.characters)
+ scalefactor = scalefactor or 1
+ instances = instances or metapost.characters.instances or 10
+ local fontname = file.removesuffix(file.basename(name))
+ local hash = file.robustname(string.format("%s %05i %03i", fontname, scalefactor*1000, instances))
+ local lists = containers.read(fonts.mp.cache(), hash)
+ if not lists then
+ statistics.starttiming(flusher)
+ -- we can use a format per font
+ local data = io.loaddata(resolvers.find_file(name))
+ metapost.reset(mpxformat)
+ metapost.set_outer_color(2) -- no outer color and no reset either
+ lists = { }
+ for i=1,instances do
+ list = { }
+ characters, descriptions = { }, { }
+ metapost.process(
+ mpxformat,
+ {
+ "randomseed := " .. i*10 .. ";",
+ "scale_factor := " .. scalefactor .. " ;",
+ data
+ },
+ false,
+ flusher
+ )
+ lists[i] = {
+ designsize = 655360,
+ name = string.format("%s-%03i",hash,i),
+ parameters = {
+ slant = 0,
+ space = 333 * scalefactor,
+ space_stretch = 166.5 * scalefactor,
+ space_shrink = 111 * scalefactor,
+ x_height = 431 * scalefactor,
+ quad =1000 * scalefactor,
+ extra_space = 0
+ },
+ ["type"] = "virtual",
+ characters = characters,
+ descriptions = descriptions,
+ -- embedding = "subset",
+ -- mkiv:
+ spacer = "space",
+ unit = 1000,
+ shared = { },
+ unique = { },
+ }
+ end
+ metapost.reset(mpxformat) -- saves memory
+ lists = containers.write(fonts.mp.cache(), hash, lists)
+ statistics.stoptiming(flusher)
+ end
+ variants = variants + #lists
+ statistics.stoptiming(metapost.characters)
+ return lists
+ end
+
+ function fonts.vf.aux.combine.commands.metafont(g,v)
+ local size = g.specification.size
+ local data = metapost.characters.process(v[2],v[3],v[4],size/655360)
+ local list, t = { }, { }
+ for d=1,#data do
+ t = data[d]
+ t = fonts.tfm.scale(t, -1000)
+ local id = font.nextid()
+ t.fonts = { { id = id } }
+ fontdata[id] = t
+ fonts.vf.aux.compose_characters(t)
+ list[d] = font.define(t)
+ end
+ for k=1,#t do
+ g[k] = t[k] -- kind of replace, when not present, make nil
+ end
+ g.virtualized = true
+ g.variants = list
+ end
+
+ fonts.define.methods.install( "punk", {
+ { "metafont", "mfplain", "punkfont.mp", 10 },
+ } )
+
+ cases.actions[99] = function(current)
+ local used = fontdata[current.font].variants
+ if used then
+ local f = math.random(1,#used)
+ current.font = used[f]
+ return current, true
+ else
+ return current, false
+ end
+ end
+
+ metapost.characters.flusher = flusher
+
+ statistics.register("metapost font generation", function()
+ local time = statistics.elapsedtime(flusher)
+ if total > 0 then
+ return string.format("%i glyphs, %.3f seconds runtime, %i glyphs/second", total, time, total/time)
+ else
+ return string.format("%i glyphs, %.3f seconds runtime", total, time)
+ end
+ end)
+
+ statistics.register("metapost font loading",function()
+ local time = statistics.elapsedtime(metapost.characters)
+ if variants > 0 then
+ return string.format("%.3f seconds, %i instances, %0.3f instances/second", time, variants, variants/time)
+ else
+ return string.format("%.3f seconds, %i instances", time, variants)
+ end
+ end)
+
+end
+\stopluacode
+
+\unexpanded\def\EnableRandomPunk {\setcharactercasing[99]}
+\unexpanded\def\RandomPunk {\groupedcommand\EnableRandomPunk\donothing}
+\unexpanded\def\StartRandomPunk {\begingroup\EnableRandomPunk}
+\unexpanded\def\StopRandomPunk {\endgroup}
+
+\starttypescript [serif] [punk] [default]
+ \setups[font:fallback:serif] % no style variants yet
+ \definefontsynonym [Serif] [demo@punk]
+\stoptypescript
+
+\starttypescript [punk]
+ \definetypeface [punk] [rm] [serif] [punk] [default]
+\stoptypescript
+
+\definefontfeature[punknova][mode=node,script=latn,rand=yes,kern=yes,liga=yes,tlig=yes]
+
+\starttypescript [serif] [punknova]
+ \setups[font:fallback:serif] % no style variants yet, actually it's a sans
+ \definefontsynonym [Serif] [file:punknova] [features=punknova]
+\stoptypescript
+
+\starttypescript [punknova]
+ \definetypeface [punknova] [rm] [serif] [punknova] [default]
+\stoptypescript
+
+\endinput
+
+\usetypescript[punk]
+
+\setupbodyfont[punk,14pt]
+
+\starttext
+ \definedfont[demo@punk at 10pt]hello world\par
+ \definedfont[demo@punk at 12pt]hello world\par
+ \definedfont[demo@punk at 16pt]hello world\par
+ \definedfont[demo@punk at 20pt]hello world\par
+\stoptext
+
diff --git a/Master/texmf-dist/tex/context/base/m-punk.tex b/Master/texmf-dist/tex/context/base/m-punk.tex
index 3b1baa75b77..fe7ec85ccdb 100644
--- a/Master/texmf-dist/tex/context/base/m-punk.tex
+++ b/Master/texmf-dist/tex/context/base/m-punk.tex
@@ -1,232 +1,3 @@
-%D \module
-%D [ file=m-punk,
-%D version=2008.04.15,
-%D title=\CONTEXT\ Modules,
-%D subtitle=Punk Support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright=PRAGMA]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifx\luaversion\undefined \endinput \fi
-
-% At some point the font generation code will move into the
-% ConTeXt MkIV kernel.
-
-\startluacode
-do
- local concat = table.concat
- local chardata = characters.data
- local fontdata = fonts.ids
-
- fonts.mp = fonts.mp or { }
-
- fonts.mp.version = fonts.mp.version or 1.11
- fonts.mp.inline = true
- fonts.mp.cache = containers.define("fonts", "mp", fonts.mp.version, true)
-
- metapost.characters = metapost.characters or { }
-
--- todo: use table share as in otf
-
- local characters, descriptions = { }, { }
- local factor, l, n, w, h, d, total, variants = 100, { }, 0, 0, 0, 0, 0, 0, true
-
- -- A next version of mplib will provide the tfm font information which
- -- gives better glyph dimensions, plus additional kerning information.
-
- local flusher = {
- startfigure = function(chrnum,llx,lly,urx,ury)
- l, n = { }, chrnum
- w, h, d = urx - llx, ury, -lly
- total = total + 1
- inline = fonts.mp.inline
- end,
- flushfigure = function(t)
- for i=1, #t do
- l[#l+1] = t[i]
- end
- end,
- stopfigure = function()
- local cd = chardata[n]
- if inline then
- descriptions[n] = {
- -- unicode = n,
- name = cd and cd.adobename,
- width = w*100,
- height = h*100,
- depth = d*100,
- boundingbox = { 0, -d, w, h },
- }
- characters[n] = {
- commands = { -- todo: xforms, should happen in backend
- { "special", "pdf: " .. concat(l," ") },
- }
- }
- else
- descriptions[n] = {
- -- unicode = n,
- name = cd and cd.adobename,
- width = w*100,
- height = h*100,
- depth = d*100,
- boundingbox = { 0, -d, w, h },
- }
- characters[n] = {
- commands = {
- { "image", { stream = concat(l," "), bbox = { 0, -d*65536, w*65536, h*65536 } } },
- }
- }
- end
- end
- }
-
- metapost.characters.instances = metapost.characters.instances or 10
-
- function metapost.characters.process(mpxformat, name, instances, scalefactor)
- statistics.starttiming(metapost.characters)
- scalefactor = scalefactor or 1
- instances = instances or metapost.characters.instances or 10
- local fontname = file.removesuffix(file.basename(name))
- local hash = file.robustname(string.format("%s %05i %03i", fontname, scalefactor*1000, instances))
- local lists = containers.read(fonts.mp.cache(), hash)
- if not lists then
- statistics.starttiming(flusher)
- -- we can use a format per font
- local data = io.loaddata(resolvers.find_file(name))
- metapost.reset(mpxformat)
- metapost.set_outer_color(2) -- no outer color and no reset either
- lists = { }
- for i=1,instances do
- list = { }
- characters, descriptions = { }, { }
- metapost.process(
- mpxformat,
- {
- "randomseed := " .. i*10 .. ";",
- "scale_factor := " .. scalefactor .. " ;",
- data
- },
- false,
- flusher
- )
- lists[i] = {
- designsize = 655360,
- name = string.format("%s-%03i",hash,i),
- parameters = {
- slant = 0,
- space = 333 * scalefactor,
- space_stretch = 166.5 * scalefactor,
- space_shrink = 111 * scalefactor,
- x_height = 431 * scalefactor,
- quad =1000 * scalefactor,
- extra_space = 0
- },
- ["type"] = "virtual",
- characters = characters,
- descriptions = descriptions,
- -- embedding = "subset",
- -- mkiv:
- spacer = "space",
- unit = 1000,
- shared = { },
- unique = { },
- }
- end
- metapost.reset(mpxformat) -- saves memory
- lists = containers.write(fonts.mp.cache(), hash, lists)
- statistics.stoptiming(flusher)
- end
- variants = variants + #lists
- statistics.stoptiming(metapost.characters)
- return lists
- end
-
- function fonts.vf.aux.combine.commands.metafont(g,v)
- local size = g.specification.size
- local data = metapost.characters.process(v[2],v[3],v[4],size/655360)
- local list, t = { }, { }
- for d=1,#data do
- t = data[d]
- t = fonts.tfm.scale(t, -1000)
- local id = font.nextid()
- t.fonts = { { id = id } }
- fontdata[id] = t
- fonts.vf.aux.compose_characters(t)
- list[d] = font.define(t)
- end
- for k, v in pairs(t) do
- g[k] = v -- kind of replace, when not present, make nil
- end
- g.virtualized = true
- g.variants = list
- end
-
- fonts.define.methods.install( "punk", {
- { "metafont", "mfplain", "punkfont.mp", 10 },
- } )
-
- cases.actions[99] = function(current)
- local used = fontdata[current.font].variants
- if used then
- local f = math.random(1,#used)
- current.font = used[f]
- return current, true
- else
- return current, false
- end
- end
-
- metapost.characters.flusher = flusher
-
- statistics.register("metapost font generation", function()
- local time = statistics.elapsedtime(flusher)
- if total > 0 then
- return string.format("%i glyphs, %.3f seconds runtime, %i glyphs/second", total, time, total/time)
- else
- return string.format("%i glyphs, %.3f seconds runtime", total, time)
- end
- end)
-
- statistics.register("metapost font loading",function()
- local time = statistics.elapsedtime(metapost.characters)
- if variants > 0 then
- return string.format("%.3f seconds, %i instances, %0.3f instances/second", time, variants, variants/time)
- else
- return string.format("%.3f seconds, %i instances", time, variants)
- end
- end)
-
-end
-\stopluacode
-
-\unexpanded\def\EnableRandomPunk {\setcharactercasing[99]}
-\unexpanded\def\RandomPunk {\groupedcommand\EnableRandomPunk\donothing}
-\unexpanded\def\StartRandomPunk {\begingroup\EnableRandomPunk}
-\unexpanded\def\StopRandomPunk {\endgroup}
-
-\starttypescript [serif] [punk] [default]
- \setups[font:fallback:serif] % no style variants yet
- \definefontsynonym [Serif] [demo@punk]
-\stoptypescript
-
-\starttypescript [punk]
- \definetypeface [punk] [rm] [serif] [punk] [default]
-\stoptypescript
-
-\endinput
-
-\usetypescript[punk]
-
-\setupbodyfont[punk,14pt]
-
-\starttext
- \definedfont[demo@punk at 10pt]hello world\par
- \definedfont[demo@punk at 12pt]hello world\par
- \definedfont[demo@punk at 16pt]hello world\par
- \definedfont[demo@punk at 20pt]hello world\par
-\stoptext
+% this file will disasppear but we need it as it is still in tex live
+\loadmarkfile{m-punk}
diff --git a/Master/texmf-dist/tex/context/base/m-steps.mkii b/Master/texmf-dist/tex/context/base/m-steps.mkii
new file mode 100644
index 00000000000..3e1f86312de
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-steps.mkii
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=m-steps,
+%D version=2001.05.28,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Step Charts \& Tables,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D The \XML\ interface:
+
+\unprotect
+
+\defineXMLdirective [stepchart] [charts] \setupSTEPcharts
+\defineXMLdirective [stepchart] [cells] \setupSTEPcells
+\defineXMLdirective [stepchart] [texts] \setupSTEPtexts
+\defineXMLdirective [stepchart] [lines] \setupSTEPlines
+
+\defineXMLdirective [steptable] [tables] \setupSTEPtables
+\defineXMLdirective [steptable] [cells] \setupSTEPcells
+\defineXMLdirective [steptable] [texts] \setupSTEPtexts
+\defineXMLdirective [steptable] [lines] \setupSTEPlines
+
+\defineXMLpickup[stepchart][@@STPC]
+ {\bgroup
+ \defineXMLpush[top]%
+ \defineXMLpush[bot]%
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
+ {\stoplines}%
+ \defineXMLenvironment[cells][@@STEC]
+ {\XMLerase{top}\XMLerase{bot}}
+ {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}%
+ \defineXMLenvironment[texts][@@STET]
+ {\XMLerase{top}\XMLerase{bot}}
+ {\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}%
+ \defineXMLenvironmentpush[cell][@@STEC]
+ {\XMLerase{cell}}
+ {\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}%
+ \defineXMLenvironmentpush [text] [@@STET]
+ {\XMLerase{text}}
+ {\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}%
+ \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}}
+ {\stopSTEPchart
+ \egroup}
+
+\defineXMLpickup[steptable][@@STPT]
+ {\bgroup
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
+ {\stoplines}%
+ \defineXMLargument[cell][@@STEC]
+ {\expanded{\cell[\theXMLarguments{@@STEC}]}}%
+ \defineXMLargument[text][@@STET]
+ {\expanded{\text[\theXMLarguments{@@STET}]}}%
+ \defineXMLargument[prep]
+ {\prep}%
+ \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}}
+ {\stopSTEPtable
+ \egroup}
+
+\defineXMLpickup[stepaligntable][@@STPT]
+ {\bgroup
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}}
+ {}%
+ \defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]%
+ \defineXMLenvironment[cells][@@STEC]
+ {\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}}
+ {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}%
+ \defineXMLargument[text][@@STET]
+ {\expanded{\text[\theXMLarguments{@@STET}]}}%
+ \defineXMLargument[prep]
+ {\prep}%
+ \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}}
+ {\stopSTEPaligntable
+ \egroup}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-steps.mkiv b/Master/texmf-dist/tex/context/base/m-steps.mkiv
new file mode 100644
index 00000000000..9bb56c53228
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-steps.mkiv
@@ -0,0 +1,20 @@
+%D \module
+%D [ file=m-steps,
+%D version=2001.05.28,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Step Charts \& Tables,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D The \XML\ interface:
+
+\unprotect
+
+\writestatus\m!systems{The steps mkiv xml interface is not yet defined!}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-steps.tex b/Master/texmf-dist/tex/context/base/m-steps.tex
index 1e2f5d97d62..1f6a374033c 100644
--- a/Master/texmf-dist/tex/context/base/m-steps.tex
+++ b/Master/texmf-dist/tex/context/base/m-steps.tex
@@ -116,18 +116,6 @@
%D ...
-\defineXMLdirective [stepchart] [charts] \setupSTEPcharts
-\defineXMLdirective [stepchart] [cells] \setupSTEPcells
-\defineXMLdirective [stepchart] [texts] \setupSTEPtexts
-\defineXMLdirective [stepchart] [lines] \setupSTEPlines
-
-\defineXMLdirective [steptable] [tables] \setupSTEPtables
-\defineXMLdirective [steptable] [cells] \setupSTEPcells
-\defineXMLdirective [steptable] [texts] \setupSTEPtexts
-\defineXMLdirective [steptable] [lines] \setupSTEPlines
-
-%D ...
-
\presetlocalframed[\@@STPF]
\def\@@stepcell#1%
@@ -664,31 +652,6 @@
\@@STELalternative, get_step_chart_bot_line(#1,#2),
\@@STELrulethickness, \MPcolor{\@@STELcolor} ) )}
-%D \XML\ coupling.
-
-\defineXMLpickup[stepchart][@@STPC]
- {\bgroup
- \defineXMLpush[top]%
- \defineXMLpush[bot]%
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
- {\stoplines}%
- \defineXMLenvironment[cells][@@STEC]
- {\XMLerase{top}\XMLerase{bot}}
- {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}%
- \defineXMLenvironment[texts][@@STET]
- {\XMLerase{top}\XMLerase{bot}}
- {\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}%
- \defineXMLenvironmentpush[cell][@@STEC]
- {\XMLerase{cell}}
- {\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}%
- \defineXMLenvironmentpush [text] [@@STET]
- {\XMLerase{text}}
- {\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}%
- \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}}
- {\stopSTEPchart
- \egroup}
-
%D Step tables are the vertical counterpart of stepcharts.
\newcounter\currentsteptable
@@ -846,38 +809,6 @@
\@@STELalternative, get_step_table_line(\cellcounter),
\@@STELrulethickness, \MPcolor{\@@STELcolor} ) )}
-\defineXMLpickup[steptable][@@STPT]
- {\bgroup
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
- {\stoplines}%
- \defineXMLargument[cell][@@STEC]
- {\expanded{\cell[\theXMLarguments{@@STEC}]}}%
- \defineXMLargument[text][@@STET]
- {\expanded{\text[\theXMLarguments{@@STET}]}}%
- \defineXMLargument[prep]
- {\prep}%
- \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}}
- {\stopSTEPtable
- \egroup}
-
-\defineXMLpickup[stepaligntable][@@STPT]
- {\bgroup
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}}
- {}%
- \defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]%
- \defineXMLenvironment[cells][@@STEC]
- {\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}}
- {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}%
- \defineXMLargument[text][@@STET]
- {\expanded{\text[\theXMLarguments{@@STET}]}}%
- \defineXMLargument[prep]
- {\prep}%
- \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}}
- {\stopSTEPaligntable
- \egroup}
-
\protect \endinput
% A simple paragraph-flow test:
diff --git a/Master/texmf-dist/tex/context/base/m-timing.tex b/Master/texmf-dist/tex/context/base/m-timing.tex
index f6b0348c808..f02a900871b 100644
--- a/Master/texmf-dist/tex/context/base/m-timing.tex
+++ b/Master/texmf-dist/tex/context/base/m-timing.tex
@@ -36,7 +36,7 @@
\ctxloadluafile{trac-tim}{}
\startluacode
-local progress = goodies.progress
+local progress = plugins.progress
function progress.show(filename,parameters,nodes,other)
for n, name in pairs(parameters or progress.parameters(filename)) do
@@ -51,16 +51,16 @@ end
% \everyfirstshipout
\startnotmode[no-timing]
- \appendtoks\ctxlua{goodies.progress.store()}\to\everystarttext
- \appendtoks\ctxlua{goodies.progress.store()}\to\everyshipout
- \ctxlua{main.register_stop_actions(function() goodies.progress.save() end)}
+ \appendtoks\ctxlua{plugins.progress.store()}\to\everystarttext
+ \appendtoks\ctxlua{plugins.progress.store()}\to\everyshipout
+ \ctxlua{main.register_stop_actions(function() plugins.progress.save() end)}
\stopnotmode
\def\ShowNamedUsage#1#2#3%
{\setbox\scratchbox\vbox\bgroup\startMPcode
begingroup ; save p, q, b, h, w ;
path p, q, b ; numeric h, w ;
- p := \ctxlua{tex.sprint(goodies.progress.path("#1","#2"))} ;
+ p := \ctxlua{tex.sprint(plugins.progress.path("#1","#2"))} ;
% p := p shifted -llcorner p ;
if bbwidth(p) > 1 :
h := 100 ; w := 2 * h ;
@@ -71,7 +71,7 @@ end
draw b withcolor \MPcolor{usage:frame} ;
draw p withcolor \MPcolor{usage:line} ;
if ("#3" <> "") and ("#3" <> "#2") :
- q := \ctxlua{tex.sprint(goodies.progress.path("#1","#3"))} ;
+ q := \ctxlua{tex.sprint(plugins.progress.path("#1","#3"))} ;
% q := q shifted -llcorner q ;
if bbwidth(q) > 1 :
q := q xstretched w ;
@@ -87,16 +87,16 @@ end
\startlinecorrection
\box\scratchbox \endgraf
\hbox to \scratchdimen{\tttf\strut\detokenize{#2}\hss
- min:\ctxlua{tex.sprint(goodies.progress.bot("#1","\detokenize{#2}"))}, %
- max:\ctxlua{tex.sprint(goodies.progress.top("#1","\detokenize{#2}"))}, %
- pages:\ctxlua{tex.sprint(goodies.progress.pages("#1"))}%
+ min:\ctxlua{tex.sprint(plugins.progress.bot("#1","\detokenize{#2}"))}, %
+ max:\ctxlua{tex.sprint(plugins.progress.top("#1","\detokenize{#2}"))}, %
+ pages:\ctxlua{tex.sprint(plugins.progress.pages("#1"))}%
}%
\stoplinecorrection
\fi}
-\def\LoadUsage #1{\ctxlua{goodies.progress.convert("#1")}}
-\def\ShowUsage #1{\ctxlua{goodies.progress.show("#1",nil,nil,"elapsed_time")}}
-\def\ShowMemoryUsage#1{\ctxlua{goodies.progress.show("#1",nil,{}, "elapsed_time")}}
-\def\ShowNodeUsage #1{\ctxlua{goodies.progress.show("#1",{},nil, "elapsed_time")}}
+\def\LoadUsage #1{\ctxlua{plugins.progress.convert("#1")}}
+\def\ShowUsage #1{\ctxlua{plugins.progress.show("#1",nil,nil,"elapsed_time")}}
+\def\ShowMemoryUsage#1{\ctxlua{plugins.progress.show("#1",nil,{}, "elapsed_time")}}
+\def\ShowNodeUsage #1{\ctxlua{plugins.progress.show("#1",{},nil, "elapsed_time")}}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/m-track.tex b/Master/texmf-dist/tex/context/base/m-trackers.tex
index cfcbbabffbe..cfcbbabffbe 100644
--- a/Master/texmf-dist/tex/context/base/m-track.tex
+++ b/Master/texmf-dist/tex/context/base/m-trackers.tex
diff --git a/Master/texmf-dist/tex/context/base/m-translate.tex b/Master/texmf-dist/tex/context/base/m-translate.tex
index a9601bdd587..9c550eca705 100644
--- a/Master/texmf-dist/tex/context/base/m-translate.tex
+++ b/Master/texmf-dist/tex/context/base/m-translate.tex
@@ -44,14 +44,14 @@
end
function translators.reset(s)
- resolvers.filters.user_translator = nil
+ resolvers.install_text_filter("user",nil)
list, compiled = nil, nil
end
function translators.enable(s)
- resolvers.filters.user_translator = translators.translate
+ resolvers.install_text_filter("user",translators.translate)
end
function translators.disable(s)
- resolvers.filters.user_translator = nil
+ resolvers.install_text_filter("user",nil)
end
\stopluacode
diff --git a/Master/texmf-dist/tex/context/base/math-ali.mkiv b/Master/texmf-dist/tex/context/base/math-ali.mkiv
index f98eb11dfed..31f71219a44 100644
--- a/Master/texmf-dist/tex/context/base/math-ali.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-ali.mkiv
@@ -19,7 +19,7 @@
%D \MKIV\ code is not gathered in files with the same name.
%D \macros
-%D {\definemathalignment, setupmathalignment, startmathalignment}
+%D {definemathalignment, setupmathalignment, startmathalignment}
%D
%D Modules may provide additional alignment features. The following
%D mechanisms are provided by the core.
@@ -153,7 +153,7 @@
%D Here we implement the user interface part.
-\def\setupmathalignment
+\unexpanded\def\setupmathalignment
{\dodoubleempty\dosetupmathalignment}
\def\dosetupmathalignment[#1][#2]%
@@ -240,7 +240,7 @@
{\finishalignno
\popmacro\doalignNC}
-\def\definemathalignment
+\unexpanded\def\definemathalignment
{\dodoubleempty\dodefinemathalignment}
\def\dodefinemathalignment[#1]% [#2]%
@@ -440,7 +440,7 @@
%D
%D Another wish \unknown
-\def\setupmathcases
+\unexpanded\def\setupmathcases
{\dodoubleempty\dosetupmathcases}
\def\dosetupmathcases[#1][#2]%
@@ -500,7 +500,7 @@
\mathcasesparameter\c!right
\endgroup}
-\def\definemathcases
+\unexpanded\def\definemathcases
{\dodoubleempty\dodefinemathcases}
\def\dodefinemathcases[#1]% [#2]%
@@ -556,7 +556,7 @@
%D
%D Yet another one \unknown
-\def\setupmathmatrix
+\unexpanded\def\setupmathmatrix
{\dodoubleempty\dosetupmathmatrix}
\def\dosetupmathmatrix[#1][#2]%
@@ -606,18 +606,18 @@
\buildmathmatrix
\halign \@EA \bgroup\the\scratchtoks \crcr}
-\def\definemathmatrix
+\unexpanded\def\definemathmatrix
{\dodoubleempty\dodefinemathmatrix}
\def\dodefinemathmatrix[#1]% [#2]%
- {\setvalue{\e!start#1}{\dodoubleempty\dostartmathmatrix[#1]}%
- \setvalue{\e!stop #1}{\dostopmathmatrix}%
+ {\setuvalue{\e!start#1}{\dodoubleempty\dostartmathmatrix[#1]}%
+ \setuvalue{\e!stop #1}{\dostopmathmatrix}%
\setupmathmatrix[#1]}% [#2]
\definemathmatrix[matrix]
\definemathmatrix[\v!mathmatrix]
-\def\dodomatrixNC
+\unexpanded\def\dodomatrixNC
{\gdef\domatrixNC{\endmath&}}
\def\installmathmatrixhandler#1#2%
@@ -806,11 +806,11 @@
%D
%D Just a handy keystroke safer:
-\def\startmatrices
+\unexpanded\def\startmatrices
{\begingroup
\setupmathmatrix}
-\def\stopmatrices
+\unexpanded\def\stopmatrices
{\endgroup}
%D \startbuffer
@@ -849,7 +849,7 @@
%D \stopformula
%D \stopbuffer
%D
-%D \typebuffer \getbuffer
+%D \typebuffer % does not run well: \getbuffer
%D \macros
%D {startintertext}
@@ -858,7 +858,7 @@
%D
%D {\em example code}
-\def\startintertext#1\stopintertext
+\unexpanded\def\startintertext#1\stopintertext
{\noalign{\dointertext{#1}}}
\def\intertext#1%
@@ -888,7 +888,7 @@
% %D \stopformula
% %D \stoptyping
-% \def\startsubstack
+% \unexpanded\def\startsubstack
% {\begingroup
% \null
% \vcenter\bgroup
@@ -905,7 +905,7 @@
% \everycr\emptytoks
% \halign\bgroup\hfil$\scriptstyle\mathstrut##$\hfil\crcr}
-% \def\stopsubstack
+% \unexpanded\def\stopsubstack
% {\crcr
% \egroup
% \popmacro\domatrixNC
@@ -940,9 +940,11 @@
%D \text{ and }
%D \sum_{\scriptstyle a \atop \scriptstyle}
%D \stopformula
+%D \stopbuffer
+%D
%D \typebuffer which gives \getbuffer
-\def\startsubstack
+\unexpanded\def\startsubstack
{\begingroup
\vcenter\bgroup
\baselineskip\mathstacktotal
@@ -960,7 +962,7 @@
\everycr\emptytoks
\halign\bgroup\hfil$\scriptstyle##$\hfil\crcr}
-\def\stopsubstack
+\unexpanded\def\stopsubstack
{\crcr
\egroup
\egroup
@@ -1042,6 +1044,241 @@
{\preparebinrel{#2}%
\currentbinrel{\mathop{\kern\zeropoint#2}\limits_{#1}}}
+%D The following code comes from \type {math-str.mkiv}.
+
+%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.
+
+\unexpanded\def\startinnermath
+ {\getvalue{\e!start\??fm\formulaparameter\c!align}}
+
+\unexpanded\def\stopinnermath
+ {\getvalue{\e!stop \??fm\formulaparameter\c!align}}
+
+\def\mathinnerstrut
+ {\doif{\formulaparameter\c!strut}\v!yes\strut}
+
+\long\unexpanded\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
+
+\unexpanded\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}
+
+\unexpanded\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}
+
\protect \endinput
% \placeformula \startformula[-] \startmatrix
diff --git a/Master/texmf-dist/tex/context/base/math-arr.mkiv b/Master/texmf-dist/tex/context/base/math-arr.mkiv
index 5c6cfc29445..389112b1694 100644
--- a/Master/texmf-dist/tex/context/base/math-arr.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-arr.mkiv
@@ -202,7 +202,7 @@
%D \NC \tex{xrightleftharpoons } \NC \xrightleftharpoons [big] \NC \NR
%D \stoptable}
-\def\definematharrow
+\unexpanded\def\definematharrow
{\doquadrupleargument\dodefinematharrow}
\def\dodefinematharrow[#1][#2][#3][#4]% name type[none|both] template command
@@ -217,13 +217,13 @@
\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]{\setuvalue{#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]}}
+ {\setuvalue{#1}{\dohandlemtharrow[#2][#3]}}
\def\dohandlemtharrow
{\dotripleempty\doxmtharrow}
@@ -281,34 +281,34 @@
%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}}
+\unexpanded\def\specrightarrowfill {\defaultmtharrowfill \relbar \relbar \rightarrow}
+\unexpanded\def\specleftarrowfill {\defaultmtharrowfill \leftarrow \relbar \relbar}
+
+\unexpanded\def\rightarrowfill {\specrightarrowfill \textstyle}
+\unexpanded\def\leftarrowfill {\specleftarrowfill \textstyle}
+
+\unexpanded\def\equalfill {\defaultmtharrowfill \Relbar \Relbar \Relbar}
+\unexpanded\def\Rightarrowfill {\defaultmtharrowfill \Relbar \Relbar \Rightarrow}
+\unexpanded\def\Leftarrowfill {\defaultmtharrowfill \Leftarrow \Relbar \Relbar}
+\unexpanded\def\Leftrightarrowfill {\defaultmtharrowfill \Leftarrow \Relbar \Rightarrow}
+\unexpanded\def\leftrightarrowfill {\defaultmtharrowfill \leftarrow \relbar \rightarrow}
+\unexpanded\def\mapstofill {\defaultmtharrowfill{\mapstochar\relbar} \relbar \rightarrow}
+\unexpanded\def\twoheadrightarrowfill{\defaultmtharrowfill \relbar \relbar \twoheadrightarrow}
+\unexpanded\def\twoheadleftarrowfill {\defaultmtharrowfill \twoheadleftarrow \relbar \relbar}
+\unexpanded\def\rightharpoondownfill {\defaultmtharrowfill \relbar \relbar \rightharpoondown}
+\unexpanded\def\rightharpoonupfill {\defaultmtharrowfill \relbar \relbar \rightharpoonup}
+\unexpanded\def\leftharpoondownfill {\defaultmtharrowfill \leftharpoondown \relbar \relbar}
+\unexpanded\def\leftharpoonupfill {\defaultmtharrowfill \leftharpoonup \relbar \relbar}
+\unexpanded\def\hookleftfill {\defaultmtharrowfill \leftarrow \relbar{\relbar\joinrel\rhook}}
+\unexpanded\def\hookrightfill {\defaultmtharrowfill{\lhook\joinrel\relbar}\relbar \rightarrow}
+\unexpanded\def\relfill {\defaultmtharrowfill \relbar \relbar \relbar}
+
+\unexpanded\def\triplerelbar {\mathrel\equiv}
+\unexpanded\def\triplerelfill{\defaultmtharrowfill\triplerelbar\triplerelbar\triplerelbar}
+
+\unexpanded\def\singlebond{{\xrel}} % or \def\singlebond{{\xrel[2]}}
+\unexpanded\def\doublebond{{\xequal}}
+\unexpanded\def\triplebond{{\xtriplerel}}
%D Now we define most commonly used arrows. These include arrows
%D defined in \filename{amsmath.sty}, \filename{extarrows.sty},
@@ -358,14 +358,14 @@
%D These macros for define math-overarrows are adapted from
%D \filename{amsmath.sty}
-\def\definemathoverarrow
+\unexpanded\def\definemathoverarrow
{\dotripleargument\dodefinemathoverarrow}
\def\dodefinemathoverarrow[#1][#2][#3]%
{\ifthirdargument
- \setvalue{#1}{\dohandlemathoverarrow[#2][#3]}%
+ \setuvalue{#1}{\dohandlemathoverarrow[#2][#3]}%
\else
- \setvalue{#1}{\dohandlemathoverarrow[\zeropoint][#2]}%
+ \setuvalue{#1}{\dohandlemathoverarrow[\zeropoint][#2]}%
\fi}
\def\dohandlemathoverarrow[#1][#2]%
@@ -383,16 +383,16 @@
%D Now the under arrows
-\def\definemathunderarrow
+\unexpanded\def\definemathunderarrow
{\dotripleargument\dodefinemathunderarrow}
%D For underarrows the default kern is 0.3ex
\def\dodefinemathunderarrow[#1][#2][#3]%
{\ifthirdargument
- \setvalue{#1}{\dohandlemathunderarrow[#2][#3]}%
+ \setuvalue{#1}{\dohandlemathunderarrow[#2][#3]}%
\else
- \setvalue{#1}{\dohandlemathunderarrow[0.3ex][#2]}%
+ \setuvalue{#1}{\dohandlemathunderarrow[0.3ex][#2]}%
\fi}
\def\dohandlemathunderarrow[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/math-def.mkiv b/Master/texmf-dist/tex/context/base/math-def.mkiv
index ad5e40672f2..50c9902dde8 100644
--- a/Master/texmf-dist/tex/context/base/math-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-def.mkiv
@@ -39,9 +39,9 @@
\doifelse{\mathematicsparameter\v!autopunctuation}\v!yes\enablemathpunctuation\disablemathpunctuation
\to \everysetupmathematics
-\appendtoks
- \ifconditional\automathpunctuation\dosetattribute{mathpunc}\plusone\fi
-\to \everymathematics
+% \appendtoks
+% \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi
+% \to \everymathematics
\setupmathematics[\v!autopunctuation=\v!yes]
@@ -59,43 +59,43 @@
% The \mfunction macro is an alternative for \hbox with a
% controlable font switch.
-\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}}
+\definemathcommand [arccos] [nolop] {\mfunctionlabeltext{arccos}}
+\definemathcommand [arcsin] [nolop] {\mfunctionlabeltext{arcsin}}
+\definemathcommand [arctan] [nolop] {\mfunctionlabeltext{arctan}}
+\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 [integers] {{\mathblackboard Z}}
\definemathcommand [reals] {{\mathblackboard R}}
@@ -104,14 +104,46 @@
\definemathcommand [complexes] {{\mathblackboard C}}
\definemathcommand [primes] {{\mathblackboard P}}
-% using attributes
+\let\normalmatharg\arg % todo: maybe automatically
-\def\choosemathbig#1#2{\dosetattribute{mathsize}{#1}\left#2\right.\doresetattribute{mathsize}}
+% using attributes
-\definemathcommand [big] {\choosemathbig\plusone }
-\definemathcommand [Big] {\choosemathbig\plustwo }
-\definemathcommand [bigg] {\choosemathbig\plusthree}
-\definemathcommand [Bigg] {\choosemathbig\plusfour }
+\chardef\bigmathdelimitermethod\plusone
+
+\def\plainbigdelimiters % traditional method
+ {\chardef\bigmathdelimitermethod\plustwo}
+
+\def\doplainbigmath#1#2%
+ {{\hbox{$%
+ \nulldelimiterspace\zeropoint\relax
+ \mathsurround\zeropoint
+ $}}}
+
+\def\doleftbigmath #1{\ifx#1\relax\else\left#1\expandafter\doleftbigmath \fi}
+\def\dorightbigmath#1{\ifx#1\relax\else\right.\expandafter\dorightbigmath\fi}
+
+\def\choosemathbig#1#2% so we accent \big{||} as well
+ {{\hbox{$%
+ \ifcase\bigmathdelimitermethod
+ \doleftbigmath#2\relax
+ \dorightbigmath#2\relax
+ \or
+ \attribute\mathsizeattribute#1\relax
+ \doleftbigmath#2\relax
+ \dorightbigmath#2\relax
+ \else
+ \doleftbigmath#2\relax
+ \vbox\!!to\getvalue{\??mm:b:\number#1}\bodyfontsize{}%
+ \dorightbigmath#2\relax
+ \fi
+ \nulldelimiterspace\zeropoint\relax
+ \mathsurround\zeropoint
+ $}}}
+
+\definemathcommand [big] {\choosemathbig\plusone } \setvalue{\??mm:b:1}{0.85}
+\definemathcommand [Big] {\choosemathbig\plustwo } \setvalue{\??mm:b:2}{1.15}
+\definemathcommand [bigg] {\choosemathbig\plusthree} \setvalue{\??mm:b:3}{1.45}
+\definemathcommand [Bigg] {\choosemathbig\plusfour } \setvalue{\??mm:b:4}{1.75}
\definemathcommand [bigl] [open] [one] {\big}
\definemathcommand [bigm] [rel] [one] {\big}
@@ -324,6 +356,10 @@
\unexpanded\def\underrightarrow{\mathopwithlimits\normalunderrightarrow}
\unexpanded\def\overrightarrow {\mathopwithlimits\normaloverrightarrow }
+\let\normalsurd\surd
+
+\unexpanded\def\surd{\normalsurd{}}
+
% todo mathclass=punctuation ord
% \Umathcode"02C="6 "0 "02C
diff --git a/Master/texmf-dist/tex/context/base/math-dim.lua b/Master/texmf-dist/tex/context/base/math-dim.lua
index a536f03098e..62d805126f8 100644
--- a/Master/texmf-dist/tex/context/base/math-dim.lua
+++ b/Master/texmf-dist/tex/context/base/math-dim.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-dim'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
@@ -21,9 +21,9 @@ local defaults = {
['default']={ "AccentBaseHeight", "x_height" },
},
['fraction_del_size']={
- ['default']={ "0", "delim2" },
- ['cramped_display_style']={ "0", "delim1" },
- ['display_style']={ "0", "delim1" },
+ ['default']={ "FractionDelimiterSize", "delim2" },
+ ['cramped_display_style']={ "FractionDelimiterDisplayStyleSize", "delim1" },
+ ['display_style']={ "FractionDelimiterDisplayStyleSize", "delim1" },
},
['fraction_denom_down']={
['default']={ "FractionDenominatorShiftDown", "denom2" },
@@ -118,7 +118,7 @@ local defaults = {
['default']={ "SubscriptBaselineDropMin", "sub_drop" },
},
['sub_sup_shift_down']={
- ['default']={ "SubscriptShiftDown", "sub2" },
+ ['default']={ "SubscriptShiftDown", "sub2" }, -- todo
},
['sub_top_max']={
['default']={ "SubscriptTopMax", "abs(math_x_height*4)/5" },
@@ -204,12 +204,12 @@ end
-- local mt = { } setmetatable(defaults,mt)
--
-- mt.__index = function(t,s)
--- texio.write_nl("GETTING " .. s)
-- return t.default or t.text_style or 0
-- end
function mathematics.dimensions(dimens)
if dimens.SpaceAfterScript then
+ dimens.SubscriptShiftDownWithSuperscript = dimens.SubscriptShiftDown * 1.5
return { }, table.fastcopy(dimens)
elseif dimens.AxisHeight or dimens.axis_height then
local t = { }
@@ -249,6 +249,7 @@ function mathematics.dimensions(dimens)
end
t[variable] = tt
end
+--~ logs.report("warning", "version 0.47 is needed for proper delimited math")
local d = {
AxisHeight = t . axis . text_style,
AccentBaseHeight = t . accent_base_height . text_style,
@@ -261,6 +262,8 @@ function mathematics.dimensions(dimens)
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,
OverbarExtraAscender = t . overbar_kern . text_style,
@@ -282,6 +285,7 @@ function mathematics.dimensions(dimens)
StackTopShiftUp = t . stack_num_up . 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,
SubSuperscriptGapMin = t . subsup_vgap . text_style,
SuperscriptBaselineDropMax = t . sup_shift_drop . text_style,
@@ -301,7 +305,6 @@ function mathematics.dimensions(dimens)
StretchStackBottomShiftDown = t . under_delimiter_bgap . text_style,
}
d.AccentBaseHeight = 0
- -- texio.write_nl(table.serialize(d))
return t, d -- this might change
else
return { }, { }
diff --git a/Master/texmf-dist/tex/context/base/math-ent.lua b/Master/texmf-dist/tex/context/base/math-ent.lua
index d1e1865a44f..e5e5b98f004 100644
--- a/Master/texmf-dist/tex/context/base/math-ent.lua
+++ b/Master/texmf-dist/tex/context/base/math-ent.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-ent'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ comment = "companion to math-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "derived from the mathml 2.0 specification",
}
diff --git a/Master/texmf-dist/tex/context/base/math-ext.lua b/Master/texmf-dist/tex/context/base/math-ext.lua
index 52dce02554c..673103677e0 100644
--- a/Master/texmf-dist/tex/context/base/math-ext.lua
+++ b/Master/texmf-dist/tex/context/base/math-ext.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-ext'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
@@ -100,19 +100,31 @@ mathematics.extras.add(0xFE303, {
-- 0xFE321 -- 0xFE340 for missing characters
--- mathematics.extras.add(0xFE321, {
--- category="sm",
--- description="SHORT BAR",
--- -- direction="on",
--- -- linebreak="nu",
--- mathclass="relation",
--- mathname="mapstochar",
--- unicodeslot=0xFE321,
--- } )
-
-
+mathematics.extras.add(0xFE321, {
+ category="sm",
+ description="MATHEMATICAL SHORT BAR",
+-- direction="on",
+-- linebreak="nu",
+ mathclass="relation",
+ mathname="mapstochar",
+ unicodeslot=0xFE321,
+} )
+mathematics.extras.add(0xFE322, {
+ category="sm",
+ description="MATHEMATICAL LEFT HOOK",
+ mathclass="relation",
+ mathname="lhook",
+ unicodeslot=0xFE322,
+} )
+mathematics.extras.add(0xFE323, {
+ category="sm",
+ description="MATHEMATICAL RIGHT HOOK",
+ mathclass="relation",
+ mathname="rhook",
+ unicodeslot=0xFE323,
+} )
--~ mathematics.extras.add(0xFE304, {
--~ category="sm",
@@ -140,4 +152,3 @@ mathematics.extras.add(0xFE303, {
--~ \Umathchardef\bracerd="0 "1 "FF07B
--~ \Umathchardef\bracelu="0 "1 "FF07C
--~ \Umathchardef\braceru="0 "1 "FF07D
-
diff --git a/Master/texmf-dist/tex/context/base/math-for.mkiv b/Master/texmf-dist/tex/context/base/math-for.mkiv
index 87aeaa4e05f..e33276d5385 100644
--- a/Master/texmf-dist/tex/context/base/math-for.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-for.mkiv
@@ -37,21 +37,27 @@
\ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi
\ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi}
+\def\getformulaparameters{\getparameters[\??fm]}
+
%D \macros
%D {setupformulas}
\newtoks \everysetupformulas
-\def\setupformulas
+\unexpanded\def\setupformulas
{\dodoubleempty\dosetupformulas}
\def\dosetupformulas[#1][#2]%
{\ifsecondargument
+ \edef\currentformula{#1}%
\getparameters[\??fm#1][#2]%
\else
+% \let\currentformula\v!formula % hm
+ \let\currentformula\empty
\getparameters[\??fm][#1]%
\fi
- \the\everysetupformulas}
+ \the\everysetupformulas
+ \let\currentformula\empty}
%D Not yet cleanup up:
@@ -63,7 +69,7 @@
\newtoks \everysetuptextformulas
-\def\setuptextformulas
+\unexpanded\def\setuptextformulas
{\dosingleempty\dosetuptextformulas}
\def\dosetuptextformulas[#1]%
diff --git a/Master/texmf-dist/tex/context/base/math-ini.lua b/Master/texmf-dist/tex/context/base/math-ini.lua
index 5a688941013..63d7cad3852 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.lua
+++ b/Master/texmf-dist/tex/context/base/math-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-ext'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
@@ -68,6 +68,7 @@ classes.variable = classes.alphabetic
classes.number = classes.alphabetic
-- 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 delcode(target,family,slot)
return format('\\Udelcode%s="%X "%X ',target,family,slot)
@@ -273,7 +274,7 @@ mathematics.entities = mathematics.entities or { }
function mathematics.register_xml_entities()
local entities = xml.entities
- for name, unicode in pairs(mathematics.entities) do
+ for name, unicode in next, mathematics.entities do
if not entities[name] then
entities[name] = utfchar(unicode)
end
@@ -286,13 +287,24 @@ function mathematics.big(tfmdata,unicode,n)
local t = tfmdata.characters
local c = t[unicode]
if c then
- local next = c.next
- while next do
- if n <= 1 then
- return next
- else
- n = n - 1
- next = t[next].next
+ local vv = c.vert_variants or c.next and t[c.next].vert_variants
+ if vv then
+ local vvn = vv[n]
+ return vvn and vvn.glyph or vv[#vv].glyph or unicode
+ else
+ 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
end
end
@@ -301,16 +313,24 @@ end
-- plugins
-function mathematics.scaleparameters(t,tfmtable,delta)
+local hvars = table.tohash {
+ --~ "RadicalKernBeforeDegree",
+ --~ "RadicalKernAfterDegree",
+}
+
+function mathematics.scaleparameters(t,tfmtable,delta,hdelta,vdelta)
local math_parameters = tfmtable.math_parameters
if math_parameters and next(math_parameters) then
delta = delta or 1
+ hdelta, vdelta = hdelta or delta, vdelta or delta
local _, mp = mathematics.dimensions(math_parameters)
for name, value in next, mp do
- if name ~= "RadicalDegreeBottomRaisePercent" then
- mp[name] = delta*value
- else
+ if name == "RadicalDegreeBottomRaisePercent" then
mp[name] = value
+ elseif hvars[name] then
+ mp[name] = hdelta * value
+ else
+ mp[name] = vdelta * value
end
end
t.MathConstants = mp
diff --git a/Master/texmf-dist/tex/context/base/math-ini.mkii b/Master/texmf-dist/tex/context/base/math-ini.mkii
index 6713987f7f9..f9dd859c412 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/math-ini.mkii
@@ -451,7 +451,10 @@
\newtoks\everymathpunctuation
\def\enablemathpunctuation % can be called inside math, so after \everymathematics
- {\the\everymathpunctuation
+ {\relax
+ \ifmmode
+ \the\everymathpunctuation
+ \fi
\appendtoksonce
\the\everymathpunctuation
\to\everymathematics}
diff --git a/Master/texmf-dist/tex/context/base/math-ini.mkiv b/Master/texmf-dist/tex/context/base/math-ini.mkiv
index cb5a6344019..828a6eccbf4 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-ini.mkiv
@@ -29,6 +29,11 @@
\ifx\v!compact\undefined \def\v!compact{compact} \fi
+%D New:
+
+\let\startimath\Ustartmath \let\stopimath \Ustopmath
+\let\startdmath\Ustartdisplaymath \let\stopdmath \Ustopmath
+
%D We move these definitions into the format:
% test [[\char948 \ctxlua{tex.sprint(utf.char(948))}]]
@@ -42,19 +47,23 @@
\registerctxluafile{math-map}{1.001}
\registerctxluafile{math-noa}{1.001}
-\definesystemattribute[mathalph]
-\definesystemattribute[mathsize]
-\definesystemattribute[mathpunc]
+\definesystemattribute[mathalphabet] \chardef\mathalphabetattribute \dogetattributeid{mathalphabet}
+\definesystemattribute[mathsize] \chardef\mathsizeattribute \dogetattributeid{mathsize}
+\definesystemattribute[mathpunctuation] \chardef\mathpunctuationattribute \dogetattributeid{mathpunctuation}
+\definesystemattribute[mathgreek] \chardef\mathgreekattribute \dogetattributeid{mathgreek}
% todo: only in mmode
-% \def\setmathattribute#1#2{\dosetattribute{mathalph}{\ctxlua{tex.sprint(mathematics.sync_a_both (\number\dogetattribute{mathalph},"#1","#2"))}}}
-% \def\setmathalphabet #1{\dosetattribute{mathalph}{\ctxlua{tex.sprint(mathematics.sync_a_name (\number\dogetattribute{mathalph},"#1"))}}}
-% \def\setmathstyle #1{\dosetattribute{mathalph}{\ctxlua{tex.sprint(mathematics.sync_a_style(\number\dogetattribute{mathalph},"#1"))}}}
+\unexpanded\def\mathgreekupright{\attribute\mathgreekattribute11 }
+\unexpanded\def\mathgreekitalic {\attribute\mathgreekattribute22 }
+\unexpanded\def\mathgreekdefault{\attribute\mathgreekattribute\attributeunsetvalue}
+
+\let\mathgreeknormal\mathgreekupright
+\let\mathgreeknone \mathgreekdefault
-\def\setmathattribute#1#2{\ctxlua{mathematics.sync_a_both ("#1","#2")}}
-\def\setmathalphabet #1{\ctxlua{mathematics.sync_a_name ("#1")}}
-\def\setmathstyle #1{\ctxlua{mathematics.sync_a_style("#1")}}
+\def\setmathattribute#1#2{\ifmmode\ctxlua{mathematics.sync_a_both ("#1","#2")}\fi}
+\def\setmathalphabet #1{\ifmmode\ctxlua{mathematics.sync_a_name ("#1")}\fi}
+\def\setmathstyle #1{\ifmmode\ctxlua{mathematics.sync_a_style("#1")}\fi}
\unexpanded\def\mr {\setmathattribute{regular}{tf}}
@@ -90,32 +99,44 @@
\unexpanded\def\fraktur {\ifmmode\expandafter\mathfraktur \fi}
\unexpanded\def\gothic {\ifmmode\expandafter\mathfraktur \fi}
-\unexpanded\def\mathcal #1{{\setmathalphabet{script}#1}} % for AMS compatibility
-\unexpanded\def\mathfrak#1{{\setmathalphabet{fraktur}#1}} % for AMS compatibility
-\unexpanded\def\mathbb #1{{\setmathalphabet{blackboard}#1}} % for AMS compatibility
+\unexpanded\def\mathcal #1{{\mathscript #1}} % for AMS compatibility
+\unexpanded\def\mathfrak#1{{\mathfraktur #1}} % for AMS compatibility
+\unexpanded\def\mathbb #1{{\mathblackboard#1}} % for AMS compatibility
\let\normalmr\mr
+% \prependtoks
+% \let\mr\normalmr
+% \let\rm\mathrm \let\ss\mathss \let\tt\mathtt
+% \let\tf\mathtf \let\bf\mathbf \let\it\mathit \let\sl\mathsl \let\bi\mathbi \let\bs\mathbs
+% \let\frak\mathfraktur \let\cal\mathscript \let\bbd\mathblackboard
+% \mathdefault
+% \to \everymathematics
+
+\let\normaltf\tf \unexpanded\def\tf{\ifmmode\mathtf\else\normaltf\fi}
+\let\normalbf\bf \unexpanded\def\bf{\ifmmode\mathbf\else\normalbf\fi}
+\let\normalit\it \unexpanded\def\it{\ifmmode\mathit\else\normalit\fi}
+\let\normalsl\sl \unexpanded\def\sl{\ifmmode\mathsl\else\normalsl\fi}
+\let\normalbi\bi \unexpanded\def\bi{\ifmmode\mathbi\else\normalbi\fi}
+\let\normalbs\bs \unexpanded\def\bs{\ifmmode\mathbs\else\normalbs\fi}
+
+\let\normalrm\rm \unexpanded\def\rm{\ifmmode\mathrm\else\normalrm\fi}
+\let\normalss\ss \unexpanded\def\ss{\ifmmode\mathss\else\normalss\fi}
+\let\normaltt\tt \unexpanded\def\tt{\ifmmode\mathtt\else\normaltt\fi}
+ \unexpanded\def\mr{\ifmmode \normalmr\fi}
+
\prependtoks
- \let\mr\normalmr
- \let\rm\mathrm \let\ss\mathss \let\tt\mathtt
- \let\tf\mathtf \let\bf\mathbf \let\it\mathit \let\sl\mathsl \let\bi\mathbi \let\bs\mathbs
- \let\frak\mathfraktur \let\cal\mathscript \let\bbd\mathblackboard
+% \let\mr\normalmr
+% \let\rm\mathrm \let\ss\mathss \let\tt\mathtt
+% \let\tf\mathtf \let\bf\mathbf \let\it\mathit \let\sl\mathsl \let\bi\mathbi \let\bs\mathbs
+% \let\frak\mathfraktur \let\cal\mathscript \let\bbd\mathblackboard
\mathdefault
\to \everymathematics
%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
+%D To be done.
\let\mathboldsymbol\relax % yet unsupported, will be
@@ -145,7 +166,7 @@
\def\@@mathlimopcomm #1{\mathop{#1}} %no \limits
\def\@@mathnolopcomm #1{\mathop{#1}\nolimits}
-\def\@@mathboxcomm #1{\dontleavehmode\hbox{$\mathsurround\zeropoint#1$}}
+\def\@@mathboxcomm #1{\dontleavehmode\hbox\Ustartmath\mathsurround\zeropoint#1\Ustopmath}
\def\@@mathchoicecomm#1{[todo #1]}
\chardef\mathordcode = 0 \let\mathordcomm \mathord
@@ -181,48 +202,30 @@
% $\mathopnolimits{\kern\zeropoint d}x$
% \stoplines
-\newif\iftracemathcollection
-
% this will be sorted out:
\let\mathcharacter \getvalue
\let\textcharacter \getvalue
-\def\definefamilysynonym {\dotripleempty\dodefinefamilysynonym}
+\unexpanded\def\definefamilysynonym {\dotripleempty\dodefinefamilysynonym}
\def\dodefinefamilysynonym [#1][#2][#3]{}
-\def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol}
+\unexpanded\def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol}
\def\dodefinemathsymbol [#1][#2][#3][#4][#5][#6]{}
-\def\definemathcharacter {\dosixtupleempty\dodefinemathcharacter}
-\def\redefinemathcharacter {\dosixtupleempty\dodefinemathcharacter}
+\unexpanded\def\definemathcharacter {\dosixtupleempty\dodefinemathcharacter}
\def\dodefinemathcharacter [#1][#2][#3][#4][#5][#6]{}
-\def\startmathcollection [#1]{}
-\def\setmathcollection #1{}
-\def\stopmathcollection {}
-\def\startrawmathcollection {}
-\def\stoprawmathcollection {}
-\def\setmathtoks {}
-\let\currentmathcollection \s!default
-\let\nomathcollection \s!default
-\let\mathcollection \s!default
-\def\enablemathcollection [#1]{}
-\def\usemathcollection {\dodoubleempty\dousemathcollection}
-\def\dousemathcollection [#1][#2]{}
-\let\mathclass \nomathcollection
-\let\autoenablemathcollection\relax
-\def\resetmathcollection [#1]{}
-
-\def\definemathcommand
+
+\unexpanded\def\definemathcommand
{\dotripleempty\dodefinemathcommand}
\def\dodefinemathcommand[#1][#2][#3]#4% command class args meaning
{\ifthirdargument
\processaction
[#3]
- [one=>\unexpanded\setvalue{#1}##1{\puremathcomm{#2}{#4{##1}}},
- two=>\unexpanded\setvalue{#1}##1##2{\puremathcomm{#2}{#4{##1}{##2}}}]%
+ [one=>\setuvalue{#1}##1{\puremathcomm{#2}{#4{##1}}},
+ two=>\setuvalue{#1}##1##2{\puremathcomm{#2}{#4{##1}{##2}}}]%
\else\ifsecondargument
- \unexpanded\setvalue{#1}{\puremathcomm{#2}{#4}}%
+ \setuvalue{#1}{\puremathcomm{#2}{#4}}%
\else
- \unexpanded\setvalue{#1}{\puremathcomm{nothing}{#4}}%
+ \setuvalue{#1}{\puremathcomm{nothing}{#4}}%
\fi\fi}
%D Moved from font-ini.mkiv:
@@ -258,7 +261,10 @@
%D needed for sin, cos etc
-\def\mfunction#1{{\mr#1}}
+\let\mathfunction\firstofoneargument
+
+\def\mfunction #1{{\mr#1}}
+\def\mfunctionlabeltext#1{{\mr\mathlabeltext{#1}}}
% \def\mlimitsfunction #1{\mathlimopcomm{{\mr#1}}
% \def\mnolimitsfunction#1{\mathnolopcomm{{\mr#1}}
@@ -268,11 +274,16 @@
\def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
-\def\setmathfunctionstyle#1% rm ss tt
+\unexpanded\def\do@mathopnolimits #1{\mathop{\mscaledtext{#1}}\nolimits}
+\unexpanded\def\do@mfunction #1{\mscaledtext{#1}}
+\unexpanded\def\do@mfunctionlabeltext#1{\mscaledtext{\mathlabeltext{#1}}}
+
+\def\setmathfunctionstyle#1% rm ss tt (can be made faster if needed)
{\doifsomething{#1}
{\def\currentmscaledstyle{#1}%
- \def\mathopnolimits##1{\mathop{\mscaledtext{##1}}\nolimits}%
- \def\mfunction##1{\mscaledtext{##1}}}}
+ \let\mathopnolimits \do@mathopnolimits
+ \let\mfunction \do@mfunction
+ \let\mfunctionlabeltext\do@mfunctionlabeltext}}
\def\mscaledtext#1%
{\mathchoice
@@ -291,9 +302,11 @@
%D
%D This hooks into the math handler with:
-\appendtoks
- \setmathfunctionstyle\currentmathtextstyle
-\to \everybodyfont
+% no longer supported this way, has to be done with \setupmathematics
+%
+% \appendtoks
+% \setmathfunctionstyle\currentmathtextstyle
+% \to \everybodyfont
%D Usage:
%D
@@ -337,15 +350,18 @@
\ifdefined\normalsuber\else \def\normalsuber{_} \fi
\ifdefined\normalsuper\else \def\normalsuper{^} \fi
+\ifdefined\normalaltab\else \def\normalaltab{&} \fi
\bgroup
\catcode`_=\active
\catcode`^=\active
+ \catcode`&=\active
\global \everynonknuthmode {\appendtoks
\let_\normalsuber
\let^\normalsuper
+ \let&\normalaltab
\to \everymathematics}
\egroup
@@ -353,19 +369,23 @@
\appendtoks
\mathcode`_="8000
\mathcode`^="8000
+ \mathcode`&="8000
\catcode`_=\@@other
\catcode`^=\@@other
+ \catcode`&=\@@other
\to \everynonknuthmode
\appendtoks
\catcode`_=\@@subscript
\catcode`^=\@@superscript
+ \catcode`&=\@@alignment
\to \everydonknuthmode
\appendtoks
\startextendcatcodetable\ctxcatcodes
\catcode`_=\@@other
\catcode`^=\@@other
+ \catcode`&=\@@other
\stopextendcatcodetable
\to \everynonknuthmode
@@ -373,6 +393,7 @@
\startextendcatcodetable\ctxcatcodes
\catcode`_=\@@subscript
\catcode`^=\@@superscript
+ \catcode`&=\@@alignment
\stopextendcatcodetable
\to \everydonknuthmode
@@ -387,14 +408,14 @@
\mathcode`\_="8000 % \_
%D \macros
-%D {\setupmathematics}
+%D {setupmathematics}
%D
%D Configuration for integrals. (If needed we can speed this up and make it
%D installable; no processaction is needed then).
\newtoks\everysetupmathematics
-\def\setupmathematics
+\unexpanded\def\setupmathematics
{\dosingleargument\dosetupmathematics}
\def\dosetupmathematics[#1]%
@@ -414,6 +435,37 @@
\setupmathematics
[\v!compact=no]
+%D Delayed: greek.
+%D
+%D \starttyping
+%D \usetypescript[cambria]\setupbodyfont[cambria]
+%D \startTEXpage
+%D $\alpha \mathgreekupright \alpha \mathgreekitalic \alpha$
+%D \stopTEXpage
+%D \stoptyping
+
+% [lc uc] normal (upright) = 2, italic = 3, none = 0/1
+
+\setevalue{\??mo:greek:\v!normal :\v!normal}{\attribute\mathgreekattribute22 }
+\setevalue{\??mo:greek:\v!normal :\v!italic}{\attribute\mathgreekattribute23 }
+\setevalue{\??mo:greek:\v!normal :\v!none }{\attribute\mathgreekattribute21 }
+
+\setevalue{\??mo:greek:\v!italic :\v!normal}{\attribute\mathgreekattribute32 }
+\setevalue{\??mo:greek:\v!italic :\v!italic}{\attribute\mathgreekattribute33 }
+\setevalue{\??mo:greek:\v!italic :\v!none }{\attribute\mathgreekattribute31 }
+
+\setevalue{\??mo:greek:\v!none :\v!normal}{\attribute\mathgreekattribute12 }
+\setevalue{\??mo:greek:\v!none :\v!italic}{\attribute\mathgreekattribute13 }
+\setevalue{\??mo:greek:\v!none :\v!none }{\attribute\mathgreekattribute\attributeunsetvalue}
+
+\appendtoks
+ \csname\??mo:greek:\@@molcgreek:\@@moucgreek\endcsname
+\to \everymathematics
+
+\setupmathematics
+ [lcgreek=\v!italic,
+ ucgreek=\v!normal] % was: none
+
%D \macros
%D {enablemathpunctuation,disablemathpunctuation}
%D
@@ -437,7 +489,7 @@
\to \everysetupmathematics
\appendtoks
- \ifconditional\automathpunctuation\dosetattribute{mathpunc}\plusone\fi
+ \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi
\to \everymathematics
\setupmathematics
@@ -515,6 +567,19 @@
\crampedscriptscriptstyle \fi % 6 -> 7
#1}}
+\def\mathstylefont#1% #1 is number (\normalmathstyle)
+ {\ifcase#1\relax
+ \textfont \or
+ \textfont \or
+ \textfont \or
+ \textfont \or
+ \scriptfont \or
+ \scriptfont \or
+ \scriptscriptfont \or
+ \scriptscriptfont \else
+ \textfont
+ \fi\zerocount}
+
%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
@@ -534,6 +599,12 @@
%{\hbox{\everymath{#1}\switchtobodyfont [#2]#3}} % 15 sec
{\hbox{\everymath{#1}\setcurrentfontbody{#2}#3}} % 3 sec (no math)
+%D Safeguard against redefinitions:
+
+\appendtoks
+ \let\_\normalunderscore % is textunderscore or fakeunderscore
+\to \everymathematics
+
%D Because we may overload \type {\text} in other (structuring)
%D macros, we say:
@@ -581,4 +652,6 @@
\ifx\text\undefined \let\text\hbox \fi
+\def\mathoptext#1{\mathop{\text{#1}}}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-inl.mkiv b/Master/texmf-dist/tex/context/base/math-inl.mkiv
index 93168b885ff..89de0242b09 100644
--- a/Master/texmf-dist/tex/context/base/math-inl.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-inl.mkiv
@@ -15,339 +15,12 @@
\unprotect
-%D \macros
-%D {...}
-%D
-%D New and experimental: snapping big inline math!
+% Obsolete, as we do snapping differently now.
-\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}}}
-
-\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
-
-\def\inlinemathmargin{1pt}
-
-\settrue\autocrazymathsnapping
-
-% FROM NOW ON, CHANGES AS OPTIONS
-
-% TODO: SKYLINE (PREV LINE POS SCAN)
-
-% we can rewrite this in lua but maybe we don't need it
-% any more when we have proper snapping anyway
-
-\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
- \checktextbackgrounds % we need pos tracking, to be made less redundant
- \donetrue
- \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
- {\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{\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{\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}
-
-\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 {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
+\def\snappedinlineformula {\dosingleempty\dosnappedinlineformula}
+\def\dosnappedinlineformula[#1]#2{\mathematics{#2}}
+\let\tform \mathematics
+\let\gform \snappedinlineformula
+\let\enableautomath \relax
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-int.mkiv b/Master/texmf-dist/tex/context/base/math-int.mkiv
index 8ac2d477613..2af471b5cb4 100644
--- a/Master/texmf-dist/tex/context/base/math-int.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-int.mkiv
@@ -57,11 +57,14 @@
\definemathcommand [iiint] {\repeatintegral\plustwo }
\definemathcommand [iiiint] {\repeatintegral\plusthree}
+%def\integralrepeatsymbol{\intop}
+\def\integralrepeatsymbol{{\int}}
+
\def\repeatintegral#1%
{\scratchtoks\emptytoks
\let\dointlimits\donothing
\let\dodointlimits\intlimits
- \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks}
+ \dorecurse{#1}{\appendtoks \integralrepeatsymbol \dointkern \to \scratchtoks}
\appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks
\edef\dodorepeatintegral{\the\scratchtoks}%
\futurelet\next\dorepeatintegral}
diff --git a/Master/texmf-dist/tex/context/base/math-lan.mkiv b/Master/texmf-dist/tex/context/base/math-lan.mkiv
new file mode 100644
index 00000000000..1d313257885
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/math-lan.mkiv
@@ -0,0 +1,67 @@
+%D \module
+%D [ file=math-lan,
+%D version=2009.03.10,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Language Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Math Macros / Language Support}
+
+\unprotect
+
+\setupmathlabeltext [\s!en] [arccos=arccos]
+\setupmathlabeltext [\s!en] [arcsin=arcsin]
+\setupmathlabeltext [\s!en] [arctan=arctan]
+\setupmathlabeltext [\s!en] [arg=arg]
+\setupmathlabeltext [\s!en] [cosh=cosh]
+\setupmathlabeltext [\s!en] [cos=cos]
+\setupmathlabeltext [\s!en] [coth=coth]
+\setupmathlabeltext [\s!en] [cot=cot]
+\setupmathlabeltext [\s!en] [csc=csc]
+\setupmathlabeltext [\s!en] [deg=deg]
+\setupmathlabeltext [\s!en] [det=det]
+\setupmathlabeltext [\s!en] [dim=dim]
+\setupmathlabeltext [\s!en] [exp=exp]
+\setupmathlabeltext [\s!en] [gcd=gcd]
+\setupmathlabeltext [\s!en] [hom=hom]
+\setupmathlabeltext [\s!en] [inf=inf]
+\setupmathlabeltext [\s!en] [injlim=inj\,lim]
+\setupmathlabeltext [\s!en] [ker=ker]
+\setupmathlabeltext [\s!en] [lg=lg]
+\setupmathlabeltext [\s!en] [liminf=lim\,inf]
+\setupmathlabeltext [\s!en] [limsup=lim\,sup]
+\setupmathlabeltext [\s!en] [lim=lim]
+\setupmathlabeltext [\s!en] [ln=ln]
+\setupmathlabeltext [\s!en] [log=log]
+\setupmathlabeltext [\s!en] [median=median]
+\setupmathlabeltext [\s!en] [max=max]
+\setupmathlabeltext [\s!en] [min=min]
+\setupmathlabeltext [\s!en] [mod=mod]
+\setupmathlabeltext [\s!en] [projlim=proj\,lim]
+\setupmathlabeltext [\s!en] [Pr=Pr]
+\setupmathlabeltext [\s!en] [sec=sec]
+\setupmathlabeltext [\s!en] [sinh=sinh]
+\setupmathlabeltext [\s!en] [sin=sin]
+\setupmathlabeltext [\s!en] [sup=sup]
+\setupmathlabeltext [\s!en] [tanh=tanh]
+\setupmathlabeltext [\s!en] [tan=tan]
+
+\setupmathlabeltext [\s!pl] [tg=tg]
+\setupmathlabeltext [\s!pl] [cot=ctg]
+\setupmathlabeltext [\s!pl] [ctg=ctg]
+\setupmathlabeltext [\s!pl] [arcsin=arc\,sin]
+\setupmathlabeltext [\s!pl] [arccos=arc\,cos]
+\setupmathlabeltext [\s!pl] [arctan=arc\,tg]
+\setupmathlabeltext [\s!pl] [arctg=arc\,tg]
+\setupmathlabeltext [\s!pl] [arcctg=arc\,ctg]
+
+\setupmathlabeltext [\s!nl] [gcd=ggd]
+\setupmathlabeltext [\s!nl] [lcm=kgv]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-lbr.mkii b/Master/texmf-dist/tex/context/base/math-lbr.mkii
index 7ac7c3affd4..cf69eec1fbf 100644
--- a/Master/texmf-dist/tex/context/base/math-lbr.mkii
+++ b/Master/texmf-dist/tex/context/base/math-lbr.mkii
@@ -13,12 +13,12 @@
\unprotect
-\definefamilysynonym [lbr] [calligrapahy] [sy]
-\definefamilysynonym [lbr] [oldstyle] [mi]
+\definefamilysynonym [lbr] [calligraphy] [sy]
+\definefamilysynonym [lbr] [oldstyle] [mi]
-\definefamilysynonym [lbr] [blackboard] [ma]
-\definefamilysynonym [lbr] [ucgreek] [mb]
-\definefamilysynonym [lbr] [vargreek] [mi]
+\definefamilysynonym [lbr] [blackboard] [ma]
+\definefamilysynonym [lbr] [ucgreek] [mb]
+\definefamilysynonym [lbr] [vargreek] [mi]
\startmathcollection[lbr]
@@ -376,21 +376,52 @@
% we define the whole lot, although only a few differ (esp dot)
-\startmathcollection[lbr]
+% \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
-\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]
+\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%
diff --git a/Master/texmf-dist/tex/context/base/math-map.lua b/Master/texmf-dist/tex/context/base/math-map.lua
index 0229790c2fb..2d34dc1c37b 100644
--- a/Master/texmf-dist/tex/context/base/math-map.lua
+++ b/Master/texmf-dist/tex/context/base/math-map.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-map'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
@@ -20,6 +20,11 @@ if not modules then modules = { } end modules ['math-map'] = {
-- maybe: script/scriptscript dynamic,
local type, next = type, next
+local floor = math.floor
+
+local texattribute = tex.attribute
+
+local trace_greek = false trackers.register("math.greek", function(v) trace_greek = v end)
mathematics = mathematics or { }
@@ -33,19 +38,24 @@ mathematics.alphabets = {
digits = 0x00030,
ucletters = 0x00041,
lcletters = 0x00061,
- symbols = {
- [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, [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, [0x2202]=0x2202, [0x2207]=0x2207,
+ 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,
},
},
it = {
@@ -58,56 +68,71 @@ mathematics.alphabets = {
[0x00075]=0x1D462, [0x00076]=0x1D463, [0x00077]=0x1D464, [0x00078]=0x1D465, [0x00079]=0x1D466,
[0x0007A]=0x1D467,
},
- symbols = {
+ 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, [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, [0x2202]=0x1D715, [0x2207]=0x1D6FB,
+ [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,
},
},
bf= {
digits = 0x1D7CE,
ucletters = 0x1D400,
lcletters = 0x1D41A,
- symbols = {
+ 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, [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, [0x2202]=0x1D6DB, [0x2207]=0x1D6C1,
+ [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,
},
},
bi = {
ucletters = 0x1D468,
lcletters = 0x1D482,
- symbols = {
+ 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, [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, [0x2202]=0x1D74F, [0x2207]=0x1D735,
+ [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,
},
},
},
@@ -125,37 +150,47 @@ mathematics.alphabets = {
digits = 0x1D7EC,
ucletters = 0x1D5D4,
lcletters = 0x1D5EE,
- symbols = {
+ 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, [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, [0x2202]=0x1D789, [0x2207]=0x1D76F,
+ [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,
},
},
bi = {
ucletters = 0x1D63C,
lcletters = 0x1D656,
- symbols = {
+ 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, [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, [0x2202]=0x1D7C3, [0x2207]=0x1D7A9,
+ [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,
},
},
},
@@ -178,6 +213,15 @@ mathematics.alphabets = {
[0x0005A]=0x02124,
},
lcletters = 0x1D552,
+ lcgreek = { -- gamma pi
+ [0x03B3]=0x0213C, [0x03C0]=0x0213D,
+ },
+ ucgreek = { -- Gamma pi
+ [0x0393]=0x0213E, [0x03A0]=0x0213F,
+ },
+ symbols = { -- sum
+ [0x2211]=0x02140,
+ },
},
},
fraktur = { -- ok
@@ -224,16 +268,16 @@ mathematics.alphabets = {
}
local alphabets = mathematics.alphabets
-local attribs = { }
+local mathremap = { }
for alphabet, styles in next, alphabets do
for style, data in next, styles do
-- let's keep the long names (for tracing)
- local n = #attribs+1
+ local n = #mathremap + 1
data.attribute = n
data.alphabet = alphabet
data.style = style
- attribs[n] = data
+ mathremap[n] = data
end
end
@@ -244,33 +288,50 @@ alphabets.regular.it.digits = alphabets.regular.tf.digits
alphabets.regular.bi.digits = alphabets.regular.bf.digits
alphabets.sansserif.tf.symbols = alphabets.regular.tf.symbols
+alphabets.sansserif.tf.lcgreek = alphabets.regular.tf.lcgreek
+alphabets.sansserif.tf.ucgreek = alphabets.regular.tf.ucgreek
alphabets.sansserif.tf.digits = alphabets.regular.tf.digits
alphabets.sansserif.it.symbols = alphabets.regular.tf.symbols
+alphabets.sansserif.it.lcgreek = alphabets.regular.tf.lcgreek
+alphabets.sansserif.it.ucgreek = alphabets.regular.tf.ucgreek
alphabets.sansserif.bi.digits = alphabets.regular.bf.digits
alphabets.monospaced.tf.symbols = alphabets.sansserif.tf.symbols
+alphabets.monospaced.tf.lcgreek = alphabets.sansserif.tf.lcgreek
+alphabets.monospaced.tf.ucgreek = alphabets.sansserif.tf.ucgreek
alphabets.monospaced.it = alphabets.sansserif.tf
alphabets.monospaced.bf = alphabets.sansserif.tf
alphabets.monospaced.bi = alphabets.sansserif.bf
-alphabets.blackboard.tf.symbols = alphabets.regular.tf.symbols
+alphabets.blackboard.tf.symbols = table.merge(alphabets.regular.tf.symbols, alphabets.blackboard.tf.symbols)
+alphabets.blackboard.tf.lcgreek = table.merge(alphabets.regular.tf.lcgreek, alphabets.blackboard.tf.lcgreek)
+alphabets.blackboard.tf.ucgreek = table.merge(alphabets.regular.tf.ucgreek, alphabets.blackboard.tf.ucgreek)
+
alphabets.blackboard.it = alphabets.blackboard.tf
alphabets.blackboard.bf = alphabets.blackboard.tf
alphabets.blackboard.bi = alphabets.blackboard.bf
alphabets.fraktur.tf.digits = alphabets.regular.tf.digits
alphabets.fraktur.tf.symbols = alphabets.regular.tf.symbols
+alphabets.fraktur.tf.lcgreek = alphabets.regular.tf.lcgreek
+alphabets.fraktur.tf.ucgreek = alphabets.regular.tf.ucgreek
alphabets.fraktur.bf.digits = alphabets.regular.bf.digits
alphabets.fraktur.bf.symbols = alphabets.regular.bf.symbols
+alphabets.fraktur.bf.lcgreek = alphabets.regular.bf.lcgreek
+alphabets.fraktur.bf.ucgreek = alphabets.regular.bf.ucgreek
alphabets.fraktur.it = alphabets.fraktur.tf
alphabets.fraktur.bi = alphabets.fraktur.bf
-alphabets.script.tf.digits = alphabets.regular.tf.digits
-alphabets.script.tf.symbols = alphabets.regular.tf.symbols
-alphabets.script.bf.digits = alphabets.regular.bf.digits
-alphabets.script.bf.symbols = alphabets.regular.bf.symbols
-alphabets.script.it = alphabets.script.tf
-alphabets.script.bi = alphabets.script.bf
+alphabets.script.tf.digits = alphabets.regular.tf.digits
+alphabets.script.tf.symbols = alphabets.regular.tf.symbols
+alphabets.script.tf.lcgreek = alphabets.regular.tf.lcgreek
+alphabets.script.tf.ucgreek = alphabets.regular.tf.ucgreek
+alphabets.script.bf.digits = alphabets.regular.bf.digits
+alphabets.script.bf.symbols = alphabets.regular.bf.symbols
+alphabets.script.bf.lcgreek = alphabets.regular.bf.lcgreek
+alphabets.script.bf.ucgreek = alphabets.regular.bf.ucgreek
+alphabets.script.it = alphabets.script.tf
+alphabets.script.bi = alphabets.script.bf
alphabets.tt = alphabets.monospaced
alphabets.ss = alphabets.sansserif
@@ -284,70 +345,80 @@ alphabets.type = alphabets.monospaced
alphabets.teletype = alphabets.monospaced
function mathematics.to_a_style(attribute)
- local r = attribs[attribute]
+ local r = mathremap[attribute]
return r and r.style or "tf"
end
function mathematics.to_a_name(attribute)
- local r = attribs[attribute]
+ local r = mathremap[attribute]
return r and r.alphabet or "regular"
end
-- of course we could do some div/mod trickery instead
---~ function mathematics.sync_a_both(attribute,alphabet,style)
---~ local data = alphabets[alphabet or "regular"] or alphabets.regular
---~ data = data[style or "tf"] or data.tf
---~ return data and data.attribute or attribute
---~ end
-
---~ function mathematics.sync_a_style(attribute,style)
---~ local r = attribs[attribute]
---~ local alphabet = r and r.alphabet or "regular"
---~ local data = alphabets[alphabet][style]
---~ return data and data.attribute or attribute
---~ end
-
---~ function mathematics.sync_a_name(attribute,alphabet)
---~ local r = attribs[attribute]
---~ local style = r and r.style or "tf"
---~ local data = alphabets[alphabet][style]
---~ return data and data.attribute or attribute
---~ end
-
-local mathalph = attributes.private("mathalph")
-
-local texattribute = tex.attribute
+local mathalphabet = attributes.private("mathalphabet")
function mathematics.sync_a_both(alphabet,style)
local data = alphabets[alphabet or "regular"] or alphabets.regular
data = data[style or "tf"] or data.tf
- texattribute[mathalph] = data and data.attribute or texattribute[mathalph]
+ texattribute[mathalphabet] = data and data.attribute or texattribute[mathalphabet]
end
function mathematics.sync_a_style(style)
- local r = attribs[attribute]
+--~ local r = mathremap[mathalphabet]
+ local r = mathremap[texattribute[mathalphabet]]
local alphabet = r and r.alphabet or "regular"
local data = alphabets[alphabet][style]
- texattribute[mathalph] = data and data.attribute or texattribute[mathalph]
+ texattribute[mathalphabet] = data and data.attribute or texattribute[mathalphabet]
end
function mathematics.sync_a_name(alphabet)
- local r = attribs[attribute]
+--~ local r = mathremap[mathalphabet]
+ local r = mathremap[texattribute[mathalphabet]]
local style = r and r.style or "tf"
local data = alphabets[alphabet][style]
- texattribute[mathalph] = data and data.attribute or texattribute[mathalph]
+ texattribute[mathalphabet] = data and data.attribute or texattribute[mathalphabet]
end
-local issymbol = mathematics.alphabets.regular.tf.symbols
+local issymbol = mathematics.alphabets.regular.tf.symbols
+local islcgreek = mathematics.alphabets.regular.tf.lcgreek
+local isucgreek = mathematics.alphabets.regular.tf.ucgreek
+
+local remapping = {
+ [1] = { what = "unchanged" }, -- upright
+ [2] = { what = "upright", it = "tf", bi = "bf" }, -- upright
+ [3] = { what = "italic", tf = "it", bf = "bi" }, -- italic
+}
-function mathematics.remap_alphabets(attribute,char)
- -- we could use a map[attribute][char] => newchar but first we have
- -- to finish the table
- local offset = attribs[attribute]
- if offset then
+function mathematics.remap_alphabets(char,mathalphabet,mathgreek)
+ if mathgreek > 0 then
+ local lc, uc = floor(mathgreek/10), mathgreek % 10 -- 2 == upright 3 == italic
+ if lc > 1 or uc > 1 then
+ local islc, isuc = islcgreek[char] and lc, isucgreek[char] and uc
+ if islc or isuc then
+ local r = mathremap[mathalphabet] -- what if 0
+ local alphabet = r and r.alphabet or "regular"
+ local style = r and r.style or "tf"
+ if trace_greek then
+ logs.report("math","before: char: %05X, alphabet: %s %s, lcgreek: %s, ucgreek: %s",char,alphabet,style,remapping[lc].what,remapping[uc].what)
+ end
+ local s = remapping[islc or isuc][style]
+ if s then
+ local data = alphabets[alphabet][s]
+ mathalphabet, style = data and data.attribute or mathalphabet, s
+ end
+ if trace_greek then
+ logs.report("math","after : char: %05X, alphabet: %s %s, lcgreek: %s, ucgreek: %s",char,alphabet,style,remapping[lc].what,remapping[uc].what)
+ end
+ end
+ end
+ end
+ if mathalphabet > 0 then
local newchar
- if char >= 0x030 and char <= 0x039 then
+ local offset = mathremap[mathalphabet]
+ if not offset then
+ -- nothing to remap
+ elseif char >= 0x030 and char <= 0x039 then
local o = offset.digits
newchar = (type(o) == "table" and (o[char] or char)) or (char - 0x030 + o)
elseif char >= 0x041 and char <= 0x05A then
@@ -356,6 +427,10 @@ function mathematics.remap_alphabets(attribute,char)
elseif char >= 0x061 and char <= 0x07A then
local o = offset.lcletters
newchar = (type(o) == "table" and (o[char] or char)) or (char - 0x061 + o)
+ elseif islcgreek[char] then
+ newchar = offset.lcgreek[char]
+ elseif isucgreek[char] then
+ newchar = offset.ucgreek[char]
elseif issymbol[char] then
newchar = offset.symbols[char]
end
diff --git a/Master/texmf-dist/tex/context/base/math-noa.lua b/Master/texmf-dist/tex/context/base/math-noa.lua
index db1a5b63896..02bbe0a6299 100644
--- a/Master/texmf-dist/tex/context/base/math-noa.lua
+++ b/Master/texmf-dist/tex/context/base/math-noa.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['math-noa'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
@@ -16,7 +16,7 @@ local set_attribute = node.set_attribute
local has_attribute = node.has_attribute
local mlist_to_hlist = node.mlist_to_hlist
local font_of_family = node.family_font
-local fontdata = fonts.ids
+local fontdata = fonts.identifiers
local format, rep = string.format, string.rep
local utfchar, utfbyte = utf.char, utf.byte
@@ -89,7 +89,7 @@ local function process(start,what,n)
if n then n = n + 1 else n = 0 end
while start do
if trace_processing then
- texio.write_nl(format("%s%s",rep(" ",n or 0),tostring(start)))
+ logs.report("math","%s%s",rep(" ",n or 0),tostring(start))
end
local id = start.id
local proc = what[id]
@@ -140,7 +140,8 @@ noads.process = process
-- character remapping
-local attribute = attributes.private("mathalph")
+local mathalphabet = attributes.private("mathalphabet")
+local mathgreek = attributes.private("mathgreek")
noads.processors.relocate = { }
@@ -151,14 +152,47 @@ end
local remap_alphabets = mathematics.remap_alphabets
local fcs = fonts.color.set
+-- we can have a global famdata == fonts.famdata and chrdata == fonts.chrdata
+
+--~ This does not work out well, as there are no fallbacks. Ok, we could
+--~ define a poor mans simplify mechanism.
+--~
+--~ local function checked(pointer)
+--~ local char = pointer.char
+--~ local fam = pointer.fam
+--~ local id = font_of_family(fam)
+--~ local tfmdata = fontdata[id]
+--~ local tc = tfmdata and tfmdata.characters
+--~ if not tc[char] then
+--~ local specials = characters.data[char].specials
+--~ if specials and (specials[1] == "char" or specials[1] == "font") then
+--~ newchar = specials[#specials]
+--~ if trace_remapping then
+--~ report_remap("fallback",id,char,newchar)
+--~ end
+--~ if trace_analyzing then
+--~ fcs(pointer,"font:isol")
+--~ end
+--~ pointer.char = newchar
+--~ return true
+--~ end
+--~ end
+--~ end
+
noads.processors.relocate[math_char] = function(pointer)
- local a = has_attribute(pointer,attribute)
- if a and a > 0 then
- local fam = pointer.fam
- set_attribute(pointer,attribute,0)
+ local g = has_attribute(pointer,mathgreek) or 0
+ local a = has_attribute(pointer,mathalphabet) or 0
+ if a > 0 or g > 0 then
+ if a > 0 then
+ set_attribute(pointer,mathgreek,0)
+ end
+ if g > 0 then
+ set_attribute(pointer,mathalphabet,0)
+ end
local char = pointer.char
- local newchar = remap_alphabets(a,char)
+ local newchar = remap_alphabets(char,a,g)
if newchar then
+ local fam = pointer.fam
local id = font_of_family(fam)
local tfmdata = fontdata[id]
if tfmdata and tfmdata.characters[newchar] then -- we could probably speed this up
@@ -169,11 +203,15 @@ noads.processors.relocate[math_char] = function(pointer)
fcs(pointer,"font:isol")
end
pointer.char = newchar
- return
+ return true
elseif trace_remapping then
report_remap("char",id,char,newchar," fails")
end
+ else
+ -- return checked(pointer)
end
+ else
+ -- return checked(pointer)
end
if trace_analyzing then
fcs(pointer,"font:medi")
@@ -207,15 +245,15 @@ end
-- todo: just replace the character by an ord noad
-- and remove the right delimiter as well
-local attribute = attributes.private("mathsize")
+local mathsize = attributes.private("mathsize")
noads.processors.resize = { }
noads.processors.resize[math_fence] = function(pointer)
if pointer.subtype == 1 then -- left
- local a = has_attribute(pointer,attribute)
+ local a = has_attribute(pointer,mathsize)
if a and a > 0 then
- set_attribute(pointer,attribute,0)
+ set_attribute(pointer,mathsize,0)
local d = pointer.delim
local df = d.small_fam
local id = font_of_family(df)
@@ -234,7 +272,7 @@ end
-- respacing
-local attribute = attributes.private("mathpunc")
+local mathpunctuation = attributes.private("mathpunctuation")
noads.processors.respace = { }
@@ -244,9 +282,9 @@ local chardata = characters.data
noads.processors.respace[math_noad] = function(pointer)
if pointer.subtype == noad_ord then
- local a = has_attribute(pointer,attribute)
+ local a = has_attribute(pointer,mathpunctuation)
if a and a > 0 then
- set_attribute(pointer,attribute,0)
+ set_attribute(pointer,mathpunctuation,0)
local current_nucleus = pointer.nucleus
if current_nucleus.id == math_char then
local current_char = current_nucleus.char
@@ -304,8 +342,10 @@ end
tasks.new (
"math",
{
+ "before",
"normalizers",
"builders",
+ "after",
}
)
@@ -320,12 +360,10 @@ function nodes.processors.mlist_to_hlist(head,style,penalties)
return head, done
end
-callback.register('mlist_to_hlist',nodes.processors.mlist_to_hlist)
+callbacks.register('mlist_to_hlist',nodes.processors.mlist_to_hlist,"preprocessing math list")
-- tracing
statistics.register("math processing time", function()
- if statistics.elapsedindeed(noads) then
- return format("%s seconds", statistics.elapsedtime(noads))
- end
+ return statistics.elapsedseconds(noads)
end)
diff --git a/Master/texmf-dist/tex/context/base/math-pln.mkiv b/Master/texmf-dist/tex/context/base/math-pln.mkiv
index 40d73b2280e..ab584f10a32 100644
--- a/Master/texmf-dist/tex/context/base/math-pln.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-pln.mkiv
@@ -269,7 +269,7 @@
&\kern-\displaywidth\rlap{$\@lign##$}\tabskip\displaywidth\crcr
#1\crcr}}
-% temporary here
+% temporary here (weird code)
% \startcatcodetable \mthcatcodes
% \setcatcodetable\ctxcatcodes
diff --git a/Master/texmf-dist/tex/context/base/math-run.mkii b/Master/texmf-dist/tex/context/base/math-run.mkii
index afe5b18b47f..6bc4bf4d5d1 100644
--- a/Master/texmf-dist/tex/context/base/math-run.mkii
+++ b/Master/texmf-dist/tex/context/base/math-run.mkii
@@ -44,29 +44,37 @@
\ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}
\def\dodefinemathcharacter[##1][##2][##3][##4][##5][##6]{}
\def\dodefinemathcommand [##1][##2][##3]##4{}
- \readsysfile{\f!mathprefix tex}\donothing\donothing
- \readsysfile{\f!mathprefix ams}\donothing\donothing
- \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}\donothing\donothing
- \readsysfile{\f!mathprefix ams}\donothing\donothing
- \stopcolumns
+ \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}
diff --git a/Master/texmf-dist/tex/context/base/math-scr.mkiv b/Master/texmf-dist/tex/context/base/math-scr.mkiv
index 43355679f45..eb1db4714e3 100644
--- a/Master/texmf-dist/tex/context/base/math-scr.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-scr.mkiv
@@ -22,108 +22,28 @@
%D subscript mode. We want however a bit more control than
%D normally provided, and therefore provide \type {\super}
%D and \type{sub}.
+%D
+%D The grid snapping has been removed.
\global\let\normalsuper=^
\global\let\normalsuber=_
-\newcount\supersubmode
-
-\newevery\everysupersub \EverySuperSub
+\ifdefined\supersubmode \else \newcount\supersubmode \fi
+\ifdefined\newevery \else \everysupersub \EverySuperSub \fi
\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
diff --git a/Master/texmf-dist/tex/context/base/math-tex.mkii b/Master/texmf-dist/tex/context/base/math-tex.mkii
index c833db9561a..8f34a190e22 100644
--- a/Master/texmf-dist/tex/context/base/math-tex.mkii
+++ b/Master/texmf-dist/tex/context/base/math-tex.mkii
@@ -180,6 +180,8 @@
\stopmathcollection
+\let\normalmatharg\arg % todo: maybe automatically
+
\startmathcollection[default]
\definemathcommand [integers] {\mfunction{Z}}
diff --git a/Master/texmf-dist/tex/context/base/math-vfu.lua b/Master/texmf-dist/tex/context/base/math-vfu.lua
index fb5113be45b..5023e6b4d65 100644
--- a/Master/texmf-dist/tex/context/base/math-vfu.lua
+++ b/Master/texmf-dist/tex/context/base/math-vfu.lua
@@ -1,13 +1,14 @@
if not modules then modules = { } end modules ['math-vfu'] = {
version = 1.001,
- comment = "companion to math-ini.tex",
+ 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"
}
-- All these math vectors .. thanks to Aditya and Mojca they become
--- better and better.
+-- better and better. If you have problems with math fonts or miss
+-- characters report it to the ConTeXt mailing list.
local type, next = type, next
@@ -23,8 +24,7 @@ fonts.vf.math.optional = false
local push, pop, back = { "push" }, { "pop" }, { "slot", 1, 0x2215 }
-local function negate(main,unicode,basecode)
- local characters = main.characters
+local function negate(main,characters,id,size,unicode,basecode)
if not characters[unicode] then
local basechar = characters[basecode]
if basechar then
@@ -53,8 +53,7 @@ end
--~ \Umathchardef\bracelu="0 "1 "FF07C
--~ \Umathchardef\braceru="0 "1 "FF07D
-local function brace(main,unicode,first,rule,left,right,rule,last)
- local characters = main.characters
+local function brace(main,characters,id,size,unicode,first,rule,left,right,rule,last)
if not characters[unicode] then
characters[unicode] = {
horiz_variants = {
@@ -69,24 +68,25 @@ local function brace(main,unicode,first,rule,left,right,rule,last)
end
end
-local function arrow(main,unicode,arrow,minus,isleft)
- if isleft then
- t = {
- { extender = 0, glyph = arrow },
- { extender = 1, glyph = minus },
- }
- else
- t = {
- { extender = 0, glyph = minus },
- { extender = 1, glyph = arrow },
- }
+local function arrow(main,characters,id,size,unicode,arrow,minus,isleft)
+ if characters[unicode] then
+ if isleft then
+ t = {
+ { extender = 0, glyph = arrow },
+ { extender = 1, glyph = minus },
+ }
+ else
+ t = {
+ { extender = 0, glyph = minus },
+ { extender = 1, glyph = arrow },
+ }
+ end
+ --~ main.characters[unicode] = { horiz_variants = t }
+ characters[unicode].horiz_variants = t
end
---~ main.characters[unicode] = { horiz_variants = t }
- main.characters[unicode].horiz_variants = t
end
-local function parent(main,unicode,first,rule,last)
- local characters = main.characters
+local function parent(main,characters,id,size,unicode,first,rule,last)
if not characters[unicode] then
characters[unicode] = {
horiz_variants = {
@@ -100,13 +100,13 @@ end
local push, pop, step = { "push" }, { "pop" }, 0.2 -- 0.1 is nicer but gives larger files
-local function make(main,id,size,n,m)
- local characters = main.characters
- local xu = main.parameters.x_height + 0.3*size
- local xd = 0.3*size
- local old, upslot, dnslot, uprule, dnrule = 0xFF000+n, 0xFF100+n, 0xFF200+n, 0xFF300+m, 0xFF400+m
+local function make(main,characters,id,size,n,m)
+ local old = 0xFF000+n
local c = characters[old]
if c then
+ local upslot, dnslot, uprule, dnrule = 0xFF100+n, 0xFF200+n, 0xFF300+m, 0xFF400+m
+ local xu = main.parameters.x_height + 0.3*size
+ local xd = 0.3*size
local w, h, d = c.width, c.height, c.depth
local thickness = h - d
local rulewidth = step*size -- we could use an overlap
@@ -127,120 +127,167 @@ local function make(main,id,size,n,m)
end
end
-local function minus(main,id,size,unicode)
- local characters = main.characters
- local mu = size/18
+local function minus(main,characters,id,size,unicode)
local minus = characters[0x002D]
- local width = minus.width - 5*mu
- characters[unicode] = {
- width = width, height = minus.height, depth = minus.depth,
- commands = { push, { "right", -3*mu }, { "slot", id, 0x002D }, pop }
- }
+ if minus then
+ local mu = size/18
+ local width = minus.width - 5*mu
+ characters[unicode] = {
+ width = width, height = minus.height, depth = minus.depth,
+ commands = { push, { "right", -3*mu }, { "slot", id, 0x002D }, pop }
+ }
+ end
end
-local function dots(main,id,size,unicode)
- local characters = main.characters
+local function dots(main,characters,id,size,unicode)
local c = characters[0x002E]
- local w, h, d = c.width, c.height, c.depth
- local mu = size/18
- local right3mu = { "right", 3*mu }
- local right1mu = { "right", 1*mu }
- local up1size = { "down", -.1*size }
- local up4size = { "down", -.4*size }
- local up7size = { "down", -.7*size }
- local right2muw = { "right", 2*mu + w }
- local slot = { "slot", id, 0x002E }
- if unicode == 0x22EF then
- local c = characters[0x022C5]
- if c then
- local w, h, d = c.width, c.height, c.depth
- local slot = { "slot", id, 0x022C5 }
+ if c then
+ local w, h, d = c.width, c.height, c.depth
+ local mu = size/18
+ local right3mu = { "right", 3*mu }
+ local right1mu = { "right", 1*mu }
+ local up1size = { "down", -.1*size }
+ local up4size = { "down", -.4*size }
+ local up7size = { "down", -.7*size }
+ local right2muw = { "right", 2*mu + w }
+ local slot = { "slot", id, 0x002E }
+ if unicode == 0x22EF then
+ local c = characters[0x022C5]
+ if c then
+ local w, h, d = c.width, c.height, c.depth
+ local slot = { "slot", id, 0x022C5 }
+ characters[unicode] = {
+ width = 3*w + 2*3*mu, height = h, depth = d,
+ commands = { push, slot, right3mu, slot, right3mu, slot, pop }
+ }
+ 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 = 1.5*size, depth = 0,
+ commands = {
+ push,
+ right1mu,
+ push, up7size, slot, pop,
+ right2muw,
+ push, up4size, slot, pop,
+ right2muw,
+ push, up1size, slot, pop,
+ right1mu,
+ pop
+ }
+ }
+ elseif unicode == 0x22F0 then
+ characters[unicode] = {
+ width = 3*w + 6*size/18, height = 1.5*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 }
}
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 = 1.5*size, depth = 0,
- commands = {
- push,
- right1mu,
- push, up7size, slot, pop,
- right2muw,
- push, up4size, slot, pop,
- right2muw,
- push, up1size, slot, pop,
- right1mu,
- pop
- }
- }
- elseif unicode == 0x22F0 then
+ 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 = 3*w + 6*size/18, height = 1.5*size, depth = 0,
+ width = cp.width,
+ height = cp.height + sc,
+ depth = cp.depth + sc,
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 }
+ push, { "down", -sc }, pc, pop,
+ push, { "down", sc }, pc, pop,
+ pc,
+ },
+ next = cp.next -- can be extensible
}
+ cp.next = unicode
end
end
function fonts.vf.math.alas(main,id,size)
+ local characters = main.characters
for i=0x7A,0x7D do
- make(main,id,size,i,1)
+ make(main,characters,id,size,i,1)
end
- brace (main,0x23DE,0xFF17A,0xFF301,0xFF17D,0xFF17C,0xFF301,0xFF17B)
- brace (main,0x23DF,0xFF27C,0xFF401,0xFF27B,0xFF27A,0xFF401,0xFF27D)
- parent(main,0x23DC,0xFF17A,0xFF301,0xFF17B)
- parent(main,0x23DD,0xFF27C,0xFF401,0xFF27D)
- negate(main,0x2260,0x003D)
- dots(main,id,size,0x2026) -- ldots
- dots(main,id,size,0x22EE) -- vdots
- dots(main,id,size,0x22EF) -- cdots
- dots(main,id,size,0x22F1) -- ddots
- dots(main,id,size,0x22F0) -- udots
- minus(main,id,size,0xFF501)
- arrow(main,0x2190,0xFE190,0xFF501,true) -- left
- arrow(main,0x2192,0xFE192,0xFF501,false) -- right
+ 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
+ minus (main,characters,id,size,0xFF501)
+ arrow (main,characters,id,size,0x2190,0xFE190,0xFF501,true) -- left
+ arrow (main,characters,id,size,0x2192,0xFE192,0xFF501,false) -- right
+ 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,0x02225,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)
end
-local reverse -- index -> unicode
+local unique = 0 -- testcase: \startTEXpage \math{!\text{-}\text{-}\text{-}} \stopTEXpage
-function fonts.basecopy(tfmtable)
+function fonts.basecopy(tfmtable,name)
+ local characters, parameters, fullname = tfmtable.characters, tfmtable.parameters, tfmtable.fullname
local t, c, p = { }, { }, { }
for k, v in next, tfmtable do
t[k] = v
end
- for k, v in next, tfmtable.characters do
- c[k] = v
+ if characters then
+ for k, v in next, characters do
+ c[k] = v
+ end
+ t.characters = c
+ else
+ logs.report("math virtual","font %s has no characters",name)
+ end
+ if parameters then
+ for k, v in next, parameters do
+ p[k] = v
+ end
+ t.parameters = p
+ else
+ logs.report("math virtual","font %s has no parameters",name)
end
- for k, v in next, tfmtable.parameters do
- p[k] = v
+ -- tricky ... what if fullname does not exist
+ if fullname then
+ unique = unique + 1
+ t.fullname = fullname .. "-" .. unique
end
- t.characters, t.parameters = c, p
return t
end
local reported = { }
+local reverse -- index -> unicode
function fonts.vf.math.define(specification,set)
if not reverse then
@@ -257,7 +304,6 @@ function fonts.vf.math.define(specification,set)
local size = specification.size -- given size
local fnt, lst, main = { }, { }, nil
local start = (trace_virtual or trace_timings) and os.clock()
---~ texio.write_nl("defining font " .. name .. " " .. size)
local okset, n = { }, 0
for s=1,#set do
local ss = set[s]
@@ -285,10 +331,14 @@ function fonts.vf.math.define(specification,set)
end
end
-- beware, fnt[1] is already passed to tex (we need to make a simple copy then .. todo)
- main = fonts.basecopy(fnt[1])
+ main = fonts.basecopy(fnt[1],name)
main.name, main.fonts, main.virtualized, main.math_parameters = name, lst, true, { }
local characters, descriptions = main.characters, main.descriptions
- main.parameters.x_height = main.parameters.x_height or 0
+ local mp = main.parameters
+ if mp then
+ mp.x_height = mp.x_height or 0
+ end
+ local already_reported = false
for s=1,n do
local ss, fs = okset[s], fnt[s]
if not fs then
@@ -297,34 +347,38 @@ function fonts.vf.math.define(specification,set)
-- skip, redundant
else
local mm, fp = main.math_parameters, fs.parameters
- if ss.extension then
- mm.math_x_height = fp.x_height or 0 -- math_x_height height of x
- mm.default_rule_thickness = fp[ 8] or 0 -- default_rule_thickness thickness of \over bars
- mm.big_op_spacing1 = fp[ 9] or 0 -- big_op_spacing1 minimum clearance above a displayed op
- mm.big_op_spacing2 = fp[10] or 0 -- big_op_spacing2 minimum clearance below a displayed op
- mm.big_op_spacing3 = fp[11] or 0 -- big_op_spacing3 minimum baselineskip above displayed op
- mm.big_op_spacing4 = fp[12] or 0 -- big_op_spacing4 minimum baselineskip below displayed op
- mm.big_op_spacing5 = fp[13] or 0 -- big_op_spacing5 padding above and below displayed limits
- -- logs.report("math virtual","loading and virtualizing font %s at size %s, setting ex parameters",name,size)
- elseif ss.parameters then
- main.parameters.x_height = fp.x_height or main.parameters.x_height
- mm.x_height = mm.x_height or fp.x_height or 0 -- x_height height of x
- mm.num1 = fp[ 8] or 0 -- num1 numerator shift-up in display styles
- mm.num2 = fp[ 9] or 0 -- num2 numerator shift-up in non-display, non-\atop
- mm.num3 = fp[10] or 0 -- num3 numerator shift-up in non-display \atop
- mm.denom1 = fp[11] or 0 -- denom1 denominator shift-down in display styles
- mm.denom2 = fp[12] or 0 -- denom2 denominator shift-down in non-display styles
- mm.sup1 = fp[13] or 0 -- sup1 superscript shift-up in uncramped display style
- mm.sup2 = fp[14] or 0 -- sup2 superscript shift-up in uncramped non-display
- mm.sup3 = fp[15] or 0 -- sup3 superscript shift-up in cramped styles
- mm.sub1 = fp[16] or 0 -- sub1 subscript shift-down if superscript is absent
- mm.sub2 = fp[17] or 0 -- sub2 subscript shift-down if superscript is present
- mm.sup_drop = fp[18] or 0 -- sup_drop superscript baseline below top of large box
- mm.sub_drop = fp[19] or 0 -- sub_drop subscript baseline below bottom of large box
- mm.delim1 = fp[20] or 0 -- delim1 size of \atopwithdelims delimiters in display styles
- mm.delim2 = fp[21] or 0 -- delim2 size of \atopwithdelims delimiters in non-displays
- mm.axis_height = fp[22] or 0 -- axis_height height of fraction lines above the baseline
- -- logs.report("math virtual","loading and virtualizing font %s at size %s, setting sy parameters",name,size)
+ if mm and fp and mp then
+ if ss.extension then
+ mm.math_x_height = fp.x_height or 0 -- math_x_height height of x
+ mm.default_rule_thickness = fp[ 8] or 0 -- default_rule_thickness thickness of \over bars
+ mm.big_op_spacing1 = fp[ 9] or 0 -- big_op_spacing1 minimum clearance above a displayed op
+ mm.big_op_spacing2 = fp[10] or 0 -- big_op_spacing2 minimum clearance below a displayed op
+ mm.big_op_spacing3 = fp[11] or 0 -- big_op_spacing3 minimum baselineskip above displayed op
+ mm.big_op_spacing4 = fp[12] or 0 -- big_op_spacing4 minimum baselineskip below displayed op
+ mm.big_op_spacing5 = fp[13] or 0 -- big_op_spacing5 padding above and below displayed limits
+ -- logs.report("math virtual","loading and virtualizing font %s at size %s, setting ex parameters",name,size)
+ elseif ss.parameters then
+ mp.x_height = fp.x_height or mp.x_height
+ mm.x_height = mm.x_height or fp.x_height or 0 -- x_height height of x
+ mm.num1 = fp[ 8] or 0 -- num1 numerator shift-up in display styles
+ mm.num2 = fp[ 9] or 0 -- num2 numerator shift-up in non-display, non-\atop
+ mm.num3 = fp[10] or 0 -- num3 numerator shift-up in non-display \atop
+ mm.denom1 = fp[11] or 0 -- denom1 denominator shift-down in display styles
+ mm.denom2 = fp[12] or 0 -- denom2 denominator shift-down in non-display styles
+ mm.sup1 = fp[13] or 0 -- sup1 superscript shift-up in uncramped display style
+ mm.sup2 = fp[14] or 0 -- sup2 superscript shift-up in uncramped non-display
+ mm.sup3 = fp[15] or 0 -- sup3 superscript shift-up in cramped styles
+ mm.sub1 = fp[16] or 0 -- sub1 subscript shift-down if superscript is absent
+ mm.sub2 = fp[17] or 0 -- sub2 subscript shift-down if superscript is present
+ mm.sup_drop = fp[18] or 0 -- sup_drop superscript baseline below top of large box
+ mm.sub_drop = fp[19] or 0 -- sub_drop subscript baseline below bottom of large box
+ mm.delim1 = fp[20] or 0 -- delim1 size of \atopwithdelims delimiters in display styles
+ mm.delim2 = fp[21] or 0 -- delim2 size of \atopwithdelims delimiters in non-displays
+ mm.axis_height = fp[22] or 0 -- axis_height height of fraction lines above the baseline
+ -- logs.report("math virtual","loading and virtualizing font %s at size %s, setting sy parameters",name,size)
+ end
+ else
+ logs.report("math virtual","font %s, no parameters set",name)
end
local vectorname = ss.vector
if vectorname then
@@ -337,14 +391,19 @@ function fonts.vf.math.define(specification,set)
for unicode, index in next, vector do
local fci = fc[index]
if not fci then
- local fontname = fs.name
+ local fontname = fs.name or "unknown"
local rf = reported[fontname]
if not rf then rf = { } reported[fontname] = rf end
local rv = rf[vectorname]
if not rv then rv = { } rf[vectorname] = rv end
local ru = rv[unicode]
if not ru then
- logs.report("math virtual", "unicode point U+%05X has no index %04X in vector %s for font %s",unicode,index,vectorname,fontname)
+ if trace_virtual then
+ logs.report("math virtual", "unicode point U+%05X has no index %04X in vector %s for font %s",unicode,index,vectorname,fontname)
+ elseif not already_reported then
+ logs.report("math virtual", "the mapping is incomplete for '%s' at %s",name,number.topoints(size))
+ already_reported = true
+ end
rv[unicode] = true
end
else
@@ -466,35 +525,44 @@ function fonts.vf.math.define(specification,set)
--~ end
else
local fci = fc[index]
- 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
- characters[unicode] = {
- width = fci.width,
- height = fci.height,
- depth = fci.depth,
- italic = fci.italic,
- commands = ref,
- kerns = krn,
- next = offset + index,
- }
+ if not fci then
+--~ characters[unicode] = {
+--~ width = 0,
+--~ height = 0,
+--~ depth = 0,
+--~ index = 0,
+--~ }
else
- characters[unicode] = {
- width = fci.width,
- height = fci.height,
- depth = fci.depth,
- italic = fci.italic,
- commands = ref,
- next = offset + index,
- }
+ 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
+ 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
end
end
end
@@ -505,14 +573,18 @@ function fonts.vf.math.define(specification,set)
end
end
lst[#lst+1] = { id = font.nextid(), size = size }
- fonts.vf.math.alas(main,#lst,size)
+ if mp then -- weak catch
+ fonts.vf.math.alas(main,#lst,size)
+ end
if trace_virtual or trace_timings then
logs.report("math virtual","loading and virtualizing font %s at size %s took %0.3f seconds",name,size,os.clock()-start)
end
main.has_italic = true
main.type = "virtual" -- not needed
mathematics.scaleparameters(main,main,1)
-main.nomath = false
+ main.nomath = false
+--~ print(table.serialize(characters[0x222B]))
+--~ print(main.fontname,table.serialize(main.MathConstants))
return main
end
@@ -643,6 +715,10 @@ fonts.enc.math["tex-mr"] = {
-- [0x000A8] = 0x7F, -- [math]ddot
}
+fonts.enc.math["tex-mr-missing"] = {
+ [0x02236] = 0x3A, -- colon
+}
+
fonts.enc.math["tex-mi"] = {
[0x1D6E4] = 0x00, -- Gamma
[0x1D6E5] = 0x01, -- Delta
@@ -688,10 +764,10 @@ fonts.enc.math["tex-mi"] = {
[0x1D711] = 0x27, -- varphi (the other way around)
[0x021BC] = 0x28, -- leftharpoonup
[0x021BD] = 0x29, -- leftharpoondown
- [0x021C0] = 0x2A, -- righttharpoonup
+ [0x021C0] = 0x2A, -- rightharpoonup
[0x021C1] = 0x2B, -- rightharpoondown
- -- 0x2C, -- lhook (hook for combining arrows)
- -- 0x2D, -- rhook (hook for combining arrows)
+ [0xFE322] = 0x2C, -- lhook (hook for combining arrows)
+ [0xFE323] = 0x2D, -- rhook (hook for combining arrows)
[0x022B3] = 0x2E, -- triangleright (TODO: which one is right?)
[0x022B2] = 0x2F, -- triangleleft (TODO: which one is right?)
-- [0x00041] = 0x30, -- 0
@@ -712,84 +788,90 @@ fonts.enc.math["tex-mi"] = {
[0x0003E] = 0x3E, -- >
[0x022C6] = 0x3F, -- star
[0x02202] = 0x40, -- partial
--- [0x00041] = 0x41, -- A
+--
+ [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)
+}
+
+
+fonts.enc.math["tex-it"] = {
+-- [0x1D434] = 0x41, -- A
[0x1D6E2] = 0x41, -- Alpha
--- [0x00042] = 0x42, -- B
+-- [0x1D435] = 0x42, -- B
[0x1D6E3] = 0x42, -- Beta
--- [0x00043] = 0x43, -- C
--- [0x00044] = 0x44, -- D
--- [0x00045] = 0x45, -- E
+-- [0x1D436] = 0x43, -- C
+-- [0x1D437] = 0x44, -- D
+-- [0x1D438] = 0x45, -- E
[0x1D6E6] = 0x45, -- Epsilon
--- [0x00046] = 0x46, -- F
--- [0x00047] = 0x47, -- G
--- [0x00048] = 0x48, -- H
+-- [0x1D439] = 0x46, -- F
+-- [0x1D43A] = 0x47, -- G
+-- [0x1D43B] = 0x48, -- H
[0x1D6E8] = 0x48, -- Eta
--- [0x00049] = 0x49, -- I
+-- [0x1D43C] = 0x49, -- I
[0x1D6EA] = 0x49, -- Iota
--- [0x0004A] = 0x4A, -- J
--- [0x0004B] = 0x4B, -- K
+-- [0x1D43D] = 0x4A, -- J
+-- [0x1D43E] = 0x4B, -- K
[0x1D6EB] = 0x4B, -- Kappa
--- [0x0004C] = 0x4C, -- L
--- [0x0004D] = 0x4D, -- M
+-- [0x1D43F] = 0x4C, -- L
+-- [0x1D440] = 0x4D, -- M
[0x1D6ED] = 0x4D, -- Mu
--- [0x0004E] = 0x4E, -- N
+-- [0x1D441] = 0x4E, -- N
[0x1D6EE] = 0x4E, -- Nu
--- [0x0004F] = 0x4F, -- O
+-- [0x1D442] = 0x4F, -- O
[0x1D6F0] = 0x4F, -- Omicron
--- [0x00050] = 0x50, -- P
+-- [0x1D443] = 0x50, -- P
[0x1D6F2] = 0x50, -- Rho
--- [0x00051] = 0x51, -- Q
--- [0x00052] = 0x52, -- R
--- [0x00053] = 0x53, -- S
--- [0x00054] = 0x54, -- T
+-- [0x1D444] = 0x51, -- Q
+-- [0x1D445] = 0x52, -- R
+-- [0x1D446] = 0x53, -- S
+-- [0x1D447] = 0x54, -- T
[0x1D6F5] = 0x54, -- Tau
--- [0x00055] = 0x55, -- U
--- [0x00056] = 0x56, -- V
--- [0x00057] = 0x57, -- W
--- [0x00058] = 0x58, -- X
+-- [0x1D448] = 0x55, -- U
+-- [0x1D449] = 0x56, -- V
+-- [0x1D44A] = 0x57, -- W
+-- [0x1D44B] = 0x58, -- X
[0x1D6F8] = 0x58, -- Chi
--- [0x00059] = 0x59, -- Y
--- [0x0005A] = 0x5A, -- Z
- [0x1D6E7] = 0x5A, -- Zeta
- [0x0266D] = 0x5B, -- flat
- [0x0266E] = 0x5C, -- natural
- [0x0266F] = 0x5D, -- sharp
- [0x02323] = 0x5E, -- smile
- [0x02322] = 0x5F, -- frown
- [0x02113] = 0x60, -- ell
--- [0x00061] = 0x61, -- a
--- [0x00062] = 0x62, -- b
--- [0x00063] = 0x63, -- c
--- [0x00064] = 0x64, -- d
--- [0x00065] = 0x65, -- e
--- [0x00066] = 0x66, -- f
--- [0x00067] = 0x67, -- g
--- [0x00068] = 0x68, -- h
- [0x0210E] = 0x68, -- plant constant
--- [0x00069] = 0x69, -- i
--- [0x0006A] = 0x6A, -- j
--- [0x0006B] = 0x6B, -- k
--- [0x0006C] = 0x6C, -- l
--- [0x0006D] = 0x6D, -- m
--- [0x0006E] = 0x6E, -- n
--- [0x0006F] = 0x6F, -- o
+-- [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
--- [0x00070] = 0x70, -- p
--- [0x00071] = 0x71, -- q
--- [0x00072] = 0x72, -- r
--- [0x00073] = 0x73, -- s
--- [0x00074] = 0x74, -- t
--- [0x00075] = 0x75, -- u
--- [0x00076] = 0x76, -- v
--- [0x00077] = 0x77, -- w
--- [0x00078] = 0x78, -- x
--- [0x00079] = 0x79, -- y
--- [0x0007A] = 0x7A, -- z
- [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)
+-- [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
}
fonts.enc.math["tex-ss"] = { }
@@ -1279,12 +1361,12 @@ fonts.enc.math["tex-fraktur"] = {
-- now that all other vectors are defined ...
-fonts.vf.math.set_letters(fonts.enc.math, "tex-mi", 0x1D434, 0x1D44E)
-fonts.vf.math.set_letters(fonts.enc.math, "tex-ss", 0x1D5A0, 0x1D5BA)
-fonts.vf.math.set_letters(fonts.enc.math, "tex-tt", 0x1D670, 0x1D68A)
-fonts.vf.math.set_letters(fonts.enc.math, "tex-bf", 0x1D400, 0x1D41A)
-fonts.vf.math.set_letters(fonts.enc.math, "tex-bi", 0x1D468, 0x1D482)
-fonts.vf.math.set_letters(fonts.enc.math, "tex-fraktur", 0x1D504, 0x1D51E)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-it", 0x1D434, 0x1D44E)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-ss", 0x1D5A0, 0x1D5BA)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-tt", 0x1D670, 0x1D68A)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-bf", 0x1D400, 0x1D41A)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-bi", 0x1D468, 0x1D482)
+fonts.vf.math.set_letters(fonts.enc.math, "tex-fraktur", 0x1D504, 0x1D51E)
fonts.vf.math.set_letters(fonts.enc.math, "tex-fraktur-bold", 0x1D56C, 0x1D586)
fonts.vf.math.set_digits (fonts.enc.math, "tex-ss", 0x1D7E2)
@@ -1294,308 +1376,4 @@ fonts.vf.math.set_digits (fonts.enc.math, "tex-bf", 0x1D7CE)
-- fonts.vf.math.set_digits (fonts.enc.math, "tex-bi", 0x1D7CE)
-- todo: add ss, tt, bf etc vectors
--- we can make ss tt etc an option
-
--- rm-lmr5 : LMMathRoman5-Regular
--- rm-lmbx5 : LMMathRoman5-Bold ]
--- lmbsy5 : LMMathSymbols5-BoldItalic
--- lmsy5 : LMMathSymbols5-Italic
--- lmmi5 : LMMathItalic5-Italic
--- lmmib5 : LMMathItalic5-BoldItalic
-
-mathematics.make_font ( "lmroman5-math", {
- { name = "lmroman5-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr5.tfm", vector = "tex-mr" } ,
- { name = "lmmi5.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy5.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam5.tfm", vector = "tex-ma" },
- { name = "msbm5.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx5.tfm", vector = "tex-bf" } ,
- { name = "lmroman5-bold", vector = "tex-bf" } ,
- { name = "lmmib5.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm5.tfm", vector = "tex-fraktur", optional=true },
-} )
-
--- rm-lmr6 : LMMathRoman6-Regular
--- rm-lmbx6 : LMMathRoman6-Bold
--- lmsy6 : LMMathSymbols6-Italic
--- lmmi6 : LMMathItalic6-Italic
-
-mathematics.make_font ( "lmroman6-math", {
- { name = "lmroman6-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr6.tfm", vector = "tex-mr" } ,
- { name = "lmmi6.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy6.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam5.tfm", vector = "tex-ma" },
- { name = "msbm5.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx6.tfm", vector = "tex-bf" } ,
- { name = "lmroman6-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib5.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm5.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb5.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr7 : LMMathRoman7-Regular
--- rm-lmbx7 : LMMathRoman7-Bold
--- lmbsy7 : LMMathSymbols7-BoldItalic
--- lmsy7 : LMMathSymbols7-Italic
--- lmmi7 : LMMathItalic7-Italic
--- lmmib7 : LMMathItalic7-BoldItalic
-
-mathematics.make_font ( "lmroman7-math", {
- { name = "lmroman7-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr7.tfm", vector = "tex-mr" } ,
- { name = "lmmi7.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy7.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam7.tfm", vector = "tex-ma" },
- { name = "msbm7.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx7.tfm", vector = "tex-bf" } ,
- { name = "lmroman7-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib7.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm7.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb7.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr8 : LMMathRoman8-Regular
--- rm-lmbx8 : LMMathRoman8-Bold
--- lmsy8 : LMMathSymbols8-Italic
--- lmmi8 : LMMathItalic8-Italic
-
-mathematics.make_font ( "lmroman8-math", {
- { name = "lmroman8-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr8.tfm", vector = "tex-mr" } ,
- { name = "lmmi8.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy8.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam7.tfm", vector = "tex-ma" },
- { name = "msbm7.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx8.tfm", vector = "tex-bf" } ,
- { name = "lmroman8-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib7.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm7.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb7.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr9 : LMMathRoman9-Regular
--- rm-lmbx9 : LMMathRoman9-Bold
--- lmsy9 : LMMathSymbols9-Italic
--- lmmi9 : LMMathItalic9-Italic
-
-mathematics.make_font ( "lmroman9-math", {
- { name = "lmroman9-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr9.tfm", vector = "tex-mr" } ,
- { name = "lmmi9.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy9.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx9.tfm", vector = "tex-bf" } ,
- { name = "lmroman9-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans9-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono9-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr10 : LMMathRoman10-Regular
--- rm-lmbx10 : LMMathRoman10-Bold
--- lmbsy10 : LMMathSymbols10-BoldItalic
--- lmsy10 : LMMathSymbols10-Italic
--- lmex10 : LMMathExtension10-Regular
--- lmmi10 : LMMathItalic10-Italic
--- lmmib10 : LMMathItalic10-BoldItalic
-
-mathematics.make_font ( "lmroman10-math", {
- { name = "lmroman10-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr10.tfm", vector = "tex-mr" } ,
- { name = "lmmi10.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } ,
- { name = "lmroman10-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
-mathematics.make_font ( "lmroman10-boldmath", {
- { name = "lmroman10-bold.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr10.tfm", vector = "tex-mr" } ,
- { name = "lmmib10.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmbsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
--- copied from roman:
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } ,
- { name = "lmroman10-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr12 : LMMathRoman12-Regular
--- rm-lmbx12 : LMMathRoman12-Bold
--- lmmi12 : LMMathItalic12-Italic
-
-mathematics.make_font ( "lmroman12-math", {
- { name = "lmroman12-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr12.tfm", vector = "tex-mr" } ,
- { name = "lmmi12.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx12.tfm", vector = "tex-bf" } ,
- { name = "lmroman12-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans12-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono12-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- rm-lmr17 : LMMathRoman17-Regular
-
-mathematics.make_font ( "lmroman17-math", {
- { name = "lmroman17-regular.otf", features = "virtualmath", main = true },
- -- { name = "rm-lmr12.tfm", vector = "tex-mr" } ,
- { name = "lmmi12.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "lmsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
- -- { name = "rm-lmbx12.tfm", vector = "tex-bf" } ,
- { name = "lmroman12-bold.otf", vector = "tex-bf" } ,
- { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } ,
- { name = "lmsans17-regular.otf", vector = "tex-ss", optional=true },
- { name = "lmmono17-regular.otf", vector = "tex-tt", optional=true },
- { name = "eufm10.tfm", vector = "tex-fraktur", optional=true },
- { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true },
-} )
-
--- pxr/txr messes up the accents
-
-mathematics.make_font ( "px-math", {
- { name = "texgyrepagella-regular.otf", features = "virtualmath", main = true },
- { name = "rpxr.tfm", vector = "tex-mr" } ,
- { name = "rpxmi.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "pxsy.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "pxex.tfm", vector = "tex-ex", extension = true } ,
- { name = "pxsya.tfm", vector = "tex-ma" },
- { name = "pxsyb.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "tx-math", {
- { name = "texgyretermes-regular.otf", features = "virtualmath", main = true },
- { name = "rtxr.tfm", vector = "tex-mr" } ,
- { name = "rtxmi.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "txsy.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "txex.tfm", vector = "tex-ex", extension = true } ,
- { name = "txsya.tfm", vector = "tex-ma" },
- { name = "txsyb.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "iwona-math", {
- { name = "file:Iwona-Regular", features = "virtualmath", main = true },
- { name = "mi-iwonari.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "sy-iwonarz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "ex-iwonar.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "iwona-light-math", {
- { name = "file:IwonaLight-Regular", features = "virtualmath", main = true },
- { name = "mi-iwonali.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "sy-iwonalz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "ex-iwonal.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "iwona-medium-math", {
- { name = "file:IwonaMedium-Regular", features = "virtualmath", main = true },
- { name = "mi-iwonami.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "sy-iwonamz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "ex-iwonam.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "iwona-heavy-math", {
- { name = "file:IwonaHeavy-Regular", features = "virtualmath", main = true },
- { name = "mi-iwonahi.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "sy-iwonahz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } ,
- { name = "ex-iwonah.tfm", vector = "tex-ex", extension = true } ,
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
--- not ok, we need adapted vectors !
-
-mathematics.make_font ( "mathtimes-math", {
- { name = "file:texgyretermes-regular.otf", features = "virtualmath", main = true },
- { name = "mtmiz.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "mtsyn.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
- { name = "mtex.tfm", vector = "tex-ex", extension = true },
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "lucida-math", {
- { name = "lbr.afm", features = "virtualmath", main = true },
- { name = "hlcrim.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "hlcry.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
- { name = "hlcrv.tfm", vector = "tex-ex", extension = true },
- { name = "hlcra.tfm", vector = "tex-ma" },
- { name = "hlcrm.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "charter-math", {
- { name = "file:bchr8a", features = "virtualmath", main = true },
--- { name = "md-chr7m.tfm", vector = "tex-mr" },
- { name = "md-chri7m.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "md-chr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
- { name = "md-chr7v.tfm", vector = "tex-ex", extension = true },
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "garamond-math", {
- { name = "file:ugmr8y", features = "virtualmath", main = true },
--- { name = "md-gmr7m.tfm", vector = "tex-mr" },
- { name = "md-gmri7m.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "md-gmr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
- { name = "md-gmr7v.tfm", vector = "tex-ex", extension = true },
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
-
-mathematics.make_font ( "utopia-math", {
- { name = "file:putr8y", features = "virtualmath", main = true },
--- { name = "md-utr7m.tfm", vector = "tex-mr" },
- { name = "md-utri7m.tfm", vector = "tex-mi", skewchar=0x7F },
- { name = "md-utr7y.tfm", vector = "tex-sy", skewchar=0x30, parameters = true },
- { name = "md-utr7v.tfm", vector = "tex-ex", extension = true },
- { name = "msam10.tfm", vector = "tex-ma" },
- { name = "msbm10.tfm", vector = "tex-mb" },
-} )
+-- todo: we can make ss tt etc an option
diff --git a/Master/texmf-dist/tex/context/base/meta-dum.tex b/Master/texmf-dist/tex/context/base/meta-dum.tex
index 1d03fb16d2d..bc19f3c5fa8 100644
--- a/Master/texmf-dist/tex/context/base/meta-dum.tex
+++ b/Master/texmf-dist/tex/context/base/meta-dum.tex
@@ -70,6 +70,8 @@
[\c!reduction=0,
\c!text=\v!yes]
+\let\normalexternalfigurereplacement\externalfigurereplacement
+
\def\externalfigurereplacement#1#2#3%
{\getpaletsize[placeholder]%
\ifx\figurereplacementcycle\relax
diff --git a/Master/texmf-dist/tex/context/base/meta-fig.mkiv b/Master/texmf-dist/tex/context/base/meta-fig.mkiv
index b3abc9d9edc..4738316da69 100644
--- a/Master/texmf-dist/tex/context/base/meta-fig.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-fig.mkiv
@@ -43,7 +43,7 @@
\presetlocalframed[\??mg]
-\def\setupMPpage
+\unexpanded\def\setupMPpage
{\dodoubleargument\getparameters[\??mg]}
\def\startMPpage
diff --git a/Master/texmf-dist/tex/context/base/meta-fun.lua b/Master/texmf-dist/tex/context/base/meta-fun.lua
index 84d4afb195a..fef2aa12b87 100644
--- a/Master/texmf-dist/tex/context/base/meta-fun.lua
+++ b/Master/texmf-dist/tex/context/base/meta-fun.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['meta-fun'] = {
version = 1.001,
- comment = "companion to meta-fun.tex",
+ comment = "companion to meta-fun.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files",
diff --git a/Master/texmf-dist/tex/context/base/meta-ini.mkii b/Master/texmf-dist/tex/context/base/meta-ini.mkii
index f9d09704940..e7c6d218e1f 100644
--- a/Master/texmf-dist/tex/context/base/meta-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/meta-ini.mkii
@@ -717,6 +717,14 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/meta-ini.mkiv b/Master/texmf-dist/tex/context/base/meta-ini.mkiv
index ff4d48c1db2..61acbca32c7 100644
--- a/Master/texmf-dist/tex/context/base/meta-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-ini.mkiv
@@ -87,7 +87,7 @@
\def\MPinstancetoks{\csname\@@MPF::\currentMPgraphicinstance\endcsname}
-\def\defineMPinstance
+\unexpanded\def\defineMPinstance
{\dodoubleargument\dodefineMPinstance}
\def\dodefineMPinstance[#1][#2]%
@@ -111,7 +111,12 @@
\else
\edef\currentMPgraphicinstance{#1}%
\fi
- \edef\currentMPgraphicformat{\csname\@@MPF\currentMPgraphicinstance\s!format\endcsname}}
+ \edef\currentMPgraphicformat
+ {\ifcsname\@@MPF\currentMPgraphicinstance\s!format\endcsname
+ \csname\@@MPF\currentMPgraphicinstance\s!format\endcsname
+ \else
+ \defaultMPgraphicinstance
+ \fi}}
\def\currentMPgraphicinstance{\defaultMPgraphicinstance}
\def\currentMPgraphicformat {\currentMPgraphicinstance}
@@ -133,9 +138,14 @@
\def\MPaskedfigure{false}
-\long\def\processMPgraphic#1% todo: extensions and inclusions outside beginfig
- {\begingroup % needed?
-\forgetall
+\def\currentMPinitializations
+ {\ifconditional\includeMPinitializations\the\MPinitializations;\fi\theMPrandomseed;}
+
+\def\currentMPpreamble
+ {\ifconditional\includeMPextensions\the\MPextensions;\the\MPuserinclusions;\fi\the\MPinstancetoks;}
+
+\def\dostartcurrentMPgraphic
+ {\begingroup
\enableincludeMPgraphics
\the\everyMPgraphic
\presetMPdefinitions
@@ -146,18 +156,28 @@
{\setfalse\includeMPextensions}%
\doifelsevalue{\@@MPF\currentMPgraphicinstance\s!initializations}\v!yes
{\settrue \includeMPinitializations}%
- {\setfalse\includeMPinitializations}%
+ {\setfalse\includeMPinitializations}}
+
+\def\dostopcurrentMPgraphic
+ {\global\MPinstancetoks\emptytoks
+ \global\settrue\METAFUNinitialized % becomes obsolete
+ \endgroup}
+
+\unexpanded\long\def\processMPgraphic#1% todo: extensions and inclusions outside beginfig
+ {\dostartcurrentMPgraphic
+ \forgetall
\setbox\MPgraphicbox\hbox\bgroup
- \normalexpanded{\noexpand\ctxlua{metapost.graphic("\currentMPgraphicinstance", "\currentMPgraphicformat",
- \!!bs\ifconditional\includeMPinitializations\the\MPinitializations;\fi\theMPrandomseed;#1;\!!es,
- \!!bs\ifconditional\includeMPextensions\the\MPextensions;\the\MPuserinclusions;\fi\the\MPinstancetoks;\!!es,
- \MPaskedfigure
+ \normalexpanded{\noexpand\ctxlua{metapost.graphic(
+ "\currentMPgraphicinstance",
+ "\currentMPgraphicformat",
+ \!!bs#1\!!es,
+ \!!bs\currentMPinitializations\!!es,
+ \!!bs\currentMPpreamble\!!es,
+ \MPaskedfigure
)}}%
\egroup
- \global\MPinstancetoks\emptytoks
- \global\settrue\METAFUNinitialized % becomes obsolete
\placeMPgraphic
- \endgroup}
+ \dostopcurrentMPgraphic}
\newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default
@@ -230,7 +250,7 @@
\def\getMPdrawing
{\ifMPdrawingdone
- \expandafter\processMPgraphic\expandafter{\MPdrawingdata}%
+ \expandafter\processMPgraphic\expandafter{\MPdrawingdata}% is this expansion still needed?
\fi}
\def\startMPdrawing
@@ -247,19 +267,26 @@
\let\stopMPdrawing\relax
-\long\def\startMPclip#1#2\stopMPclip
- {\long\setgvalue{MPC:#1}{\ctxlua{metapost.getclippath(\!!bs#2\!!es)}}}
-
\let\stopMPclip\relax
+\long\def\startMPclip#1#2\stopMPclip % todo: store at the lua end or just store less
+ {\long\setgvalue{MPC:#1}{#2}}
+
\def\grabMPclippath#1#2#3#4#5% #5 is alternative
{\begingroup
\edef\width {#3\space}\let\overlaywidth \width
\edef\height{#4\space}\let\overlayheight\height
\ifcsname MPC:#1\endcsname
- \xdef\MPclippath{\getvalue{MPC:#1}}%
+ \dostartcurrentMPgraphic
+ \xdef\MPclippath{\normalexpanded{\noexpand\ctxlua{metapost.theclippath(
+ "\currentMPgraphicinstance",
+ "\currentMPgraphicformat",
+ \!!bs\getvalue{MPC:#1}\!!es,
+ \!!bs\currentMPinitializations\!!es,
+ \!!bs\currentMPpreamble\!!es
+ )}}}%
+ \dostopcurrentMPgraphic
\ifx\MPclippath\empty\xdef\MPclippath{#5}\fi
- \setxvalue{MPC:#1}{\MPclippath}%
\else
\xdef\MPclippath{#5}%
\fi
@@ -325,7 +352,7 @@
\def\@@meta{meta:}
-\def\setupMPvariables
+\unexpanded\def\setupMPvariables
{\dodoubleempty\dosetupMPvariables}
\def\dosetupMPvariables[#1][#2]%
@@ -421,7 +448,7 @@
\let\MPshiftdrawingtrue \ignoreMPboxdepth
\let\MPshiftdrawingfalse\normalMPboxdepth
-\def\placeMPgraphic
+\unexpanded\def\placeMPgraphic
{\ifcase\MPboxmode
\or % 1
\doobeyMPboxdepth
@@ -435,15 +462,14 @@
\xdef\MPlly{#3}% ugly as well
\xdef\MPurx{#4}%
\xdef\MPury{#5}%
- \getobject{MP}{#1}}
+ \hbox{\forcecolorhack\getobject{MP}{#1}}} % else no proper color intent
\long\def\handleuniqueMPgraphic#1#2#3%
{\begingroup
\def\@@meta{#1:}%
\extendMPoverlaystamp{#2}% incl prepare
\ifcsname\@@MPG\overlaystamp:#1\endcsname\else
- \enableincludeMPgraphics
-% \forgetall
+ \enableincludeMPgraphics % redundant
\global\advance\MPobjectcounter\plusone
\setobject{MP}{\number\MPobjectcounter}\hbox{\processMPgraphic{#3}}% was vbox, graphic must end up as hbox
\setxvalue{\@@MPG\overlaystamp:#1}{\noexpand\reuseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}%
@@ -451,7 +477,7 @@
\getvalue{\@@MPG\overlaystamp:#1}%
\endgroup}
-\long\def\startuniqueMPgraphic
+\long\unexpanded\def\startuniqueMPgraphic
{\dodoublegroupempty\dostartuniqueMPgraphic}
\long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic%
@@ -470,20 +496,19 @@
\long\def\handleuseMPgraphic#1#2#3%
{\begingroup
-% \forgetall % check this
\def\@@meta{#1:}%
\prepareMPvariables{#2}%
- \enableincludeMPgraphics
+ \enableincludeMPgraphics % redundant
\processMPgraphic{#3}%
\endgroup}
-\long\def\startuseMPgraphic
+\long\unexpanded\def\startuseMPgraphic
{\dodoublegroupempty\dostartuseMPgraphic}
\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic
{\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}}
-\long\def\startusableMPgraphic % redundant but handy
+\long\unexpanded\def\startusableMPgraphic % redundant but handy
{\dodoublegroupempty\dostartusableMPgraphic}
\long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic
@@ -496,14 +521,14 @@
{\begingroup
\def\@@meta{#1:}%
\prepareMPvariables{#2}%
- \enableincludeMPgraphics
+ \enableincludeMPgraphics % redundant
\global\advance\MPobjectcounter\plusone
\setobject{MP}{\number\MPobjectcounter}\hbox{\processMPgraphic{#3}}% was vbox, graphic must end up as hbox
\setxvalue{\@@MPG#1}{\noexpand\reuseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}%
\getvalue{\@@MPG#1}%
\endgroup}
-\long\def\startreusableMPgraphic
+\long\unexpanded\def\startreusableMPgraphic
{\dodoublegroupempty\dostartreusableMPgraphic}
\long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic
@@ -542,7 +567,7 @@
\def\overlaypagestamp
{\MPpageprefix\overlaywidth:\overlayheight:\overlaydepth:\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
-\long\def\startuniqueMPpagegraphic
+\long\unexpanded\def\startuniqueMPpagegraphic
{\dodoublegroupempty\dostartuniqueMPpagegraphic}
\long\def\dostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic
@@ -774,7 +799,7 @@
{\iffirstargument
\startuseMPgraphic{#1}#2\stopuseMPgraphic
\else
- \startuseMPgraphic{mprun}#1\stopuseMPgraphic
+ \startuseMPgraphic{mprun}#2\stopuseMPgraphic
\fi}
% for old time sake
@@ -1057,37 +1082,13 @@
%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\unexpanded\def\startMPcolor#1\stopMPcolor
+ {\writestatus \m!metapost % eventually this placeholder will go away
+ {\string\startMPcolor...\stopMPcolor\space is obsolete,\space
+ use \string\defineintermediatecolor\space instead}}
-\long\def\dostartMPcolor[#1][#2]#3\stopMPcolor % slow but sometimes handy
- {\startnointerference
- \def\handleMPgraycolor{\normalexpanded{\noexpand\defineglobalcolor[#1][s=\!MPgMPa1,#2]}}%
- \def\handleMPrgbcolor {\normalexpanded{\noexpand\defineglobalcolor[#1][r=\!MPgMPa1,g=\!MPgMPa2,b=\!MPgMPa3,#2]}}%
- \def\handleMPcmykcolor{\normalexpanded{\noexpand\defineglobalcolor[#1][c=\!MPgMPa1,m=\!MPgMPa2,y=\!MPgMPa3,k=\!MPgMPa4,#2]}}%
- \processMPgraphic{#3}%
- \stopnointerference}
+\let\stopMPcolor\relax
%D New:
@@ -1171,10 +1172,10 @@
\reuseMPgraphic{\@@MPG#1@S@}%
\fi}
-\def\startstaticMPfigure#1#2\stopstaticMPfigure
+\unexpanded\def\startstaticMPfigure#1#2\stopstaticMPfigure
{\startreusableMPgraphic{\@@MPG#1@S@}#2\stopreusableMPgraphic}
-\long\def\startstaticMPgraphic
+\long\unexpanded\def\startstaticMPgraphic
{\dodoublegroupempty\dostartstaticMPgraphic}
\long\def\dostartstaticMPgraphic#1#2#3\stopstaticMPgraphic
@@ -1247,13 +1248,13 @@
\stopMPinitializations
%D \macros
-%D {\setupMPgraphics}
+%D {setupMPgraphics}
%D
%D Here is a generic setup command:
\newtoks \everysetupMPgraphics
-\def\setupMPgraphics[#1]%
+\unexpanded\def\setupMPgraphics[#1]%
{\getparameters[\??mp][#1]%
\the\everysetupMPgraphics}
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.lua b/Master/texmf-dist/tex/context/base/meta-pdf.lua
index 056d1052f24..23f8d4de05d 100644
--- a/Master/texmf-dist/tex/context/base/meta-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/meta-pdf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['meta-pdf'] = {
version = 1.001,
- comment = "companion to meta-pdf.tex",
+ comment = "companion to meta-pdf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -10,10 +10,10 @@ if not modules then modules = { } end modules ['meta-pdf'] = {
-- meta-pdh.lua but since we no longer want to overload functione we use
-- more locals now. This module keeps changing as it is also a testbed.
-local concat, format, gsub, find = table.concat, string.format, string.gsub, string.find
-local byte, round = string.byte, math.round
-local texsprint = tex.sprint
-local ctxcatcodes = tex.ctxcatcodes
+local concat, format, gsub, find, byte, gmatch, match = table.concat, string.format, string.gsub, string.find, string.byte, string.gmatch, string.match
+local lpegmatch = lpeg.match
+local round = math.round
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
local pdfrgbcode = lpdf.rgbcode
local pdfcmykcode = lpdf.cmykcode
@@ -47,8 +47,8 @@ resetall()
-- todo: collect and flush packed using pdfliteral node injection but we're
-- in no hurry as this kind of conversion does not happen that often in mkiv
-local function pdfcode(str)
- texsprint(ctxcatcodes,"\\pdfliteral{" .. str .. "}")
+local function pdfcode(str) -- could be a node.write instead
+ texsprint(ctxcatcodes,"\\pdfliteral{",str,"}")
end
local function texcode(str)
@@ -390,7 +390,7 @@ local text = lpegCc("{") * (
local package = lpegCs(spec + text^0)
function mps.fshow(str,font,scale) -- lpeg parser
- mps.textext(font,scale,package:match(str))
+ mps.textext(font,scale,lpegmatch(package,str))
end
local cnumber = lpegC(number)
@@ -510,9 +510,9 @@ local captures_new = ( space + verbose + procset + preamble )^0
local function parse(m_data)
if find(m_data,"%%%%BeginResource: procset mpost") then
- captures_new:match(m_data)
+ lpegmatch(captures_new,m_data)
else
- captures_old:match(m_data)
+ lpegmatch(captures_old,m_data)
end
end
diff --git a/Master/texmf-dist/tex/context/base/meta-pdh.lua b/Master/texmf-dist/tex/context/base/meta-pdh.lua
index ef15c6a1145..05cdfc176d0 100644
--- a/Master/texmf-dist/tex/context/base/meta-pdh.lua
+++ b/Master/texmf-dist/tex/context/base/meta-pdh.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['meta-pdf'] = {
version = 1.001,
- comment = "companion to meta-pdf.tex",
+ comment = "companion to meta-pdf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -22,10 +22,10 @@ if not modules then modules = { } end modules ['meta-pdf'] = {
-- only needed for mp output on disk
-local concat, format = table.concat, string.format
-
-local texsprint = tex.sprint
-local ctxcatcodes = tex.ctxcatcodes
+local concat, format, find, gsub, gmatch = table.concat, string.format, string.find, string.gsub, string.gmatch
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local tostring, tonumber, select = tostring, tonumber, select
+local lpegmatch = lpeg.match
mptopdf = { }
mptopdf.parsers = { }
@@ -70,65 +70,65 @@ mptopdf.descapes = {
}
function mptopdf.descape(str)
- str = str:gsub("\\(%d%d%d)",function(n)
+ str = gsub(str,"\\(%d%d%d)",function(n)
return "\\char" .. tonumber(n,8) .. " "
end)
- return str:gsub("\\([%(%)\\])",mptopdf.descapes)
+ return gsub(str,"\\([%(%)\\])",mptopdf.descapes)
end
function mptopdf.steps.descape(str)
- str = str:gsub("\\(%d%d%d)",function(n)
+ str = gsub(str,"\\(%d%d%d)",function(n)
return "\\\\char" .. tonumber(n,8) .. " "
end)
- return str:gsub("\\([%(%)\\])",mptopdf.descapes)
+ return gsub(str,"\\([%(%)\\])",mptopdf.descapes)
end
function mptopdf.steps.strip() -- .3 per expr
- mptopdf.data = mptopdf.data:gsub("^(.-)%%+Page:.-%c+(.*)%s+%a+%s+%%+EOF.*$", function(preamble, graphic)
+ mptopdf.data = gsub(mptopdf.data,"^(.-)%%+Page:.-%c+(.*)%s+%a+%s+%%+EOF.*$", function(preamble, graphic)
local bbox = "0 0 0 0"
- for b in preamble:gmatch("%%%%%a+oundingBox: +(.-)%c+") do
+ for b in gmatch(preamble,"%%%%%a+oundingBox: +(.-)%c+") do
bbox = b
end
- local name, version = preamble:gmatch("%%%%Creator: +(.-) +(.-) ")
+ local name, version = gmatch(preamble,"%%%%Creator: +(.-) +(.-) ")
mptopdf.version = tostring(version or "0")
- if preamble:find("/hlw{0 dtransform") then
+ if find(preamble,"/hlw{0 dtransform") then
mptopdf.shortcuts = true
end
-- the boundingbox specification needs to come before data, well, not really
return bbox .. " boundingbox\n" .. "\nbegindata\n" .. graphic .. "\nenddata\n"
end, 1)
- mptopdf.data = mptopdf.data:gsub("%%%%MetaPostSpecials: +(.-)%c+", "%1 specials\n", 1)
- mptopdf.data = mptopdf.data:gsub("%%%%MetaPostSpecial: +(.-)%c+", "%1 special\n")
- mptopdf.data = mptopdf.data:gsub("%%.-%c+", "")
+ mptopdf.data = gsub(mptopdf.data,"%%%%MetaPostSpecials: +(.-)%c+", "%1 specials\n", 1)
+ mptopdf.data = gsub(mptopdf.data,"%%%%MetaPostSpecial: +(.-)%c+", "%1 special\n")
+ mptopdf.data = gsub(mptopdf.data,"%%.-%c+", "")
end
function mptopdf.steps.cleanup()
if not mptopdf.shortcuts then
- mptopdf.data = mptopdf.data:gsub("gsave%s+fill%s+grestore%s+stroke", "both")
- mptopdf.data = mptopdf.data:gsub("([%d%.]+)%s+([%d%.]+)%s+dtransform%s+exch%s+truncate%s+exch%s+idtransform%s+pop%s+setlinewidth", function(wx,wy)
+ mptopdf.data = gsub(mptopdf.data,"gsave%s+fill%s+grestore%s+stroke", "both")
+ mptopdf.data = gsub(mptopdf.data,"([%d%.]+)%s+([%d%.]+)%s+dtransform%s+exch%s+truncate%s+exch%s+idtransform%s+pop%s+setlinewidth", function(wx,wy)
if tonumber(wx) > 0 then return wx .. " setlinewidth" else return wy .. " setlinewidth" end
end)
- mptopdf.data = mptopdf.data:gsub("([%d%.]+)%s+([%d%.]+)%s+dtransform%s+truncate%s+idtransform%s+setlinewidth%s+pop", function(wx,wy)
+ mptopdf.data = gsub(mptopdf.data,"([%d%.]+)%s+([%d%.]+)%s+dtransform%s+truncate%s+idtransform%s+setlinewidth%s+pop", function(wx,wy)
if tonumber(wx) > 0 then return wx .. " setlinewidth" else return wy .. " setlinewidth" end
end)
end
end
function mptopdf.steps.convert()
- mptopdf.data = mptopdf.data:gsub("%c%((.-)%) (.-) (.-) fshow", function(str,font,scale)
+ mptopdf.data = gsub(mptopdf.data,"%c%((.-)%) (.-) (.-) fshow", function(str,font,scale)
mptopdf.texts[mptopdf.texts+1] = {mptopdf.steps.descape(str), font, scale}
return "\n" .. #mptopdf.texts .. " textext"
end)
- mptopdf.data = mptopdf.data:gsub("%[%s*(.-)%s*%]", function(str)
- return str:gsub("%s+"," ")
+ mptopdf.data = gsub(mptopdf.data,"%[%s*(.-)%s*%]", function(str)
+ return gsub(str,"%s+"," ")
end)
local t
- mptopdf.data = mptopdf.data:gsub("%s*([^%a]-)%s*(%a+)", function(args,cmd)
+ mptopdf.data = gsub(mptopdf.data,"%s*([^%a]-)%s*(%a+)", function(args,cmd)
if cmd == "textext" then
t = mptopdf.texts[tonumber(args)]
return "mps.textext(" .. "\"" .. t[2] .. "\"," .. t[3] .. ",\"" .. t[1] .. "\")\n"
else
- return "mps." .. cmd .. "(" .. args:gsub(" +",",") .. ")\n"
+ return "mps." .. cmd .. "(" .. gsub(args," +",",") .. ")\n"
end
end)
end
@@ -166,7 +166,7 @@ function mptopdf.flushconcat()
end
function mptopdf.flushpath(cmd)
- -- faster: no local function and ipairs
+ -- faster: no local function and loop
if #mptopdf.stack.path > 0 then
local path = { }
if mptopdf.stack.concat then
@@ -445,7 +445,7 @@ do -- assumes \let\c\char
local package = lpeg.Cs(spec + text^0)
function mps.fshow(str,font,scale) -- lpeg parser
- mps.textext(font,scale,package:match(str))
+ mps.textext(font,scale,lpegmatch(package,str))
end
end
@@ -579,10 +579,10 @@ do
local captures_new = ( space + procset + preamble + verbose )^0
function mptopdf.parsers.lpeg()
- if mptopdf.data:find("%%%%BeginResource: procset mpost") then
- captures_new:match(mptopdf.data)
+ if find(mptopdf.data,"%%%%BeginResource: procset mpost") then
+ lpegmatch(captures_new,mptopdf.data)
else
- captures_old:match(mptopdf.data)
+ lpegmatch(captures_old,mptopdf.data)
end
end
diff --git a/Master/texmf-dist/tex/context/base/meta-pdh.mkiv b/Master/texmf-dist/tex/context/base/meta-pdh.mkiv
index 0736598cf35..7cdd1471f67 100644
--- a/Master/texmf-dist/tex/context/base/meta-pdh.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-pdh.mkiv
@@ -277,7 +277,7 @@
%
% \def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments}
%
-% \def\defineMPspecial#1#2%
+% \unexpanded\def\defineMPspecial#1#2%
% {\setvalue{\@@MPSK\@@MPSK#1}{#2}}
%D Special number~1 is dedicated to \CMYK\ support. If you
diff --git a/Master/texmf-dist/tex/context/base/meta-tex.mkii b/Master/texmf-dist/tex/context/base/meta-tex.mkii
index bf733d55019..190a694d9b1 100644
--- a/Master/texmf-dist/tex/context/base/meta-tex.mkii
+++ b/Master/texmf-dist/tex/context/base/meta-tex.mkii
@@ -103,12 +103,13 @@
\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
- {\setnormalcatcodes
- \endlinechar\minusone
- \everyeof\emptytoks
- %\def\ascii{#3}\scantokens\expandafter{\ascii}}%
- \ifcase\TeXtextcolormode
+ {\ifcase\TeXtextcolormode
\scantokens{\executeifdefined{textext@@#1}\firstofoneargument{#3}}%
\else
\localcolortrue
diff --git a/Master/texmf-dist/tex/context/base/meta-tex.mkiv b/Master/texmf-dist/tex/context/base/meta-tex.mkiv
index ab4f93daed5..e35f9538567 100644
--- a/Master/texmf-dist/tex/context/base/meta-tex.mkiv
+++ b/Master/texmf-dist/tex/context/base/meta-tex.mkiv
@@ -47,7 +47,7 @@
% draw \sometxt[framed]{black} rotated 45 ;
% \stopMPcode
-\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}\setvalue{@@st@@[#1] }{#2}} % we don't grab spaces after [#1]
+\unexpanded\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}\setvalue{@@st@@[#1] }{#2}} % we don't grab spaces after [#1]
\long\def\sometxt#1#{\dosometxt{#1}} % grab optional [args]
diff --git a/Master/texmf-dist/tex/context/base/meta-txt.tex b/Master/texmf-dist/tex/context/base/meta-txt.tex
index 18b6d206994..474253a4052 100644
--- a/Master/texmf-dist/tex/context/base/meta-txt.tex
+++ b/Master/texmf-dist/tex/context/base/meta-txt.tex
@@ -24,8 +24,7 @@
% textext ipv btex ... etex
-\ifx\undefined\MPtoks \newtoks\MPtoks \fi
-\ifx\undefined\MPnox \newbox \MPbox \fi
+% we need a proper prefix here
\unprotect
@@ -37,15 +36,18 @@
% \def\newchar#1{\chardef#1=0 }
-\newdimen\parwidth
-\newdimen\parheight
-\newdimen\parvoffset
-\newdimen\parhoffset
-\newcount\parlines
-\newtoks \partoks
-\newbox \shapetextbox
-\newif \ifparseries
-\chardef \parfirst=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
diff --git a/Master/texmf-dist/tex/context/base/metatex.tex b/Master/texmf-dist/tex/context/base/metatex.tex
index df674c11ac0..e90af709c0b 100644
--- a/Master/texmf-dist/tex/context/base/metatex.tex
+++ b/Master/texmf-dist/tex/context/base/metatex.tex
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D We can experiment here with runtime loading, id est no longer
+%D use a format. However, we still need a stub then but it could
+%D as well be luatools (mtxrun) itself then.
+
%D This format is just a minimal layer on top of the \LUATEX\
%D engine and will not provide high level functionality. It can
%D be used as basis for dedicated (specialized) macro packages.
@@ -35,9 +39,18 @@
\ifx\normalinput\undefined \let\normalinput\input \fi
-\def\loadcorefile#1{\normalinput#1\relax}
+\def\loadcorefile#1{\normalinput#1.tex \relax}
+\def\loadmarkfile#1{\normalinput#1.mkiv\relax}
+
+\loadcorefile{syst-ini}
+
+\ifnum\luatexversion<60 % also change message
+ \writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.60!}
+ \expandafter\end
+\fi
+
+\newtoks\metatexversiontoks \metatexversiontoks\expandafter{\metatexversion} % at the lua end
-\loadcorefile{syst-ini} % some basic commands and allocations that are expected down the line
\loadcorefile{syst-pln} % plain tex initializations of internal registers (no further code)
\loadmarkfile{luat-cod} %
@@ -46,11 +59,11 @@
% needs stripping:
-\loadcorefile{catc-ini.mkiv} % catcode table management
-\loadcorefile{catc-act.tex} % active character definition mechanisms
-\loadcorefile{catc-def.tex} % some generic catcode tables
-\loadcorefile{catc-ctx.tex} % a couple of context specific tables but expected by later modules
-\loadcorefile{catc-sym.tex} % some definitions related to \letter<tokens>
+\loadmarkfile{catc-ini} % catcode table management
+\loadcorefile{catc-act} % active character definition mechanisms
+\loadcorefile{catc-def} % some generic catcode tables
+\loadcorefile{catc-ctx} % a couple of context specific tables but expected by later modules
+\loadcorefile{catc-sym} % some definitions related to \letter<tokens>
% helpers, maybe less
diff --git a/Master/texmf-dist/tex/context/base/mlib-ctx.lua b/Master/texmf-dist/tex/context/base/mlib-ctx.lua
index 821b702c601..cc5682e6fdc 100644
--- a/Master/texmf-dist/tex/context/base/mlib-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mlib-ctx.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['mlib-ctx'] = {
version = 1.001,
- comment = "companion to mlib-ctx.tex",
+ 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",
@@ -11,12 +11,32 @@ if not modules then modules = { } end modules ['mlib-ctx'] = {
local format, join = string.format, table.concat
local sprint = tex.sprint
+local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
+
metapost = metapost or {}
metapost.defaultformat = "metafun"
-function metapost.graphic(instance,mpsformat,str,preamble,askedfig)
+function metapost.graphic(instance,mpsformat,str,initializations,preamble,askedfig)
local mpx = metapost.format(instance,mpsformat or metapost.defaultformat)
- metapost.graphic_base_pass(mpx,str,preamble,askedfig)
+ metapost.graphic_base_pass(mpx,str,initializations,preamble,askedfig)
+end
+
+function metapost.getclippath(instance,mpsformat,data,initializations,preamble)
+ local mpx = metapost.format(instance,mpsformat or metapost.defaultformat)
+ if mpx and data then
+ starttiming(metapost)
+ starttiming(metapost.exectime)
+ local result = mpx:execute(format("%s;beginfig(1);%s;%s;endfig;",preamble or "",initializations or "",data))
+ stoptiming(metapost.exectime)
+ if result.status > 0 then
+ logs.report("metafun", "%s: %s", result.status, result.error or result.term or result.log)
+ result = nil
+ else
+ result = metapost.filterclippath(result)
+ end
+ stoptiming(metapost)
+ return result
+ end
end
function metapost.filterclippath(result)
@@ -26,16 +46,25 @@ function metapost.filterclippath(result)
local figure = figures[1]
local objects = figure:objects()
if objects then
+ local lastclippath
for o=1,#objects do
local object = objects[o]
if object.type == "start_clip" then
- return join(metapost.flushnormalpath(object.path,{ }),"\n")
+ lastclippath = object.path
end
end
+ return lastclippath
end
end
end
- return ""
+end
+
+function metapost.theclippath(...)
+ local result = metapost.getclippath(...)
+ if result then -- we could just print the table
+ result = join(metapost.flushnormalpath(result),"\n")
+ sprint(result)
+ end
end
statistics.register("metapost processing time", function()
diff --git a/Master/texmf-dist/tex/context/base/mlib-pdf.lua b/Master/texmf-dist/tex/context/base/mlib-pdf.lua
index 38b61b0ba97..352070408c1 100644
--- a/Master/texmf-dist/tex/context/base/mlib-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/mlib-pdf.lua
@@ -1,12 +1,12 @@
if not modules then modules = { } end modules ['mlib-pdf'] = {
version = 1.001,
- comment = "companion to mlib-ctx.tex",
+ 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 format, concat = string.format, table.concat
+local format, concat, gsub = string.format, table.concat, string.gsub
local texsprint = tex.sprint
local abs, sqrt, round = math.abs, math.sqrt, math.round
@@ -119,7 +119,7 @@ function metapost.flushers.pdf.flushfigure(pdfliterals) -- table
end
function metapost.flushers.pdf.textfigure(font,size,text,width,height,depth) -- we could save the factor
- text = text:gsub(".","\\hbox{%1}") -- kerning happens in metapost (i have to check if this is true for mplib)
+ text = gsub(text,".","\\hbox{%1}") -- kerning happens in metapost (i have to check if this is true for mplib)
texsprint(ctxcatcodes,format("\\MPLIBtextext{%s}{%s}{%s}{%s}{%s}",font,size,text,0,-number.dimenfactors.bp*depth))
end
@@ -155,6 +155,7 @@ local function curved(ith,pth)
end
local function flushnormalpath(path, t, open)
+ t = t or { }
local pth, ith
for i=1,#path do
pth = path[i]
@@ -183,6 +184,7 @@ local function flushnormalpath(path, t, open)
end
local function flushconcatpath(path, t, open)
+ t = t or { }
t[#t+1] = format("%f %f %f %f %f %f cm", sx, rx, ry, sy, tx ,ty)
local pth, ith
for i=1,#path do
diff --git a/Master/texmf-dist/tex/context/base/mlib-pps.lua b/Master/texmf-dist/tex/context/base/mlib-pps.lua
index cf4fe69bedf..8b36660d350 100644
--- a/Master/texmf-dist/tex/context/base/mlib-pps.lua
+++ b/Master/texmf-dist/tex/context/base/mlib-pps.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['mlib-pps'] = { -- prescript, postscripts and specials
version = 1.001,
- comment = "companion to mlib-ctx.tex",
+ 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",
@@ -8,10 +8,15 @@ if not modules then modules = { } end modules ['mlib-pps'] = { -- prescript, pos
-- current limitation: if we have textext as well as a special color then due to
-- prescript/postscript overload we can have problems
+--
+-- todo: report max textexts
local format, gmatch, concat, round, match = string.format, string.gmatch, table.concat, math.round, string.match
local sprint = tex.sprint
local tonumber, type = tonumber, type
+local lpegmatch = lpeg.match
+local texbox = tex.box
+local copy_list = node.copy_list
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
@@ -119,7 +124,7 @@ function metapost.specials.register(str) -- only colors
logs.report("mplib","problematic special: %s", str or "?")
end
end
---~ if str:match("^%%%%MetaPostOption: multipass") then
+--~ if match(str,"^%%%%MetaPostOption: multipass") then
--~ metapost.multipass = true
--~ end
end
@@ -203,11 +208,11 @@ local colorsplitter = lpeg.Ct(lpeg.splitter(":",tonumber))
-- This is also an example of a simple plugin.
--~ function metapost.specials.cc(specification,object,result)
---~ object.color = specificationsplitter:match(specification)
+--~ object.color = lpegmatch(specificationsplitter,specification)
--~ return object, nil, nil, nil
--~ end
--~ function metapost.specials.cc(specification,object,result)
---~ local c = specificationsplitter:match(specification)
+--~ local c = lpegmatch(specificationsplitter,specification)
--~ local o = object.color[1]
--~ c[1],c[2],c[3],c[4] = o*c[1],o*c[2],o*c[3],o*c[4]
--~ return object, nil, nil, nil
@@ -276,10 +281,10 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color
nofshades = nofshades + 1
flusher.flushfigure(result)
result = { }
- local t = specificationsplitter:match(specification)
+ local t = lpegmatch(specificationsplitter,specification)
-- we need a way to move/scale
- local ca = colorsplitter:match(t[4])
- local cb = colorsplitter:match(t[8])
+ local ca = lpegmatch(colorsplitter,t[4])
+ local cb = lpegmatch(colorsplitter,t[8])
if round(ca[1]*10000) == 123 then ca = metapost.colorspec(ca) end
if round(cb[1]*10000) == 123 then cb = metapost.colorspec(cb) end
local name = format("MplSh%s",nofshades)
@@ -348,10 +353,10 @@ function metapost.specials.ls(specification,object,result,flusher)
nofshades = nofshades + 1
flusher.flushfigure(result)
result = { }
- local t = specificationsplitter:match(specification)
+ local t = lpegmatch(specificationsplitter,specification)
-- we need a way to move/scale
- local ca = colorsplitter:match(t[4])
- local cb = colorsplitter:match(t[7])
+ local ca = lpegmatch(colorsplitter,t[4])
+ local cb = lpegmatch(colorsplitter,t[7])
if round(ca[1]*10000) == 123 then ca = metapost.colorspec(ca) end
if round(cb[1]*10000) == 123 then cb = metapost.colorspec(cb) end
local name = format("MpSh%s",nofshades)
@@ -417,36 +422,61 @@ end
-- no need for a before here
-local current_format, current_graphic
+local current_format, current_graphic, current_initializations
-metapost.first_box = metapost.first_box or 1000
-metapost.last_box = metapost.last_box or 1100
-metapost.textext_current = metapost.first_box
+-- metapost.first_box = metapost.first_box or 1000
+-- metapost.last_box = metapost.last_box or 1100
+--~ metapost.textext_current = metapost.first_box
metapost.multipass = false
-function metapost.free_boxes()
- local tb = tex.box
- for i = metapost.first_box,metapost.last_box do
- local b = tb[i]
- if b then
- tb[i] = nil -- no node.flush_list(b) needed, else double free error
- else
- break
+local textexts = { }
+
+function metapost.free_boxes() -- todo: mp direct list ipv box
+ -- for i = metapost.first_box,metapost.last_box do
+ -- local b = texbox[i]
+ -- if b then
+ -- texbox[i] = nil -- no node.flush_list(b) needed, else double free error
+ -- else
+ -- break
+ -- end
+ -- end
+ for n, box in next, textexts do
+ local tn = textexts[n]
+ if tn then
+ -- somehow not flushed (used)
+ textexts[n] = nil
end
end
+ textexts = { }
+end
+
+function metapost.settext(box,slot)
+ textexts[slot] = copy_list(texbox[box])
+ texbox[box] = nil
+ -- this will become
+ -- textexts[slot] = texbox[box]
+ -- unsetbox(box)
+end
+
+function metapost.gettext(box,slot)
+ texbox[box] = copy_list(textexts[slot])
+-- textexts[slot] = nil -- no, pictures can be placed several times
end
function metapost.specials.tf(specification,object)
--~ print("setting", metapost.textext_current)
local n, str = match(specification,"^(%d+):(.+)$")
if n and str then
- if metapost.textext_current < metapost.last_box then
- metapost.textext_current = metapost.first_box + n - 1
- end
+ n = tonumber(n)
+ -- if metapost.textext_current < metapost.last_box then
+ -- metapost.textext_current = metapost.first_box + n - 1
+ -- end
if trace_textexts then
- logs.report("metapost","first pass: order %s, box %s",n,metapost.textext_current)
+ -- logs.report("metapost","first pass: order %s, box %s",n,metapost.textext_current)
+ logs.report("metapost","first pass: order %s",n)
end
- sprint(ctxcatcodes,format("\\MPLIBsettext{%s}{%s}",metapost.textext_current,str))
+ -- sprint(ctxcatcodes,format("\\MPLIBsettext{%s}{%s}",metapost.textext_current,str))
+ sprint(ctxcatcodes,format("\\MPLIBsettext{%s}{%s}",n,str))
metapost.multipass = true
end
return { }, nil, nil, nil
@@ -456,8 +486,10 @@ function metapost.specials.ts(specification,object,result,flusher)
-- print("getting", metapost.textext_current)
local n, str = match(specification,"^(%d+):(.+)$")
if n and str then
+ n = tonumber(n)
if trace_textexts then
- logs.report("metapost","second pass: order %s, box %s",n,metapost.textext_current)
+ -- logs.report("metapost","second pass: order %s, box %s",n,metapost.textext_current)
+ logs.report("metapost","second pass: order %s",n)
end
local op = object.path
local first, second, fourth = op[1], op[2], op[4]
@@ -469,17 +501,24 @@ function metapost.specials.ts(specification,object,result,flusher)
if not trace_textexts then
object.path = nil
end
- local before = function() -- no need for function
+ local before = function() -- no need for before function (just do it directly)
--~ flusher.flushfigure(result)
--~ sprint(ctxcatcodes,format("\\MPLIBgettext{%f}{%f}{%f}{%f}{%f}{%f}{%s}",sx,rx,ry,sy,tx,ty,metapost.textext_current))
--~ result = { }
result[#result+1] = format("q %f %f %f %f %f %f cm", sx,rx,ry,sy,tx,ty)
flusher.flushfigure(result)
- if metapost.textext_current < metapost.last_box then
- metapost.textext_current = metapost.first_box + n - 1
+ -- if metapost.textext_current < metapost.last_box then
+ -- metapost.textext_current = metapost.first_box + n - 1
+ -- end
+ -- local b = metapost.textext_current
+ -- local box = texbox[b]
+ local box = textexts[n]
+ if box then
+ -- sprint(ctxcatcodes,format("\\MPLIBgettextscaled{%s}{%s}{%s}",b,metapost.sxsy(box.width,box.height,box.depth)))
+ sprint(ctxcatcodes,format("\\MPLIBgettextscaled{%s}{%s}{%s}",n,metapost.sxsy(box.width,box.height,box.depth)))
+ else
+ -- error
end
- local b = metapost.textext_current
- sprint(ctxcatcodes,format("\\MPLIBgettextscaled{%s}{%s}{%s}",b, metapost.sxsy(tex.wd[b],tex.ht[b],tex.dp[b])))
result = { "Q" }
return object, result
end
@@ -646,7 +685,7 @@ do
local function convert(str)
found = true
- return "textext(\"" .. str .. "\")"
+ return "rawtextext(\"" .. str .. "\")" -- centered
end
local function ditto(str)
return "\" & ditto & \""
@@ -658,20 +697,33 @@ do
forced = true
end
+ local texmess = (dquote/ditto + (1 - etex))^0
+
+ local function ignore(s)
+ logs.report("mplib","ignoring verbatim tex: %s",s)
+ return ""
+ end
+
local parser = P {
- [1] = Cs((V(2)/register + V(3)/convert + V(4)/force + 1)^0),
+ [1] = Cs((V(2)/register + V(4)/ignore + V(3)/convert + V(5)/force + 1)^0),
[2] = ttex + gtex,
- [3] = (btex + vtex) * spacing * Cs((dquote/ditto + (1 - etex))^0) * etex,
- [4] = multipass, -- experimental, only for testing
+ [3] = btex * spacing * Cs(texmess) * etex,
+ [4] = vtex * spacing * Cs(texmess) * etex,
+ [5] = multipass, -- experimental, only for testing
}
-- currently a a one-liner produces less code
- local parser = Cs(((ttex + gtex)/register + ((btex + vtex) * spacing * Cs((dquote/ditto + (1 - etex))^0) * etex)/convert + 1)^0)
+ local parser = Cs((
+ (ttex + gtex)/register
+ + (btex * spacing * Cs(texmess) * etex)/convert
+ + (vtex * spacing * Cs(texmess) * etex)/ignore
+ + 1
+ )^0)
function metapost.check_texts(str)
found, forced = false, false
- return parser:match(str), found, forced
+ return lpegmatch(parser,str), found, forced
end
end
@@ -689,19 +741,29 @@ function metapost.sxsy(wd,ht,dp) -- helper for text
return (wd ~= 0 and factor/wd) or 0, (hd ~= 0 and factor/hd) or 0
end
+local no_trial_run = "_trial_run_ := false ;"
+local do_trial_run = "if unknown _trial_run_ : boolean _trial_run_ fi ; _trial_run_ := true ;"
+local text_data_template = "_tt_w_[%i]:=%f;_tt_h_[%i]:=%f;_tt_d_[%i]:=%f;"
+local do_begin_fig = "; beginfig(1); "
+local do_end_fig = "; endfig ;"
+local do_safeguard = ";"
+
function metapost.text_texts_data()
local t, n = { }, 0
- for i = metapost.first_box, metapost.last_box do
- n = n + 1
+--~ for i = metapost.first_box, metapost.last_box do
+--~ n = n + 1
+--~ local box = texbox[i]
+ for n, box in next, textexts do
if trace_textexts then
logs.report("metapost","passed data: order %s, box %s",n,i)
end
- if tex.box[i] then
- t[#t+1] = format("_tt_w_[%i]:=%f;_tt_h_[%i]:=%f;_tt_d_[%i]:=%f;", n,tex.wd[i]/factor, n,tex.ht[i]/factor, n,tex.dp[i]/factor)
+ if box then
+ t[#t+1] = format(text_data_template,n,box.width/factor,n,box.height/factor,n,box.depth/factor)
else
break
end
end
+--~ print(table.serialize(t))
return t
end
@@ -711,31 +773,33 @@ metapost.intermediate.needed = false
metapost.method = 1 -- 1:dumb 2:clever
-function metapost.graphic_base_pass(mpsformat,str,preamble,askedfig)
+function metapost.graphic_base_pass(mpsformat,str,initializations,preamble,askedfig)
local nofig = (askedfig and "") or false
local done_1, done_2, forced_1, forced_2
str, done_1, forced_1 = metapost.check_texts(str)
- if preamble then
- preamble, done_2, forced_2 = metapost.check_texts(preamble)
- else
+ if not preamble or preamble == "" then
preamble, done_2, forced_2 = "", false, false
+ else
+ preamble, done_2, forced_2 = metapost.check_texts(preamble)
end
- metapost.textext_current = metapost.first_box
+ -- metapost.textext_current = metapost.first_box
metapost.intermediate.needed = false
metapost.multipass = false -- no needed here
- current_format, current_graphic = mpsformat, str
+ current_format, current_graphic, current_initializations = mpsformat, str, initializations or ""
if metapost.method == 1 or (metapost.method == 2 and (done_1 or done_2)) then
-- first true means: trialrun, second true means: avoid extra run if no multipass
local flushed = metapost.process(mpsformat, {
preamble,
- nofig or "beginfig(1); ",
- "if unknown _trial_run_ : boolean _trial_run_ fi ; _trial_run_ := true ;",
- str,
- nofig or "endfig ;"
+ nofig or do_begin_fig,
+ do_trial_run,
+ current_initializations,
+ do_safeguard,
+ current_graphic,
+ nofig or do_end_fig
-- }, true, nil, true )
}, true, nil, not (forced_1 or forced_2), false, askedfig)
if metapost.intermediate.needed then
- for _, action in pairs(metapost.intermediate.actions) do
+ for _, action in next, metapost.intermediate.actions do
action()
end
end
@@ -746,11 +810,13 @@ function metapost.graphic_base_pass(mpsformat,str,preamble,askedfig)
end
else
metapost.process(mpsformat, {
- preamble or "",
- nofig or "beginfig(1); ",
- "_trial_run_ := false ;",
- str,
- nofig or "endfig ;"
+ preamble,
+ nofig or do_begin_fig,
+ no_trial_run,
+ current_initializations,
+ do_safeguard,
+ current_graphic,
+ nofig or do_end_fig
}, false, nil, false, false, askedfig )
end
-- here we could free the textext boxes
@@ -759,34 +825,18 @@ end
function metapost.graphic_extra_pass(askedfig)
local nofig = (askedfig and "") or false
- metapost.textext_current = metapost.first_box
+ -- metapost.textext_current = metapost.first_box
metapost.process(current_format, {
- nofig or "beginfig(1); ",
- "_trial_run_ := false ;",
+ nofig or do_begin_fig,
+ no_trial_run,
concat(metapost.text_texts_data()," ;\n"),
+ current_initializations,
+ do_safeguard,
current_graphic,
- nofig or "endfig ;"
+ nofig or do_end_fig
}, false, nil, false, true, askedfig )
end
-function metapost.getclippath(data)
- local mpx = metapost.format("metafun")
- if mpx and data then
- starttiming(metapost)
- starttiming(metapost.exectime)
- local result = mpx:execute(format("beginfig(1);%s;endfig;",data))
- stoptiming(metapost.exectime)
- if result.status > 0 then
- print("error", result.status, result.error or result.term or result.log)
- result = ""
- else
- result = metapost.filterclippath(result)
- end
- stoptiming(metapost)
- sprint(result)
- end
-end
-
metapost.tex = metapost.tex or { }
do -- only used in graphictexts
diff --git a/Master/texmf-dist/tex/context/base/mlib-pps.mkiv b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
index 83880994b0e..0a78a87040e 100644
--- a/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
+++ b/Master/texmf-dist/tex/context/base/mlib-pps.mkiv
@@ -15,8 +15,24 @@
\registerctxluafile{mlib-pps}{1.001}
+%D Todo: catch nested graphics like external figures with dummies.
+
+% \newtoks\everyMPLIBtext % not yet used
+
+% \appendtoks
+% \let\handleuseMPgraphic \thirdofthreearguments
+% \let\handlereusableMPgraphic\thirdofthreearguments
+% \to \everyMPLIBtext
+
% this will move !
+% Instead of preallocated boxes we now use a table of lists so that we
+% have no limitation. Typically an example of a next version solution
+% due to \LUATEX\ evolving.
+
+\newbox \MPtextbox
+\newtoks\everyMPLIBsettext
+
\def\MPLIBfigure#1#2#3#4#5#6#7% todo: move Q q to lua
{\setbox\scratchbox\hbox{\externalfigure[#7]}%
\ctxlua{metapost.edefsxsy(\number\wd\scratchbox,\number\ht\scratchbox,0)}%
@@ -25,23 +41,30 @@
\pdfliteral direct{Q}}
\def\MPLIBsettext#1% #2%
- {\global\setbox#1\hbox}% {#2}}
-
-\def\MPLIBfreetext#1%
- {\global\setbox#1\emptybox}
+ {\dowithnextbox{\ctxlua{metapost.settext(\number\nextbox,#1)}}\hbox}
\def\MPLIBgettextscaled#1#2#3% why a copy
- {\vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp#1\copy#1}\hss}}}
-
-\def\MPLIBallocate#1%
- {\newbox\MPLIBfirst
- \dorecurse{\numexpr#1-1\relax}{\let\MPLIBlast\relax\newbox\MPLIBlast}%
- \MPLIBregister}
-
-\def\MPLIBregister % after allocate!
- {\ctxlua{metapost.first_box, metapost.last_box = \number\MPLIBfirst, \number\MPLIBlast}}
+ {\ctxlua{metapost.gettext(\number\MPtextbox,#1)}%
+ \vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp\MPtextbox\box\MPtextbox}\hss}}}
\def\MPLIBgraphictext#1%
{\startTEXpage[\c!scale=10000]#1\stopTEXpage}
\protect \endinput
+
+% \def\MPLIBsettext#1% #2% we could as well store in hlists at the lua end i.e. just one box
+% {\global\setbox#1\hbox}
+%
+% \def\MPLIBfreetext#1%
+% {\global\setbox#1\emptybox}
+%
+% \def\MPLIBgettextscaled#1#2#3% why a copy
+% {\vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp#1\copy#1}\hss}}}
+%
+% \def\MPLIBallocate#1%
+% {\newbox\MPLIBfirst
+% \dorecurse{\numexpr#1-1\relax}{\let\MPLIBlast\relax\newbox\MPLIBlast}%
+% \MPLIBregister}
+%
+% \def\MPLIBregister % after allocate!
+% {\ctxlua{metapost.first_box, metapost.last_box = \number\MPLIBfirst, \number\MPLIBlast}}
diff --git a/Master/texmf-dist/tex/context/base/mlib-run.lua b/Master/texmf-dist/tex/context/base/mlib-run.lua
index 7351c332fb4..f352e1db161 100644
--- a/Master/texmf-dist/tex/context/base/mlib-run.lua
+++ b/Master/texmf-dist/tex/context/base/mlib-run.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['mlib-run'] = {
version = 1.001,
- comment = "companion to mlib-ctx.tex",
+ 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",
@@ -31,11 +31,10 @@ nears zero.</p>
local trace_graphics = false trackers.register("metapost.graphics", function(v) trace_graphics = v end)
-local format = string.format
+local format, gsub, match = string.format, string.gsub, string.match
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-
metapost = metapost or { }
metapost.showlog = false
@@ -59,7 +58,7 @@ metapost.finder = finder
metapost.parameters = {
hash_size = 100000,
- main_memory = 2000000,
+ main_memory = 4000000,
max_in_open = 50,
param_size = 100000,
}
@@ -164,8 +163,8 @@ function metapost.checkformat(mpsinput, mpsformat, dirname)
if not result.log then
metapost.reporterror(result)
else
- local version = result.log:match(">> *(.-)[\n\r]") or "unknown"
- version = version:gsub("[\'\"]","")
+ local version = match(result.log,">> *(.-)[\n\r]") or "unknown"
+ version = gsub(version,"[\'\"]","")
if version ~= the_version then
commands.writestatus("mplib","version mismatch: %s <> %s", version or "unknown", the_version)
else
@@ -209,7 +208,7 @@ function metapost.reset(mpx)
mpxformats[mpx] = nil
end
else
- for name, instance in pairs(mpxformats) do
+ for name, instance in next, mpxformats do
if instance == mpx then
mpx:finish()
mpxformats[name] = nil
@@ -348,7 +347,8 @@ function metapost.directrun(formatname,filename,outputformat,astable,mpdata)
if astable then
local result = { }
logs.simple("storing %s figures in table",#sorted)
- for k, v in ipairs(sorted) do
+ for k=1,#sorted do
+ local v = sorted[k]
if outputformat == "mps" then
result[v] = figures[v]:postscript()
else
@@ -358,7 +358,8 @@ function metapost.directrun(formatname,filename,outputformat,astable,mpdata)
return result
else
local basename = file.removesuffix(file.basename(filename))
- for k, v in ipairs(sorted) do
+ for k=1,#sorted do
+ local v = sorted[k]
local output
if outputformat == "mps" then
output = figures[v]:postscript()
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex b/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
index 9d0bb901bee..73431567d34 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-arrange.tex
@@ -89,11 +89,15 @@
if document.arguments.sort then
table.sort(document.files)
end
- local emptypages = document.arguments.addempty or ""
- local textwidth = document.arguments.textwidth or "0cm"
+ local emptypages = document.arguments.addempty or ""
+ local textwidth = document.arguments.textwidth or "0cm"
for _, filename in ipairs(document.files) do
if not string.find(filename,"^mtx%-context%-") then
- fprint("\\insertpages[%s][%s][width=%s]",filename,emptypages,textwidth)
+ context.insertpages (
+ { filename },
+ { emptypages },
+ { width = textwidth }
+ )
end
end
else
@@ -103,3 +107,5 @@
\stoptext
+
+
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-combine.tex b/Master/texmf-dist/tex/context/base/mtx-context-combine.tex
index 991e974aed8..8a861ab833b 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-combine.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-combine.tex
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=mtx-context-combine,
%D version=2009.03.21,
@@ -19,17 +17,19 @@
%
% usage: context --extra=combine [options] list-of-files
%
-% --sort : sort filenames first
-% --paperoffset=dimension : left-top-offset
-% --nobanner : no footer etc
-% --combination : h*v or hxv
-% --paperformat : paper*print or paperxprint
-% --nobanner : no footerlines
-% --bannerheight : height of banner
-% --bannerstring : height of bannerstring
+% --sort : sort filenames first
+% --paperoffset=dimension : left-top-offset
+% --nobanner : no footer etc
+% --combination : h*v or hxv
+% --paperformat=spec : paper*print or paperxprint
+% --nobanner : no footerlines
+% --bannerheight=dimension : height of banner
+% --bannerstring=dimension : height of bannerstring
%
% end help
+\input mtx-context-common.tex
+
\doifdocumentargumentelse {paperoffset} {
\setuplayout
@@ -50,45 +50,16 @@
width=middle,
height=middle]
-\startluacode
- local combination = document.arguments['combination'] or '2*2'
- local nx, ny = string.match(combination,"^(%d+)%s*[%*x]%s*(%d+)$")
- if not nx then
- nx, ny = 2, 2
- elseif not ny then
- nx = tonumber(combination) or 2
- ny = nx
- else
- nx = tonumber(nx) or 2
- ny = tonumber(ny) or nx or 2
- end
- document.setargument("nx",nx)
- document.setargument("ny",ny)
-\stopluacode
-
-\startluacode
- local paperformat = document.arguments['paperformat'] or 'A4*A4'
- paperformat = string.upper(paperformat)
- local f, t = string.match(paperformat,"^(.-)%s*[%*xX]%s*(.-)$")
- if not f then
- f, t = "A4", "A4"
- elseif not t then
- t = f
- end
- document.setargument("from",f)
- document.setargument("to",t)
-\stopluacode
-
\setuppapersize
- [\getdocumentargument{from}]
- [\getdocumentargument{to}]
+ [\getdocumentargument{paperformat_paper}]
+ [\getdocumentargument{paperformat_print}]
\doifnotdocumentargument {bannerheight} {
\setuplayout
[footer=1cm]
}
-\doifdocumentargumentelse {nobanner} {yes} {
+\doifelse {\getdocumentargument{nobanner}} {yes} {
\setuplayout
[footer=0cm]
\setupbackgrounds
@@ -112,7 +83,6 @@
\startluacode
local format = string.format
- local fprint = function(...) tex.sprint(tex.ctxcatcodes,format(...)) end
if #document.files > 0 then
if document.arguments["sort"] then
@@ -120,25 +90,25 @@
end
local dobanner = not document.arguments["nobanner"]
local bannerheight = document.arguments["bannerheight"]
- local nx = document.arguments.nx or 2
- local ny = document.arguments.ny or 2
+ local nx = document.arguments.combination_nx or 2
+ local ny = document.arguments.combination_ny or 2
for _, filename in ipairs(document.files) do
if not string.find(filename,"^mtx%-context%-") then
-- could be a macro
local bannerstring = format("\\tttf\\detokenize{%s}\\quad\\quad\\currentdate\\quad\\quad\\pagenumber",file.basename(filename))
if dobanner then
if bannerheight then
- fprint("\\setuptexttexts[{\\setlayerframed[page][preset=middlebottom][frame=off,height=%s]{%s}}]",bannerheight,bannerstring)
+ context("\\setuptexttexts[{\\setlayerframed[page][preset=middlebottom][frame=off,height=%s]{%s}}]",bannerheight,bannerstring)
else
- fprint("\\setupfootertexts[{%s}]",bannerstring)
+ context("\\setupfootertexts[{%s}]",bannerstring)
end
end
- fprint("\\combinepages[%s][nx=%s,ny=%s]",filename,nx,ny)
- fprint("\\page")
+ context("\\combinepages[%s][nx=%s,ny=%s]",filename,nx,ny)
+ context("\\page")
end
end
else
- fprint("no files given")
+ context("no files given")
end
\stopluacode
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-common.tex b/Master/texmf-dist/tex/context/base/mtx-context-common.tex
new file mode 100644
index 00000000000..8327dd28d59
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mtx-context-common.tex
@@ -0,0 +1,43 @@
+%D \module
+%D [ file=mtx-context-common,
+%D version=2009.03.21,
+%D title=\CONTEXT\ Extra Trickry,
+%D subtitle=Common Stuff,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startluacode
+ local combination = document.arguments['combination'] or '2*2'
+ local nx, ny = string.match(combination,"^(%d+)%s*[%*x]%s*(%d+)$")
+ if not nx then
+ nx, ny = 2, 2
+ elseif not ny then
+ nx = tonumber(combination) or 2
+ ny = nx
+ else
+ nx = tonumber(nx) or 2
+ ny = tonumber(ny) or nx or 2
+ end
+ document.setargument("combination_nx",nx)
+ document.setargument("combination_ny",ny)
+\stopluacode
+
+\startluacode
+ local paperformat = document.arguments['paperformat'] or 'A4*A4'
+ paperformat = string.upper(paperformat)
+ local f, t = string.match(paperformat,"^(.-)%s*[%*xX]%s*(.-)$")
+ if not f then
+ f, t = "A4", "A4"
+ elseif not t then
+ t = f
+ end
+ document.setargument("paperformat_paper",f)
+ document.setargument("paperformat_print",t)
+\stopluacode
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-ideas.tex b/Master/texmf-dist/tex/context/base/mtx-context-ideas.tex
index f1ef1d35ff7..24d11a5b5c7 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-ideas.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-ideas.tex
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=mtx-context-ideas,
%D version=2009.03.21,
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
index 5c978fc6a33..d0dbcbba09b 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=mtx-context-listing,
%D version=2008.11.10, % about that time i started playing with this
@@ -23,53 +21,79 @@
% --topspace=dimension : distance above first line
% --backspace=dimension : distance before left margin
% --pretty : pretty print comform suffix (temporarily disabled)
+% --bodyfont=list : additional bodyfont settings
+% --paperformat=spec : paper*print or paperxprint
%
% end help
+\input mtx-context-common.tex
+
\setupbodyfont
- [11pt,tt]
+ [11pt,tt,\getdocumentargument{bodyfont}]
+
+\setuptyping
+ [lines=yes]
\setuplayout
[header=0cm,
footer=1.5cm,
+ topspace=\getdocumentargumentdefault{topspace}{1.5cm},
+ backspace=\getdocumentargumentdefault{backspace}{1.5cm},
width=middle,
height=middle]
-% todo: use \arguments{topspace}
+\setuppapersize
+ [\getdocumentargument{paperformat_paper}]
+ [\getdocumentargument{paperformat_print}]
-\startluacode
- local topspace = document.arguments["topspace"] or 0
- if dimen(topspace) > dimen(0) then
- tex.sprint(string.format("\\setuplayout[topspace=%s]",dimen(topspace)))
- end
- local backspace = document.arguments["backspace"] or 0
- if dimen(topspace) > dimen(0) then
- tex.sprint(string.format("\\setuplayout[backspace=%s]",dimen(backspace)))
- end
-\stopluacode
-
-\setuptyping
- [lines=yes]
-
-\setuptyping
- [option=color]
+% \startluacode
+% -- syntax check
+% local topspace = dimen(document.arguments.topspace or 0)
+% local backspace = dimen(document.arguments.backspace or 0)
+% local zeropoint = dimen(0)
+% if topspace > zeropoint then
+% context.setuplayout { topspace = tostring(topspace) }
+% end
+% if backspace > zeropoint then
+% context.setuplayout { backspace = tostring(backspace) }
+% end
+% \stopluacode
\starttext
\startluacode
+ local types = {
+ mkiv = "tex",
+ mkii = "tex",
+ cld = "lua",
+ lfg = "lua",
+ }
+
if #document.files > 0 then
- if document.arguments["sort"] then
+ if document.arguments.sort then
table.sort(document.files)
end
for _, filename in ipairs(document.files) do
if not string.find(filename,"^mtx%-context%-") then
- tex.sprint("\\page\n")
- tex.sprint(string.format("\\setupfootertexts[\\detokenize{%s}][\\pagenumber]\n",file.basename(filename)))
- tex.sprint(string.format("\\typefile{%s}",filename))
+ local pretty = document.arguments.pretty
+ if pretty == true then
+ pretty = file.extname(filename) or ""
+ elseif pretty == false then
+ pretty = ""
+ else
+ -- forced
+ end
+ context.page()
+ context.setupfootertexts( -- return true: we need to keep this entry
+ { function() context.detokenize(file.basename(filename)) return true end },
+ { function() context.pagenumber() return true end }
+ )
+ context.setuptyping { option = types[pretty] or pretty }
+ context.typefile(filename)
end
end
else
- tex.sprint(tex.ctxcatcodes,"no files given")
+ context("no files given")
end
\stopluacode
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-timing.tex b/Master/texmf-dist/tex/context/base/mtx-context-timing.tex
index 51e6427f6f1..b788d4b6379 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-timing.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-timing.tex
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=mtx-context-timing,
%D version=2009.03.21,
diff --git a/Master/texmf-dist/tex/context/base/mult-chk.lua b/Master/texmf-dist/tex/context/base/mult-chk.lua
index 2c1ab3c78aa..bdbd1dd22f9 100644
--- a/Master/texmf-dist/tex/context/base/mult-chk.lua
+++ b/Master/texmf-dist/tex/context/base/mult-chk.lua
@@ -1,15 +1,15 @@
if not modules then modules = { } end modules ['mult-chk'] = {
version = 1.001,
- comment = "companion to mult-chk.tex",
+ comment = "companion to mult-chk.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 lpegmatch = lpeg.match
local type = type
-local texsprint = tex.sprint
-local ctxcatcodes = tex.ctxcatcodes
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
interfaces = interfaces or { }
@@ -59,7 +59,7 @@ function commands.getcheckedparameters(k,p,s)
if s and s ~= "" then
prefix, kind = p, k
keys = k and k ~= "" and interfaces.syntax[k].keys
- pattern:match(s)
+ lpegmatch(pattern,s)
end
end
diff --git a/Master/texmf-dist/tex/context/base/mult-cld.lua b/Master/texmf-dist/tex/context/base/mult-cld.lua
index c9e922afec0..81038b68b51 100644
--- a/Master/texmf-dist/tex/context/base/mult-cld.lua
+++ b/Master/texmf-dist/tex/context/base/mult-cld.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['mult-cld'] = {
version = 1.001,
- comment = "companion to mult-cld.tex",
+ comment = "companion to mult-cld.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -13,91 +13,127 @@ if not modules then modules = { } end modules ['mult-cld'] = {
-- code. It can also be handy when generating documents from databases or
-- when constructing large tables or so.
--
--- Todo: optional checking against interface!
+-- Todo: optional checking against interface
+-- Todo: coroutine trickery
context = context or { }
local format, concat = string.format, table.concat
local next, type = next, type
-local texsprint, texiowrite = tex.sprint, texio.write
+local texsprint, texiowrite, ctxcatcodes = tex.sprint, texio.write, tex.ctxcatcodes
-local flush = texsprint
-local cache
+local flush = texsprint or function(cct,...) print(table.concat{...}) end
-local function cached_flush(c,...)
- local tt = { ... }
- for i=1,#tt do
- cache[#cache+1] = tt[i]
+local _stack_, _n_ = { }, 0
+
+local function _store_(ti)
+ _n_ = _n_ + 1
+ _stack_[_n_] = ti
+ return _n_
+end
+
+local function _flush_(n)
+ if not _stack_[n]() then
+ _stack_[n] = nil
+ else
+ -- keep, beware, that way the stack can grow
end
end
+context._stack_ = _stack_
+context._store_ = _store_
+context._flush_ = _flush_
+
+function tex.fprint(...) -- goodie
+ texsprint(ctxcatcodes,format(...))
+end
+
+function context.trace(intercept)
+ local normalflush = flush
+ flush = function(c,...)
+ logs.report("context",concat({...}))
+ if not intercept then
+ normalflush(c,...)
+ end
+ end
+ context.trace = function() end
+end
+
+trackers.register("context.flush", function(v) if v then context.trace() end end)
+trackers.register("context.intercept", function(v) if v then context.trace(true) end end)
+
local function writer(k,...)
- flush(ctxcatcodes,k)
- local t = { ... }
- if next(t) then
- for i=1,#t do
- local ti = t[i]
- local typ, force = type(ti), nil
- while typ == "function" do
- local saved_flush = flush
- cache = { }
- flush = cached_flush
- ti, force = ti()
- if force then
- typ = false -- force special cases
- elseif typ == "nil" then
- typ = "string"
- ti = concat(cache)
- elseif typ == "string" then
- ti = concat(cache)
- end
- flush = saved_flush
- end
- if ti == nil then
- -- next
- elseif typ == "string" or typ == "number" then
- flush(ctxcatcodes,"{",ti,"}")
- elseif typ == "table" then
- flush(ctxcatcodes,"[")
- local c = concat(ti,",")
- if c ~= "" then
- flush(ctxcatcodes,c)
- else
- local done = false
- for k, v in next, ti do
- if done then
- flush(ctxcatcodes,",",k,'=',v)
- else
- flush(ctxcatcodes,k,'=',v)
- done = true
+ if k then
+ flush(ctxcatcodes,k)
+ local t = { ... }
+ local nt = #t
+ if nt > 0 then
+ for i=1,nt do
+ local ti = t[i]
+ local typ = type(ti)
+ if ti == nil then
+ -- next
+ elseif typ == "function" then
+ flush(ctxcatcodes,"{\\mkivflush{" .. _store_(ti) .. "}}")
+ elseif typ == "string" or typ == "number" then
+ flush(ctxcatcodes,"{",ti,"}")
+ elseif typ == "table" then
+ local tn = #ti
+ if tn > 0 then
+ for j=1,tn do
+ local tj = ti[j]
+ if type(tj) == "function" then
+ ti[j] = "\\mkivflush{" .. _store_(tj) .. "}"
+ end
end
+ flush(ctxcatcodes,"[",concat(ti,","),"]")
+ else
+ flush(ctxcatcodes,"[")
+ local done = false
+ for k, v in next, ti do
+ if done then
+ flush(ctxcatcodes,",",k,'=',v)
+ else
+ flush(ctxcatcodes,k,'=',v)
+ done = true
+ end
+ end
+ flush(ctxcatcodes,"]")
end
- end
- flush(ctxcatcodes,"]")
- -- elseif typ == "boolean" then
- -- flush(ctxcatcodes,"\n")
- elseif ti == true then
- flush(ctxcatcodes,"\n")
- elseif typ == false then
- if force == "direct" then
+ -- elseif typ == "boolean" then
+ -- flush(ctxcatcodes,"\n")
+ elseif ti == true then
+ flush(ctxcatcodes,"\n")
+ elseif typ == false then
+ -- if force == "direct" then
flush(ctxcatcodes,tostring(ti))
+ -- end
+ elseif typ == "thread" then
+ logs.report("interfaces","coroutines not supported as we cannot yeild across boundaries")
+ else
+ logs.report("interfaces","error: %s gets a weird argument %s",k,tostring(ti))
end
- else
- logs.report("interfaces","error: %s gets a weird argument %s",k,tostring(ti))
end
end
end
end
+-- -- --
+
local function indexer(t,k)
- local f = function(...) return writer("\\"..k.." ",...) end -- building the cs here saves time
+ local c = "\\" .. k .. " "
+ local f = function(...) return writer(c,...) end
t[k] = f
return f
end
-local function caller(t,f,...)
- if f then
- flush(ctxcatcodes,format(f,...))
+local function caller(t,f,a,...)
+ if a then
+ flush(ctxcatcodes,format(f,a,...))
+ elseif type(f) == "function" then
+ flush(ctxcatcodes,"{\\mkivflush{" .. _store_(f) .. "}}")
+ elseif f then
+ flush(ctxcatcodes,f)
else
flush(ctxcatcodes,"\n")
end
@@ -113,16 +149,18 @@ function context.runfile(filename)
filename = resolvers.findtexfile(filename) or ""
if filename ~= "" then
local ok = dofile(filename)
- if ok then
+ if type(ok) == "function" then
if trace_cld then
- commands.writestatus("cld","begin of file '%s'",filename)
+ commands.writestatus("cld","begin of file '%s' (function call)",filename)
end
ok()
if trace_cld then
- commands.writestatus("cld","end of file '%s'",filename)
+ commands.writestatus("cld","end of file '%s' (function call)",filename)
end
+ elseif ok then
+ commands.writestatus("cld","file '%s' is processed and returns true",filename)
else
- commands.writestatus("cld","invalid file '%s'",filename)
+ commands.writestatus("cld","file '%s' is processed and returns nothing",filename)
end
else
commands.writestatus("cld","unknown file '%s'",filename)
@@ -149,7 +187,7 @@ end)
function context.enabletrackers (str) trackers.enable (str) end
function context.disabletrackers(str) trackers.disable(str) end
--- see demo-lud.lud for an example
+-- see demo-cld.cld for an example
-- context.starttext(true)
-- context.chapter({ "label" }, "title", true)
diff --git a/Master/texmf-dist/tex/context/base/mult-cld.mkiv b/Master/texmf-dist/tex/context/base/mult-cld.mkiv
index 05092865895..1c5ebd34af3 100644
--- a/Master/texmf-dist/tex/context/base/mult-cld.mkiv
+++ b/Master/texmf-dist/tex/context/base/mult-cld.mkiv
@@ -16,5 +16,14 @@
\writestatus{loading}{ConTeXt Multilingual Macros / Lua}
\registerctxluafile{mult-cld}{1.001}
+\registerctxluafile{mult-clm}{1.001}
-\endinput
+\unprotect
+
+\def\defmkivstart#1{\unexpanded\expandafter\def\csname\e!start#1\endcsname}
+\def\defmkivstop #1{\unexpanded\def\csname\e!stop #1\endcsname}
+\def\defmkiv #1{\unexpanded\def\csname #1\endcsname}
+
+\def\mkivflush #1{\ctxlua{context._flush_(#1)}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mult-clm.lua b/Master/texmf-dist/tex/context/base/mult-clm.lua
new file mode 100644
index 00000000000..8838ea532d5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mult-clm.lua
@@ -0,0 +1,184 @@
+if not modules then modules = { } end modules ['mult-clm'] = {
+ version = 1.001,
+ comment = "companion to mult-clm.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- another experiment
+-- todo: multilingual
+
+local texsprint, ctxcatcodes, vrbcatcodes = tex.sprint, tex.ctxcatcodes, tex.vrbcatcodes
+local format, insert, remove, concat = string.format, table.insert, table.remove, table.concat
+local unpack = unpack or table.unpack
+
+local trace_define = false trackers.register("context.define", function(v) trace_define = v end)
+
+mkiv = mkiv or { }
+
+mkiv.h, mkiv.a = aux.settings_to_hash, aux.settings_to_array
+
+local starters, stoppers, macros, stack = { }, { }, { }, { }
+
+local checkers = {
+ "\\dosingleempty",
+ "\\dodoubleempty",
+ "\\dotripleempty",
+ "\\doquadrupleempty",
+ "\\doquintupleempty",
+ "\\dosixtupleempty",
+}
+
+function mkiv.m(name,...)
+ macros[name](...)
+end
+
+function mkiv.b(name,...)
+ local sn = stack[name]
+ insert(sn,{...})
+ starters[name](...)
+end
+
+function mkiv.e(name)
+ local sn = stack[name]
+ local sv = remove(sn)
+ if sv then
+ stoppers[name](unpack(sv))
+ else
+ -- nesting error
+ end
+end
+
+mkiv.n = tonumber
+
+function mkiv.define(name,specification) -- name is optional
+ if type(name) == "table" then
+ specification = name
+ name = specification.name
+ end
+ if name and specification then
+ local arguments = specification.arguments
+ local na = (arguments and #arguments) or 0
+ local environment = specification.environment
+ if na == 0 then
+ if environment then
+ texsprint(ctxcatcodes,"\\defmkstart{",name,"}{\\ctxlua{mkiv.b('",name,"')}}")
+ texsprint(ctxcatcodes,"\\defmkstop{", name,"}{\\ctxlua{mkiv.b('",name,"')}}")
+ else
+ texsprint(ctxcatcodes,"\\defmkiv{", name,"}{\\ctxlua{mkiv.m('",name,"')}}")
+ end
+ else
+ stack[name] = { }
+ local opt, done = 0, false
+ local mkivdo = "\\mkivdo" .. name
+ texsprint(ctxcatcodes,"\\def",mkivdo)
+ for i=1,na do
+ local a = arguments[i]
+ local kind = a[1]
+ if kind == "option" then
+ texsprint(ctxcatcodes,"[#",i,"]")
+ if not done then
+ opt = opt + 1
+ end
+ else
+ done = true -- no more optional checking after this
+ texsprint(ctxcatcodes,"#",i)
+ end
+ end
+ if environment then
+ texsprint(ctxcatcodes,"{\\ctxlua{mkiv.b('",name,"'")
+ else
+ texsprint(ctxcatcodes,"{\\ctxlua{mkiv.m('",name,"'")
+ end
+ for i=1,na do
+ local a = arguments[i]
+ local kind = a[2]
+ if kind == "list" then
+ texsprint(ctxcatcodes,",mkiv.a([[#",i,"]])")
+ elseif kind == "hash" then
+ texsprint(ctxcatcodes,",mkiv.h([[#",i,"]])")
+ elseif kind == "number" then
+ texsprint(ctxcatcodes,",mkiv.n([[#",i,"]])")
+ else
+ texsprint(ctxcatcodes,",[[#",i,"]]")
+ end
+ end
+ texsprint(ctxcatcodes,")}}")
+ if environment then
+ texsprint(ctxcatcodes,"\\defmkivstop{" ,name,"}{\\ctxlua{mkiv.e('",name,"')}}")
+ texsprint(ctxcatcodes,"\\defmkivstart{",name,"}{",checkers[opt],mkivdo,"}")
+ else
+ texsprint(ctxcatcodes,"\\defmkiv{", name,"}{",checkers[opt],mkivdo,"}")
+ end
+ end
+ if environment then
+ starters[name] = specification.starter
+ stoppers[name] = specification.stopper
+ else
+ macros[name] = specification.macro
+ end
+ end
+end
+
+function mkiv.tolist(t)
+ local r = { }
+ for i=1,#t do
+ r[i] = t[i]
+ end
+ for k,v in table.sortedhash(t) do
+ if type(k) ~= "number" then
+ r[#r+1] = k .. "=" .. v
+ end
+ end
+ return concat(r,", ")
+end
+
+--~ \startluacode
+--~ function test(opt_1, opt_2, arg_1)
+--~ context.startnarrower()
+--~ context("options 1: %s",mkiv.tolist(opt_1))
+--~ context.par()
+--~ context("options 2: %s",mkiv.tolist(opt_2))
+--~ context.par()
+--~ context("argument 1: %s",arg_1)
+--~ context.stopnarrower()
+--~ end
+
+--~ mkiv.define {
+--~ name = "test",
+--~ arguments = {
+--~ { "option", "list" },
+--~ { "option", "hash" },
+--~ { "content", "string" },
+--~ },
+--~ macro = test,
+--~ }
+--~ \stopluacode
+
+--~ test: \test[1][a=3]{whatever}
+
+--~ \startluacode
+--~ local function startmore(opt_1)
+--~ context.startnarrower()
+--~ context("start more, options: %s",mkiv.tolist(opt_1))
+--~ context.startnarrower()
+--~ end
+
+--~ local function stopmore(opt_1)
+--~ context.stopnarrower()
+--~ context("stop more, options: %s",mkiv.tolist(opt_1))
+--~ context.stopnarrower()
+--~ end
+
+--~ mkiv.define ( "more", {
+--~ environment = true,
+--~ arguments = {
+--~ { "option", "list" },
+--~ },
+--~ starter = startmore,
+--~ stopper = stopmore,
+--~ } )
+--~ \stopluacode
+
+--~ more: \startmore[1] one \startmore[2] two \stopmore one \stopmore
diff --git a/Master/texmf-dist/tex/context/base/mult-de.tex b/Master/texmf-dist/tex/context/base/mult-de.tex
index 3213fa7de93..f6f4f3bf9d1 100644
--- a/Master/texmf-dist/tex/context/base/mult-de.tex
+++ b/Master/texmf-dist/tex/context/base/mult-de.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{amrand}
\setinterfacevariable{atpage}{aufseite}
\setinterfacevariable{august}{August}
+\setinterfacevariable{author}{autor}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{zurueck}
@@ -83,7 +84,10 @@
\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{bigpreference}{grosszuegig}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{kapitel}
\setinterfacevariable{character}{buchstabe}
\setinterfacevariable{characters}{buchstaben}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{farbe}
\setinterfacevariable{column}{column}
\setinterfacevariable{columns}{spalten}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{bildschirm}
\setinterfacevariable{dot}{punkt}
\setinterfacevariable{doublesided}{doppelseitig}
+\setinterfacevariable{down}{down}
\setinterfacevariable{each}{jede}
\setinterfacevariable{edge}{kante}
\setinterfacevariable{empty}{leer}
+\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
\setinterfacevariable{enumeration}{nummerierung}
\setinterfacevariable{environment}{umgebung}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\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}
@@ -317,8 +328,12 @@
\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}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{kleinerabstand}
\setinterfacevariable{setups}{impostazioni}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{kurz}
\setinterfacevariable{singlesided}{einzelseitig}
\setinterfacevariable{slanted}{geneigt}
\setinterfacevariable{slantedbold}{geneigtfett}
@@ -410,6 +426,7 @@
\setinterfacevariable{spot}{spot}
\setinterfacevariable{standard}{standard}
\setinterfacevariable{start}{start}
+\setinterfacevariable{starter}{starter}
\setinterfacevariable{sticker}{sticker}
\setinterfacevariable{stop}{stop}
\setinterfacevariable{stopper}{trenner}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{tippen}
\setinterfacevariable{typing}{tippen}
\setinterfacevariable{unavailable}{nichtverfuegbar}
+\setinterfacevariable{underbar}{unterstrichen}
+\setinterfacevariable{underbars}{unterstreichen}
\setinterfacevariable{unit}{einheit}
\setinterfacevariable{units}{einheiten}
\setinterfacevariable{unknown}{unbekannt}
\setinterfacevariable{unpacked}{ungepackt}
+\setinterfacevariable{up}{up}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{verwende}
\setinterfacevariable{value}{wert}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{ausrichtung}
\setinterfaceconstant{aligncharacter}{aligncharacter}
\setinterfaceconstant{alignmentcharacter}{alignmentcharacter}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{titelausrichten}
\setinterfaceconstant{alternative}{alternative}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{pfeil}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{bei}
\setinterfaceconstant{author}{autor}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{cutspace}
\setinterfaceconstant{dash}{strich}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{datum}
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
@@ -594,12 +624,17 @@
\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{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{geraderand}
\setinterfaceconstant{expansion}{expansion}
+\setinterfaceconstant{export}{export}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{faktor}
\setinterfaceconstant{fallback}{fallback}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{feldoffset}
\setinterfaceconstant{file}{datei}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusout}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{global}
\setinterfaceconstant{grid}{gritter}
\setinterfaceconstant{hang}{haengend}
+\setinterfaceconstant{headalign}{headalign}
\setinterfaceconstant{headcolor}{kopffarbe}
\setinterfaceconstant{headcommand}{headcommand}
\setinterfaceconstant{headconversion}{headconversion}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{innen}
\setinterfaceconstant{innermargin}{innermargin}
\setinterfaceconstant{inputfile}{inputfile}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interaktion}
\setinterfaceconstant{interlinespace}{zeilenabstande}
\setinterfaceconstant{itemalign}{itemalign}
\setinterfaceconstant{items}{posten}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{keyexpansion}
\setinterfaceconstant{keyword}{keyword}
\setinterfaceconstant{label}{label}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{links}
\setinterfaceconstant{leftcolor}{linkerfarbe}
\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{beschriftung}
\setinterfaceconstant{marstyle}{beschrstil}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{maxhoehe}
\setinterfaceconstant{maxwidth}{maxbreite}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{menue}
\setinterfaceconstant{method}{methode}
\setinterfaceconstant{middle}{mittig}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{mindepth}
\setinterfaceconstant{minheight}{minhoehe}
\setinterfaceconstant{minwidth}{minbreite}
+\setinterfaceconstant{monthconversion}{monthconversion}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{name}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{nunten}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{folgende}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{nummernseperator}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{nummernstil}
\setinterfaceconstant{numberwidth}{numberwidth}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{oeffenaktion}
\setinterfaceconstant{openpageaction}{openpageaction}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{eigenenummer}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{pagestate}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{seitenstil}
@@ -793,16 +844,20 @@
\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{process}{process}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{radius}
\setinterfaceconstant{random}{zufaellig}
+\setinterfaceconstant{range}{range}
\setinterfaceconstant{reduction}{reduktion}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{referenz}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{referieren}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{liniendicke}
\setinterfaceconstant{samepage}{selbeseite}
\setinterfaceconstant{sample}{muster}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{format}
\setinterfaceconstant{scope}{bereich}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{seperator}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{zeichen}
\setinterfaceconstant{size}{groesse}
\setinterfaceconstant{small}{klein}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sorttype}
\setinterfaceconstant{source}{quelle}
\setinterfaceconstant{space}{spatium}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stack}
\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{sub}{unter}
\setinterfaceconstant{subtitle}{untertitel}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symausrichtung}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{obenoffset}
\setinterfaceconstant{topspace}{kopfspatium}
\setinterfaceconstant{topstate}{statusoben}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{typ}
\setinterfaceconstant{unit}{einheit}
\setinterfaceconstant{unknownreference}{unbekantereferenz}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{kopfoffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{art}
\setinterfaceconstant{wfactor}{bfaktor}
\setinterfaceconstant{white}{weiss}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{ueberstrichen}
-\setinterfacecommand{overbars}{ueberstreichen}
-\setinterfacecommand{overstrike}{durchgestrichen}
-\setinterfacecommand{overstrikes}{durchstreichen}
\setinterfacecommand{packed}{kleinerdurchschuss}
\setinterfacecommand{page}{seite}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{tippen}
\setinterfacecommand{typebuffer}{tippepuffer}
\setinterfacecommand{typefile}{tippedatei}
-\setinterfacecommand{underbar}{unterstrichen}
-\setinterfacecommand{underbars}{unterstreichen}
\setinterfacecommand{unitmeaning}{bedeutung}
\setinterfacecommand{unknown}{unbekant}
\setinterfacecommand{useJSscripts}{verwendeJSscript}
diff --git a/Master/texmf-dist/tex/context/base/mult-def.lua b/Master/texmf-dist/tex/context/base/mult-def.lua
index 2fea7dfe7fd..ce5af2bba37 100644
--- a/Master/texmf-dist/tex/context/base/mult-def.lua
+++ b/Master/texmf-dist/tex/context/base/mult-def.lua
@@ -1,3 +1,11 @@
+if not modules then modules = { } end modules ['mult-def'] = {
+ version = 1.001,
+ comment = "companion to mult-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
return {
["commands"]={
["CAPPED"]={
@@ -2821,46 +2829,6 @@ return {
["pe"]="عرض‌حاشیه‌خارجی",
["ro"]="outermarginwidth",
},
- ["overbar"]={
- ["cs"]="nadtrzeno",
- ["de"]="ueberstrichen",
- ["en"]="overbar",
- ["fr"]="overbar",
- ["it"]="sopralinea",
- ["nl"]="overstreep",
- ["pe"]="میله‌رو",
- ["ro"]="barasus",
- },
- ["overbars"]={
- ["cs"]="nadtrzeni",
- ["de"]="ueberstreichen",
- ["en"]="overbars",
- ["fr"]="overbars",
- ["it"]="sopralinee",
- ["nl"]="overstrepen",
- ["pe"]="میله‌ها‌رو",
- ["ro"]="supralinie",
- },
- ["overstrike"]={
- ["cs"]="preskrtnuto",
- ["de"]="durchgestrichen",
- ["en"]="overstrike",
- ["fr"]="surlignetout",
- ["it"]="sbarrato",
- ["nl"]="doorstreep",
- ["pe"]="خط‌زدن",
- ["ro"]="liniepeste",
- },
- ["overstrikes"]={
- ["cs"]="preskrtnuti",
- ["de"]="durchstreichen",
- ["en"]="overstrikes",
- ["fr"]="surligne",
- ["it"]="sbarrati",
- ["nl"]="doorstrepen",
- ["pe"]="خط‌زدنها",
- ["ro"]="liniipeste",
- },
["packed"]={
["cs"]="zhustene",
["de"]="kleinerdurchschuss",
@@ -6201,26 +6169,6 @@ return {
["pe"]="تایپ‌پرونده",
["ro"]="typefile",
},
- ["underbar"]={
- ["cs"]="podtrzeno",
- ["de"]="unterstrichen",
- ["en"]="underbar",
- ["fr"]="souslignetout",
- ["it"]="sottolinea",
- ["nl"]="onderstreep",
- ["pe"]="میله‌زیر",
- ["ro"]="sublinie",
- },
- ["underbars"]={
- ["cs"]="podtrzeni",
- ["de"]="unterstreichen",
- ["en"]="underbars",
- ["fr"]="sousligne",
- ["it"]="sottolinee",
- ["nl"]="onderstrepen",
- ["pe"]="میله‌‌های‌زیر",
- ["ro"]="sublinii",
- },
["unitmeaning"]={
["cs"]="vyznam",
["de"]="bedeutung",
@@ -6532,6 +6480,104 @@ return {
},
},
["constants"]={
+ ["strip"]={
+ ["en"]="strip",
+ },
+ ["order"]={
+ ["en"]="order",
+ },
+ ["headalign"]={
+ ["en"]="headalign",
+ ["nl"]="kopuitlijnen",
+ },
+ ["alignsymbol"]={
+ ["en"]="alignsymbol",
+ },
+ ["export"]={
+ ["en"]="export",
+ ["nl"]="exporteer",
+ },
+ ["database"]={
+ ["en"]="database",
+ },
+ ["artauthor"]={
+ ["en"]="artauthor",
+ },
+ ["editor"]={
+ ["en"]="editor",
+ },
+ ["authoretallimit"]={
+ ["en"]="authoretallimit",
+ },
+ ["artauthoretallimit"]={
+ ["en"]="artauthoretallimit",
+ },
+ ["editoretallimit"]={
+ ["en"]="editoretallimit",
+ },
+ ["authoretaldisplay"]={
+ ["en"]="authoretaldisplay",
+ },
+ ["artauthoretaldisplay"]={
+ ["en"]="artauthoretaldisplay",
+ },
+ ["editoretaldisplay"]={
+ ["en"]="editoretaldisplay",
+ },
+ ["authoretaltext"]={
+ ["en"]="authoretaltext",
+ },
+ ["artauthoretaltext"]={
+ ["en"]="artauthoretaltext",
+ },
+ ["editoretaltext"]={
+ ["en"]="editoretaltext",
+ },
+ ["otherstext"]={
+ ["en"]="otherstext",
+ },
+ ["andtext"]={
+ ["en"]="andtext",
+ },
+ ["totalnumber"]={
+ ["en"]="totalnumber",
+ },
+ ["firstnamesep"]={
+ ["en"]="firstnamesep",
+ },
+ ["vonsep"]={
+ ["en"]="vonsep",
+ },
+ ["juniorsep"]={
+ ["en"]="juniorsep",
+ },
+ ["surnamesep"]={
+ ["en"]="surnamesep",
+ },
+ ["lastnamesep"]={
+ ["en"]="lastnamesep",
+ },
+ ["finalnamesep"]={
+ ["en"]="finalnamesep",
+ },
+ ["namesep"]={
+ ["en"]="namesep",
+ },
+ ["pubsep"]={
+ ["en"]="pubsep",
+ },
+ ["lastpubsep"]={
+ ["en"]="lastpubsep",
+ },
+ ["refcommand"]={
+ ["en"]="refcommand",
+ },
+ ["samplesize"]={
+ ["en"]="samplesize",
+ },
+ ["maybeyear"]={
+ ["en"]="maybeyear",
+ },
["action"]={
["cs"]="akce",
["de"]="aktion",
@@ -7098,6 +7144,9 @@ return {
["pe"]="رنگ",
["ro"]="culoare",
},
+ ["intent"]={
+ ["en"]="intent",
+ },
["column"]={
["cs"]="sloupec",
["de"]="spalte",
@@ -8617,6 +8666,9 @@ return {
["pe"]="بیشترین‌ارتفاع",
["ro"]="inaltimemaxima",
},
+ ["maxdepth"]={
+ ["en"]="maxdepth",
+ },
["maxwidth"]={
["cs"]="maxsirka",
["de"]="maxbreite",
@@ -8727,6 +8779,10 @@ return {
["pe"]="کمترین‌عرض",
["ro"]="latimeminima",
},
+ ["monthconversion"]={
+ ["en"]="monthconversion",
+ ["nl"]="maandconversie",
+ },
["n"]={
["cs"]="n",
["de"]="n",
@@ -8931,6 +8987,9 @@ return {
["numberstopper"]={
["en"]="numberstopper",
},
+ ["numberstarter"]={
+ ["en"]="numberstarter",
+ },
["numberstyle"]={
["cs"]="stylcisla",
["de"]="nummernstil",
@@ -9161,6 +9220,9 @@ return {
["pageprefixstopper"]={
["en"]="pageprefixstopper",
},
+ ["pageprefixstarter"]={
+ ["en"]="pageprefixstarter",
+ },
["pagesegments"]={
["en"]="pagesegments",
},
@@ -9183,6 +9245,9 @@ return {
["pagestopper"]={
["en"]="pagestopper",
},
+ ["pagestarter"]={
+ ["en"]="pagestarter",
+ },
["pagestyle"]={
["cs"]="stylstranky",
["de"]="seitenstil",
@@ -9294,6 +9359,9 @@ return {
["prefixstopper"]={
["en"]="prefixstopper",
},
+ ["prefixstarter"]={
+ ["en"]="prefixstarter",
+ },
["preset"]={
["cs"]="prednastaveni",
["de"]="voreinstellung",
@@ -9364,6 +9432,10 @@ return {
["pe"]="تصادفی",
["ro"]="aleator",
},
+ ["range"]={
+ ["en"]="range",
+ ["nl"]="bereik",
+ },
["reduction"]={
["cs"]="redukce",
["de"]="reduktion",
@@ -9781,6 +9853,9 @@ return {
["sectionstopper"]={
["en"]="sectionstopper",
},
+ ["sectionstarter"]={
+ ["en"]="sectionstarter",
+ },
["separator"]={
["cs"]="oddelovac",
["de"]="seperator",
@@ -9891,6 +9966,9 @@ return {
["pe"]="کوچک",
["ro"]="mic",
},
+ ["sort"]={
+ ["en"]="sort",
+ },
["sorttype"]={
["cs"]="sorttype",
["de"]="sorttype",
@@ -10071,6 +10149,10 @@ return {
["pe"]="ایست",
["ro"]="stopper",
},
+ ["starter"]={
+ ["en"]="starter",
+ ["nl"]="opener",
+ },
["stretch"]={
["cs"]="natahnout",
["de"]="strecken",
@@ -11045,6 +11127,127 @@ return {
},
},
["variables"]={
+ ["end"]={
+ ["en"]="end",
+ ["nl"]="eind",
+ },
+ ["begin"]={
+ ["en"]="begin",
+ ["nl"]="begin",
+ },
+ ["down"]={
+ ["en"]="down",
+ ["nl"]="omlaag",
+ },
+ ["up"]={
+ ["en"]="up",
+ ["nl"]="omhoog",
+ },
+ ["underbar"]={
+ ["cs"]="podtrzeno",
+ ["de"]="unterstrichen",
+ ["en"]="underbar",
+ ["fr"]="souslignetout",
+ ["it"]="sottolinea",
+ ["nl"]="onderstreep",
+ ["pe"]="میله‌زیر",
+ ["ro"]="sublinie",
+ },
+ ["underbars"]={
+ ["cs"]="podtrzeni",
+ ["de"]="unterstreichen",
+ ["en"]="underbars",
+ ["fr"]="sousligne",
+ ["it"]="sottolinee",
+ ["nl"]="onderstrepen",
+ ["pe"]="میله‌‌های‌زیر",
+ ["ro"]="sublinii",
+ },
+ ["overbar"]={
+ ["cs"]="nadtrzeno",
+ ["de"]="ueberstrichen",
+ ["en"]="overbar",
+ ["fr"]="overbar",
+ ["it"]="sopralinea",
+ ["nl"]="overstreep",
+ ["pe"]="میله‌رو",
+ ["ro"]="barasus",
+ },
+ ["overbars"]={
+ ["cs"]="nadtrzeni",
+ ["de"]="ueberstreichen",
+ ["en"]="overbars",
+ ["fr"]="overbars",
+ ["it"]="sopralinee",
+ ["nl"]="overstrepen",
+ ["pe"]="میله‌ها‌رو",
+ ["ro"]="supralinie",
+ },
+ ["overstrike"]={
+ ["cs"]="preskrtnuto",
+ ["de"]="durchgestrichen",
+ ["en"]="overstrike",
+ ["fr"]="surlignetout",
+ ["it"]="sbarrato",
+ ["nl"]="doorstreep",
+ ["pe"]="خط‌زدن",
+ ["ro"]="liniepeste",
+ },
+ ["overstrikes"]={
+ ["cs"]="preskrtnuti",
+ ["de"]="durchstreichen",
+ ["en"]="overstrikes",
+ ["fr"]="surligne",
+ ["it"]="sbarrati",
+ ["nl"]="doorstrepen",
+ ["pe"]="خط‌زدنها",
+ ["ro"]="liniipeste",
+ },
+ ["maxheight"]={
+ ["en"]="maxheight",
+ },
+ ["maxdepth"]={
+ ["en"]="maxdepth",
+ },
+ ["maxwidth"]={
+ ["en"]="maxwidth",
+ },
+ ["minheight"]={
+ ["en"]="minheight",
+ },
+ ["mindepth"]={
+ ["en"]="mindepth",
+ },
+ ["minwidth"]={
+ ["en"]="minwidth",
+ },
+ ["short"]={
+ ["nl"]="kort",
+ ["en"]="short",
+ ["de"]="kurz",
+ ["cs"]="short",
+ ["it"]="short",
+ ["ro"]="short",
+ ["fr"]="short",
+ },
+ ["cite"]={
+ ["en"]="cite",
+ },
+ ["bbl"]={
+ ["en"]="bbl",
+ },
+ ["bib"]={
+ ["en"]="bib",
+ },
+ ["author"]={
+ ["nl"]="auteur",
+ ["en"]="author",
+ ["de"]="autor",
+ ["cs"]="autor",
+ ["it"]="autore",
+ ["ro"]="autor",
+ ["fr"]="auteur",
+ },
["Addition"]={
["cs"]="Pridavek",
["de"]="Zusatz",
@@ -15148,6 +15351,10 @@ return {
["pe"]="ایست",
["ro"]="stopper",
},
+ ["starter"]={
+ ["en"]="starter",
+ ["nl"]="opener",
+ },
["stretch"]={
["cs"]="natahnout",
["de"]="strecken",
@@ -15171,10 +15378,10 @@ return {
["strong"]={
["cs"]="strong",
["de"]="strong",
- ["en"]="sterk",
+ ["en"]="strong",
["fr"]="strong",
["it"]="strong",
- ["nl"]="strong",
+ ["nl"]="sterk",
["pe"]="محکم",
["ro"]="strong",
},
@@ -15841,10 +16048,10 @@ return {
["weak"]={
["cs"]="weak",
["de"]="weak",
- ["en"]="zwak",
+ ["en"]="weak",
["fr"]="weak",
["it"]="weak",
- ["nl"]="weak",
+ ["nl"]="zwak",
["pe"]="هفته",
["ro"]="weak",
},
diff --git a/Master/texmf-dist/tex/context/base/mult-en.tex b/Master/texmf-dist/tex/context/base/mult-en.tex
index 50997b1d8c5..20917a034ce 100644
--- a/Master/texmf-dist/tex/context/base/mult-en.tex
+++ b/Master/texmf-dist/tex/context/base/mult-en.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{atmargin}
\setinterfacevariable{atpage}{atpage}
\setinterfacevariable{august}{August}
+\setinterfacevariable{author}{author}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{back}
@@ -83,7 +84,10 @@
\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{bigpreference}{bigpreference}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{chapter}
\setinterfacevariable{character}{character}
\setinterfacevariable{characters}{characters}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{color}
\setinterfacevariable{column}{column}
\setinterfacevariable{columns}{columns}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{display}
\setinterfacevariable{dot}{dot}
\setinterfacevariable{doublesided}{doublesided}
+\setinterfacevariable{down}{down}
\setinterfacevariable{each}{each}
\setinterfacevariable{edge}{edge}
\setinterfacevariable{empty}{empty}
+\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
\setinterfacevariable{enumeration}{enumeration}
\setinterfacevariable{environment}{environment}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\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}
@@ -317,8 +328,12 @@
\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}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{serried}
\setinterfacevariable{setups}{setups}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{short}
\setinterfacevariable{singlesided}{singlesided}
\setinterfacevariable{slanted}{slanted}
\setinterfacevariable{slantedbold}{slantedbold}
@@ -410,12 +426,13 @@
\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{strict}{strict}
-\setinterfacevariable{strong}{sterk}
+\setinterfacevariable{strong}{strong}
\setinterfacevariable{strut}{strut}
\setinterfacevariable{sub}{sub}
\setinterfacevariable{subbackward}{subbackward}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{unavailable}
+\setinterfacevariable{underbar}{underbar}
+\setinterfacevariable{underbars}{underbars}
\setinterfacevariable{unit}{unit}
\setinterfacevariable{units}{units}
\setinterfacevariable{unknown}{unknown}
\setinterfacevariable{unpacked}{unpacked}
+\setinterfacevariable{up}{up}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{used}
\setinterfacevariable{value}{value}
@@ -482,7 +502,7 @@
\setinterfacevariable{very}{very}
\setinterfacevariable{verystrict}{verystrict}
\setinterfacevariable{verytolerant}{verytolerant}
-\setinterfacevariable{weak}{zwak}
+\setinterfacevariable{weak}{weak}
\setinterfacevariable{wednesday}{wednesday}
\setinterfacevariable{week}{week}
\setinterfacevariable{weekday}{weekday}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{align}
\setinterfaceconstant{aligncharacter}{aligncharacter}
\setinterfaceconstant{alignmentcharacter}{alignmentcharacter}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{aligntitle}
\setinterfaceconstant{alternative}{alternative}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{arrow}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{at}
\setinterfaceconstant{author}{author}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{cutspace}
\setinterfaceconstant{dash}{dash}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{date}
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
@@ -594,12 +624,17 @@
\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{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{evenmargin}
\setinterfaceconstant{expansion}{expansion}
+\setinterfaceconstant{export}{export}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{factor}
\setinterfaceconstant{fallback}{fallback}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{fieldoffset}
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusout}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{global}
\setinterfaceconstant{grid}{grid}
\setinterfaceconstant{hang}{hang}
+\setinterfaceconstant{headalign}{headalign}
\setinterfaceconstant{headcolor}{headcolor}
\setinterfaceconstant{headcommand}{headcommand}
\setinterfaceconstant{headconversion}{headconversion}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{inner}
\setinterfaceconstant{innermargin}{innermargin}
\setinterfaceconstant{inputfile}{inputfile}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interaction}
\setinterfaceconstant{interlinespace}{interlinespace}
\setinterfaceconstant{itemalign}{itemalign}
\setinterfaceconstant{items}{items}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{keyexpansion}
\setinterfaceconstant{keyword}{keyword}
\setinterfaceconstant{label}{label}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{left}
\setinterfaceconstant{leftcolor}{leftcolor}
\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{marking}
\setinterfaceconstant{marstyle}{marstyle}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{maxheight}
\setinterfaceconstant{maxwidth}{maxwidth}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{menu}
\setinterfaceconstant{method}{method}
\setinterfaceconstant{middle}{middle}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{mindepth}
\setinterfaceconstant{minheight}{minheight}
\setinterfaceconstant{minwidth}{minwidth}
+\setinterfaceconstant{monthconversion}{monthconversion}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{name}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{nbottom}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{next}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{numberseparator}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{numberstyle}
\setinterfaceconstant{numberwidth}{numberwidth}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{openaction}
\setinterfaceconstant{openpageaction}{openpageaction}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{ownnumber}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{pagestate}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{pagestyle}
@@ -793,16 +844,20 @@
\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{process}{process}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{radius}
\setinterfaceconstant{random}{random}
+\setinterfaceconstant{range}{range}
\setinterfaceconstant{reduction}{reduction}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{reference}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{referencing}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{rulethickness}
\setinterfaceconstant{samepage}{samepage}
\setinterfaceconstant{sample}{sample}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{scale}
\setinterfaceconstant{scope}{scope}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{separator}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{sign}
\setinterfaceconstant{size}{size}
\setinterfaceconstant{small}{small}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sorttype}
\setinterfaceconstant{source}{source}
\setinterfaceconstant{space}{space}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stack}
\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{sub}{sub}
\setinterfaceconstant{subtitle}{subtitle}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symalign}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{topoffset}
\setinterfaceconstant{topspace}{topspace}
\setinterfaceconstant{topstate}{topstate}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{type}
\setinterfaceconstant{unit}{unit}
\setinterfaceconstant{unknownreference}{unknownreference}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{veroffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{way}
\setinterfaceconstant{wfactor}{wfactor}
\setinterfaceconstant{white}{white}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{overbar}
-\setinterfacecommand{overbars}{overbars}
-\setinterfacecommand{overstrike}{overstrike}
-\setinterfacecommand{overstrikes}{overstrikes}
\setinterfacecommand{packed}{packed}
\setinterfacecommand{page}{page}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{underbar}
-\setinterfacecommand{underbars}{underbars}
\setinterfacecommand{unitmeaning}{unitmeaning}
\setinterfacecommand{unknown}{unknown}
\setinterfacecommand{useJSscripts}{useJSscripts}
diff --git a/Master/texmf-dist/tex/context/base/mult-fr.tex b/Master/texmf-dist/tex/context/base/mult-fr.tex
index 16f22ec7f62..5244565e983 100644
--- a/Master/texmf-dist/tex/context/base/mult-fr.tex
+++ b/Master/texmf-dist/tex/context/base/mult-fr.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{alamarge}
\setinterfacevariable{atpage}{alapage}
\setinterfacevariable{august}{aout}
+\setinterfacevariable{author}{auteur}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{retour}
@@ -83,7 +84,10 @@
\setinterfacevariable{backpart}{postface}
\setinterfacevariable{backspace}{retourarriere}
\setinterfacevariable{backward}{retourarriere}
+\setinterfacevariable{bbl}{bbl}
\setinterfacevariable{before}{avant}
+\setinterfacevariable{begin}{begin}
+\setinterfacevariable{bib}{bib}
\setinterfacevariable{big}{grand}
\setinterfacevariable{bigbodyfont}{grandepolicecorp}
\setinterfacevariable{bigpreference}{grandepreference}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{chapitre}
\setinterfacevariable{character}{caractere}
\setinterfacevariable{characters}{caracteres}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{couleur}
\setinterfacevariable{column}{colonne}
\setinterfacevariable{columns}{colonnes}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{affichage}
\setinterfacevariable{dot}{point}
\setinterfacevariable{doublesided}{rectoverso}
+\setinterfacevariable{down}{down}
\setinterfacevariable{each}{chaque}
\setinterfacevariable{edge}{bord}
\setinterfacevariable{empty}{vide}
+\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{notefin}
\setinterfacevariable{enumeration}{enumeration}
\setinterfacevariable{environment}{environement}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\setinterfacevariable{mathmatrix}{mathmatrix}
\setinterfacevariable{max}{max}
+\setinterfacevariable{maxdepth}{maxdepth}
+\setinterfacevariable{maxheight}{maxheight}
+\setinterfacevariable{maxwidth}{maxwidth}
\setinterfacevariable{may}{mai}
\setinterfacevariable{mediaeval}{medieval}
\setinterfacevariable{medium}{moyen}
\setinterfacevariable{middle}{milieu}
\setinterfacevariable{min}{min}
+\setinterfacevariable{mindepth}{mindepth}
\setinterfacevariable{minheight}{hauteurmin}
\setinterfacevariable{minwidth}{largeurmin}
\setinterfacevariable{mirrored}{reflete}
@@ -317,8 +328,12 @@
\setinterfacevariable{outer}{exterieur}
\setinterfacevariable{outeredge}{bordexterieur}
\setinterfacevariable{outermargin}{margeexterieure}
+\setinterfacevariable{overbar}{overbar}
+\setinterfacevariable{overbars}{overbars}
\setinterfacevariable{overlay}{revetement}
\setinterfacevariable{overprint}{overprint}
+\setinterfacevariable{overstrike}{surlignetout}
+\setinterfacevariable{overstrikes}{surligne}
\setinterfacevariable{packed}{groupe}
\setinterfacevariable{page}{page}
\setinterfacevariable{pagecomment}{commentairepage}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{serried}
\setinterfacevariable{setups}{reglages}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{short}
\setinterfacevariable{singlesided}{recto}
\setinterfacevariable{slanted}{incline}
\setinterfacevariable{slantedbold}{grasincline}
@@ -410,6 +426,7 @@
\setinterfacevariable{spot}{spot}
\setinterfacevariable{standard}{standard}
\setinterfacevariable{start}{demarre}
+\setinterfacevariable{starter}{starter}
\setinterfacevariable{sticker}{sticker}
\setinterfacevariable{stop}{stoppe}
\setinterfacevariable{stopper}{stopper}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{indisponible}
+\setinterfacevariable{underbar}{souslignetout}
+\setinterfacevariable{underbars}{sousligne}
\setinterfacevariable{unit}{unite}
\setinterfacevariable{units}{unites}
\setinterfacevariable{unknown}{inconnu}
\setinterfacevariable{unpacked}{degroupe}
+\setinterfacevariable{up}{up}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{used}
\setinterfacevariable{value}{valeur}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{alignement}
\setinterfaceconstant{aligncharacter}{caracterealigne}
\setinterfaceconstant{alignmentcharacter}{alignementcaractere}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{alignementtitre}
\setinterfaceconstant{alternative}{alternative}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{fleche}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{a}
\setinterfaceconstant{author}{auteur}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{cutspace}
\setinterfaceconstant{dash}{pointille}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{date}
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
@@ -594,12 +624,17 @@
\setinterfaceconstant{dy}{dy}
\setinterfaceconstant{edge}{bord}
\setinterfaceconstant{edgedistance}{distancebord}
+\setinterfaceconstant{editor}{editor}
+\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
+\setinterfaceconstant{editoretallimit}{editoretallimit}
+\setinterfaceconstant{editoretaltext}{editoretaltext}
\setinterfaceconstant{empty}{vide}
\setinterfaceconstant{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{margepaire}
\setinterfaceconstant{expansion}{expansion}
+\setinterfaceconstant{export}{export}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{facteur}
\setinterfaceconstant{fallback}{fallback}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{offsetchamp}
\setinterfaceconstant{file}{fichier}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusout}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{global}
\setinterfaceconstant{grid}{grille}
\setinterfaceconstant{hang}{suspend}
+\setinterfaceconstant{headalign}{headalign}
\setinterfaceconstant{headcolor}{couleurtete}
\setinterfaceconstant{headcommand}{commandetete}
\setinterfaceconstant{headconversion}{conversiontete}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{interieur}
\setinterfaceconstant{innermargin}{margeinterieure}
\setinterfaceconstant{inputfile}{fichierentree}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interaction}
\setinterfaceconstant{interlinespace}{espaceinterligne}
\setinterfaceconstant{itemalign}{itemalign}
\setinterfaceconstant{items}{elements}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{keyexpansion}
\setinterfaceconstant{keyword}{motcle}
\setinterfaceconstant{label}{etiquette}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{gauche}
\setinterfaceconstant{leftcolor}{couleurgauche}
\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{marquage}
\setinterfaceconstant{marstyle}{stylemarquage}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{hauteurmax}
\setinterfaceconstant{maxwidth}{largeurmax}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{menu}
\setinterfaceconstant{method}{methode}
\setinterfaceconstant{middle}{milieu}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{profondeurmin}
\setinterfaceconstant{minheight}{hauteurmin}
\setinterfaceconstant{minwidth}{largeurmin}
+\setinterfaceconstant{monthconversion}{monthconversion}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{nom}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{ninf}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{suivant}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{separateurnumbero}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{stylenumero}
\setinterfaceconstant{numberwidth}{numberwidth}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{actionouverture}
\setinterfaceconstant{openpageaction}{actionouverturepage}
\setinterfaceconstant{option}{option}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{margeexterieure}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{numeroproprio}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{etatpage}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{stylepage}
@@ -793,16 +844,20 @@
\setinterfaceconstant{prefixsegments}{prefixsegments}
\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
\setinterfaceconstant{prefixset}{prefixset}
+\setinterfaceconstant{prefixstarter}{prefixstarter}
\setinterfaceconstant{prefixstopper}{prefixstopper}
\setinterfaceconstant{preset}{prereglage}
\setinterfaceconstant{preview}{previsualisation}
\setinterfaceconstant{previous}{precedent}
\setinterfaceconstant{previousnumber}{numeroprecedent}
\setinterfaceconstant{process}{process}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{rayon}
\setinterfaceconstant{random}{aleatoire}
+\setinterfaceconstant{range}{range}
\setinterfaceconstant{reduction}{reduction}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{reference}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{referencing}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{epaisseurligne}
\setinterfaceconstant{samepage}{memepage}
\setinterfaceconstant{sample}{echantillon}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{echelle}
\setinterfaceconstant{scope}{scope}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{separateur}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{signe}
\setinterfaceconstant{size}{dimension}
\setinterfaceconstant{small}{petit}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sorttype}
\setinterfaceconstant{source}{origine}
\setinterfaceconstant{space}{espace}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stack}
\setinterfaceconstant{start}{demarre}
+\setinterfaceconstant{starter}{starter}
\setinterfaceconstant{state}{etat}
\setinterfaceconstant{step}{pas}
\setinterfaceconstant{stop}{stoppe}
\setinterfaceconstant{stopper}{taquet}
\setinterfaceconstant{stretch}{etire}
+\setinterfaceconstant{strip}{strip}
\setinterfaceconstant{strut}{strut}
\setinterfaceconstant{style}{style}
\setinterfaceconstant{sub}{sous}
\setinterfaceconstant{subtitle}{soustitre}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symalignement}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{decalagesup}
\setinterfaceconstant{topspace}{espacesup}
\setinterfaceconstant{topstate}{etatsup}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{type}
\setinterfaceconstant{unit}{unite}
\setinterfaceconstant{unknownreference}{referenceinconnue}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{veroffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{mode}
\setinterfaceconstant{wfactor}{facteurlargeur}
\setinterfaceconstant{white}{blanc}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{overbar}
-\setinterfacecommand{overbars}{overbars}
-\setinterfacecommand{overstrike}{surlignetout}
-\setinterfacecommand{overstrikes}{surligne}
\setinterfacecommand{packed}{groupe}
\setinterfacecommand{page}{page}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{dactylographier}
\setinterfacecommand{typebuffer}{tapebuffer}
\setinterfacecommand{typefile}{fichierdactylo}
-\setinterfacecommand{underbar}{souslignetout}
-\setinterfacecommand{underbars}{sousligne}
\setinterfacecommand{unitmeaning}{sensunite}
\setinterfacecommand{unknown}{inconnu}
\setinterfacecommand{useJSscripts}{utiliseJSscripts}
diff --git a/Master/texmf-dist/tex/context/base/mult-ini.lua b/Master/texmf-dist/tex/context/base/mult-ini.lua
index 06707adf87a..92a7bc62965 100644
--- a/Master/texmf-dist/tex/context/base/mult-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mult-ini.lua
@@ -1,12 +1,14 @@
if not modules then modules = { } end modules ['mult-ini'] = {
version = 1.001,
- comment = "companion to mult-ini.tex",
+ comment = "companion to mult-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local format, gmatch, gsub = string.format, string.gmatch, string.gsub
+local lpegmatch = lpeg.match
+local serialize = table.serialize
interfaces = interfaces or { }
interfaces.messages = interfaces.messages or { }
@@ -33,25 +35,30 @@ function interfaces.setmessage(category,tag,message)
m = { }
messages[category] = m
end
- m[tag] = message:gsub("%-%-","%%s")
+ m[tag] = gsub(message,"%-%-","%%s")
end
-function interfaces.getmessage(category,tag)
+function interfaces.getmessage(category,tag,default)
local m = messages[category]
- return (m and m[tag]) or "unknown message"
+ return (m and m[tag]) or default or "unknown message"
+end
+
+function interfaces.doifelsemessage(category,tag)
+ local m = messages[category]
+ return commands.testcase(m and m[tag])
end
local messagesplitter = lpeg.splitat(",")
function interfaces.makemessage(category,tag,arguments)
local m = messages[category]
- m = (m and m[tag] ) or format("unknown message, category '%s', tag '%s'",category,tag)
+ m = (m and (m[tag] or m[tostring(tag)])) or format("unknown message, category '%s', tag '%s'",category,tag)
if not m then
return m .. " " .. tag
elseif not arguments then
return m
else
- return format(m,messagesplitter:match(arguments))
+ return format(m,lpegmatch(messagesplitter,arguments))
end
end
@@ -68,3 +75,31 @@ end
function interfaces.setconstant(constant,given)
constants[given] = constant
end
+
+-- it's nicer to have numbers as reference than a hash
+
+interfaces.cachedsetups = interfaces.cachedsetups or { }
+interfaces.hashedsetups = interfaces.hashedsetups or { }
+
+storage.register("interfaces.cachedsetups", interfaces.cachedsetups, "interfaces.cachedsetups")
+storage.register("interfaces.hashedsetups", interfaces.hashedsetups, "interfaces.hashedsetups")
+
+local cachedsetups = interfaces.cachedsetups
+local hashedsetups = interfaces.hashedsetups
+
+function interfaces.cachesetup(t)
+ local hash = serialize(t)
+ local done = hashedsetups[hash]
+ if done then
+ return cachedsetups[done]
+ else
+ done = #cachedsetups + 1
+ cachedsetups[done] = t
+ hashedsetups[hash] = done
+ return t
+ end
+end
+
+function interfaces.is_command(str)
+ return (str and str ~= "" and token.csname_name(token.create(str)) ~= "") or false
+end
diff --git a/Master/texmf-dist/tex/context/base/mult-ini.mkiv b/Master/texmf-dist/tex/context/base/mult-ini.mkiv
index 5033a523336..e20548f9b5f 100644
--- a/Master/texmf-dist/tex/context/base/mult-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mult-ini.mkiv
@@ -118,6 +118,11 @@
\def\!!fill {fill}
\def\!!to {to}
\def\!!spread{spread}
+
+%D Kind of special:
+
+\edef\!!TLT{\detokenize{TLT}}
+\edef\!!TRT{\detokenize{TRT}}
%D \macros
%D {defineinterfaceconstant,
@@ -157,9 +162,9 @@
%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}}
+\unexpanded\def\defineinterfaceconstant #1#2{\setvalue{\c!prefix!#1}{#2}}
+\unexpanded\def\defineinterfacevariable #1#2{\setvalue{\v!prefix!#1}{#2}}
+\unexpanded\def\defineinterfaceelement #1#2{\setvalue{\e!prefix!#1}{#2}}
%D Next come some interface independant constants:
%D
@@ -168,12 +173,12 @@
%D \definefileconstant {name} {meaning}
%D \stoptyping
-\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}}
-\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}}
+\unexpanded\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}}
+\unexpanded\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}}
%D A new one:
-\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}}
+\unexpanded\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}}
%D And finaly we have the one argument, space saving constants
%D
@@ -182,8 +187,8 @@
%D \definemessageconstant {name}
%D \stoptyping
-\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}}
-\def\definemessageconstant #1{\setvalue{\m!prefix!#1}{#1}}
+\unexpanded\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}}
+\unexpanded\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
@@ -194,7 +199,7 @@
%D \definesystemvariable {name}
%D \stoptyping
-\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}}
+\unexpanded\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}}
\definesystemvariable{ms}
@@ -262,7 +267,7 @@
%D \stopinterface
%D \stoptyping
-\def\startinterface #1
+\unexpanded\def\startinterface #1
{\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}}
\let\stopinterface\relax
@@ -353,7 +358,7 @@
%D which puts the message text asked for in \type
%D {\currentmessagetext}.
-\def\startmessages #1 library: #2 %
+\unexpanded\def\startmessages #1 library: #2 %
{\bgroup
\ifcsname\m!prefix!#2\endcsname\else\setgvalue{\m!prefix!#2}{#2}\fi
\catcode13=\active
@@ -370,10 +375,12 @@
{\ifcsname\m!prefix!#1\endcsname\else\setgvalue{\m!prefix!#1}{#1}\fi
\ctxlua{interfaces.setmessage("#1","#2",\!!bs#3\!!es)}}
-\unexpanded\def\setmessagetext #1#2{\edef\currentmessagetext{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}}}
-\unexpanded\def\getmessage #1#2{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}}
-\unexpanded\def\makemessage #1#2#3{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.makemessage("#1","#2","#3"))}}
-\unexpanded\def\showmessage #1#2#3{\ctxlua{interfaces.showmessage("#1","#2","#3")}}
+\unexpanded\def\setmessagetext #1#2{\edef\currentmessagetext{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}}}
+\unexpanded\def\doifelsemessage #1#2{\ctxlua{interfaces.doifelsemessage("#1","#2")}}
+\unexpanded\def\getmessage #1#2{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2"))}}
+\unexpanded\def\getmessagedefault#1#2#3{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.getmessage("#1","#2","#3"))}}
+\unexpanded\def\makemessage #1#2#3{\ctxlua{tex.sprint(tex.ctxcatcodes,interfaces.makemessage("#1","#2","#3"))}}
+\unexpanded\def\showmessage #1#2#3{\ctxlua{interfaces.showmessage("#1","#2","#3")}}
%D \macros
%D {ifshowwarnings, ifshowmessages}
@@ -417,6 +424,12 @@
%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.
+%D
+%D The additional \type {\c!internal!n} prefixing is no longer
+%D needed as we now have separate interface files when dealing
+%D with setups (quick ref docs) and no longer reload the whole
+%D interface. (We no longer need the link back to the main
+%D internal interface.)
\def\doresetvalue#1#2%
{\dosetvalue{#1}{#2}{}}
@@ -664,7 +677,7 @@
%D system module. Let us define some simple setup command:
%D
%D \starttyping
-%D \def\setupbox[#1]%
+%D \unexpanded\def\setupbox[#1]%
%D {\getparameters[\??bx][#1]}
%D \stoptyping
%D
@@ -683,7 +696,7 @@
%D depending on the actual language. In dutch we just say:
%D
%D \starttyping
-%D \setupblock [width=3cm, height=1cm]
+%D \stelblokin [breedte=3cm,hoogte=1cm]
%D \stoptyping
%D
%D and get ourselves \type{\@@bxwidth} and \type{\@@bxheight}
@@ -732,7 +745,10 @@
%D \stopnarrower
%D Anno 2003 I've forgotten why the \type {\c!internal} is
-%D still in there; it's probably a left over from an experiment.
+%D still in there; it's probably a left over from the time that
+%D the user interface documents were not using a specification
+%D alongside a keyword specification but used a shared file in
+%D which case we need to go in both directions.
\let\c!internal!y \string
\def\c!internal!n {-}
@@ -757,7 +773,7 @@
%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%
+\unexpanded\def\defineinterfaceconstant#1#2%
{\setvalue{\c!prefix!#1}{#2}}
%D \macros
@@ -786,10 +802,10 @@
%D We just ignore these:
-\def\startvariables{\gobbleuntil\stopvariables}
-\def\startconstants{\gobbleuntil\stopconstants}
-\def\startelements {\gobbleuntil\stopelements}
-\def\startcommands {\gobbleuntil\stopcommands}
+\unexpanded\def\startvariables{\gobbleuntil\stopvariables}
+\unexpanded\def\startconstants{\gobbleuntil\stopconstants}
+\unexpanded\def\startelements {\gobbleuntil\stopelements}
+\unexpanded\def\startcommands {\gobbleuntil\stopcommands}
%D \macros
%D {interfaced}
diff --git a/Master/texmf-dist/tex/context/base/mult-it.tex b/Master/texmf-dist/tex/context/base/mult-it.tex
index 530a491527b..ce14800de04 100644
--- a/Master/texmf-dist/tex/context/base/mult-it.tex
+++ b/Master/texmf-dist/tex/context/base/mult-it.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{almargine}
\setinterfacevariable{atpage}{apagina}
\setinterfacevariable{august}{agosto}
+\setinterfacevariable{author}{autore}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{dietro}
@@ -83,7 +84,10 @@
\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{bigpreference}{grandepreferenza}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{capitolo}
\setinterfacevariable{character}{lettera}
\setinterfacevariable{characters}{lettere}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{colore}
\setinterfacevariable{column}{colonna}
\setinterfacevariable{columns}{colonne}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{schermo}
\setinterfacevariable{dot}{punto}
\setinterfacevariable{doublesided}{doppiafaccia}
+\setinterfacevariable{down}{down}
\setinterfacevariable{each}{ogni}
\setinterfacevariable{edge}{bordo}
\setinterfacevariable{empty}{vuoto}
+\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
\setinterfacevariable{enumeration}{enumerazione}
\setinterfacevariable{environment}{ambiente}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\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}
@@ -317,8 +328,12 @@
\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}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{vicino}
\setinterfacevariable{setups}{nastaveni}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{short}
\setinterfacevariable{singlesided}{facciasingola}
\setinterfacevariable{slanted}{inclinato}
\setinterfacevariable{slantedbold}{inclinatograssetto}
@@ -410,6 +426,7 @@
\setinterfacevariable{spot}{spot}
\setinterfacevariable{standard}{standard}
\setinterfacevariable{start}{inizia}
+\setinterfacevariable{starter}{starter}
\setinterfacevariable{sticker}{sticker}
\setinterfacevariable{stop}{termina}
\setinterfacevariable{stopper}{stopper}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{nondisponibile}
+\setinterfacevariable{underbar}{sottolinea}
+\setinterfacevariable{underbars}{sottolinee}
\setinterfacevariable{unit}{unita}
\setinterfacevariable{units}{unita}
\setinterfacevariable{unknown}{ignoto}
\setinterfacevariable{unpacked}{unpacked}
+\setinterfacevariable{up}{up}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{usato}
\setinterfacevariable{value}{valore}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{allinea}
\setinterfaceconstant{aligncharacter}{allineacarattere}
\setinterfaceconstant{alignmentcharacter}{carattereallineamento}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{allineatitolo}
\setinterfaceconstant{alternative}{alternativa}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{freccia}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{ad}
\setinterfaceconstant{author}{autore}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{cutspace}
\setinterfaceconstant{dash}{dash}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{data}
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
@@ -594,12 +624,17 @@
\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{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{marginepari}
\setinterfaceconstant{expansion}{espansione}
+\setinterfaceconstant{export}{export}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{fattore}
\setinterfaceconstant{fallback}{fallback}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{offsetcampo}
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusout}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{globale}
\setinterfaceconstant{grid}{griglia}
\setinterfaceconstant{hang}{sospendi}
+\setinterfaceconstant{headalign}{headalign}
\setinterfaceconstant{headcolor}{coloretesta}
\setinterfaceconstant{headcommand}{headcommand}
\setinterfaceconstant{headconversion}{conversionetesta}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{interno}
\setinterfaceconstant{innermargin}{margineinterno}
\setinterfaceconstant{inputfile}{inputfile}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interazione}
\setinterfaceconstant{interlinespace}{interlinea}
\setinterfaceconstant{itemalign}{itemalign}
\setinterfaceconstant{items}{elementi}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{keyexpansion}
\setinterfaceconstant{keyword}{parolachiave}
\setinterfaceconstant{label}{etichetta}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{sinistra}
\setinterfaceconstant{leftcolor}{coloresinistra}
\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{marcatura}
\setinterfaceconstant{marstyle}{stilemarcatura}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{altezzamax}
\setinterfaceconstant{maxwidth}{ampiezzamax}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{menu}
\setinterfaceconstant{method}{metodo}
\setinterfaceconstant{middle}{centro}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{mindeoth}
\setinterfaceconstant{minheight}{altezzamin}
\setinterfaceconstant{minwidth}{ampiezzamin}
+\setinterfaceconstant{monthconversion}{monthconversion}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{nome}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{nfondo}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{successivo}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{separatorenumero}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{stilenumero}
\setinterfaceconstant{numberwidth}{numberwidth}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{azioneapri}
\setinterfaceconstant{openpageaction}{azioneapripagina}
\setinterfaceconstant{option}{opzione}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{margineesterno}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{numeroproprio}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{statopagina}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{stilepagina}
@@ -793,16 +844,20 @@
\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{process}{process}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{raggio}
\setinterfaceconstant{random}{casuale}
+\setinterfaceconstant{range}{range}
\setinterfaceconstant{reduction}{riduzione}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{riferimento}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{referencing}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{spessorelinea}
\setinterfaceconstant{samepage}{stessapagina}
\setinterfaceconstant{sample}{campione}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{scala}
\setinterfaceconstant{scope}{scope}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{separatore}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{segno}
\setinterfaceconstant{size}{dimensione}
\setinterfaceconstant{small}{piccolo}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sorttype}
\setinterfaceconstant{source}{origine}
\setinterfaceconstant{space}{spazio}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stack}
\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{sub}{sotto}
\setinterfaceconstant{subtitle}{sottotitolo}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symallinea}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{offsetcima}
\setinterfaceconstant{topspace}{spaziocima}
\setinterfaceconstant{topstate}{statocima}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{type}
\setinterfaceconstant{unit}{unita}
\setinterfaceconstant{unknownreference}{riferimentoingoto}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{veroffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{modo}
\setinterfaceconstant{wfactor}{wfactor}
\setinterfaceconstant{white}{bianco}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{sopralinea}
-\setinterfacecommand{overbars}{sopralinee}
-\setinterfacecommand{overstrike}{sbarrato}
-\setinterfacecommand{overstrikes}{sbarrati}
\setinterfacecommand{packed}{impaccato}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{sottolinea}
-\setinterfacecommand{underbars}{sottolinee}
\setinterfacecommand{unitmeaning}{nomeunita}
\setinterfacecommand{unknown}{ignoto}
\setinterfacecommand{useJSscripts}{usaJSscripts}
diff --git a/Master/texmf-dist/tex/context/base/mult-mcs.tex b/Master/texmf-dist/tex/context/base/mult-mcs.tex
index bee7b777d10..98c392c9fc9 100644
--- a/Master/texmf-dist/tex/context/base/mult-mcs.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mcs.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{neznamy typ reference --}
\setinterfacemessage{references}{2}{duplicitni reference -- na strane --}
\setinterfacemessage{references}{4}{nedovolena reference --}
-\setinterfacemessage{references}{title}{reference}
\setinterfacemessage{references}{30}{neznamy objekt --}
+\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}
@@ -66,6 +69,10 @@
\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) --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{specificke volby jazyka [--] bez mezer pripojeny}
\setinterfacemessage{linguals}{title}{jazyky}
\setinterfacemessage{linguals}{10}{vzory --nacteny}
-\setinterfacemessage{regimes}{1}{kodovani --}
-\setinterfacemessage{regimes}{3}{nezname kodovani --}
-\setinterfacemessage{regimes}{2}{je nacteno kodovani --}
-\setinterfacemessage{regimes}{title}{kodovani}
+\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{verbatims}{1}{soubor -- neexistuje}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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 --}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{neznamy ovladac (driver) --}
\setinterfacemessage{specials}{6}{zanoreni neni dovoleno}
\setinterfacemessage{specials}{title}{speciality}
-\setinterfacemessage{javascript}{1}{nacita se soubor skriptu --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{neznama preambule --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{local file --}
\setinterfacemessage{databases}{4}{unknown file --}
\setinterfacemessage{databases}{title}{databases}
-\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}
-\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{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{files}{1}{synonymum souboru -- je jiz pouzito pro --}
-\setinterfacemessage{files}{title}{soubory}
\setinterfacemessage{figures}{1}{obraz -- nelze nalezt}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{obraz -- nepritomen}
@@ -194,5 +191,18 @@
\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/mult-mde.tex b/Master/texmf-dist/tex/context/base/mult-mde.tex
index a80ac4306e6..4da89ba333b 100644
--- a/Master/texmf-dist/tex/context/base/mult-mde.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mde.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{unbekannte Referenz Typ --}
\setinterfacemessage{references}{2}{doppelte Referenz -- auf Seite --}
\setinterfacemessage{references}{4}{illegale Referenz --}
-\setinterfacemessage{references}{title}{referenzen}
\setinterfacemessage{references}{30}{unbekanntes Object --}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{Sprachenspezifische Option [--] nahtlos hinzugefuegt}
\setinterfacemessage{linguals}{title}{Sprache}
\setinterfacemessage{linguals}{10}{Trennmuster --geladen}
-\setinterfacemessage{regimes}{1}{Kodierung --}
-\setinterfacemessage{regimes}{3}{Unbekannte Kodierung --}
-\setinterfacemessage{regimes}{2}{Kodierung -- ist geladen}
-\setinterfacemessage{regimes}{title}{Kodierung}
+\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{verbatims}{1}{Datei -- existiert nicht}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{unbekante Driver --}
\setinterfacemessage{specials}{6}{Verschachtelung nicht erlaubt}
\setinterfacemessage{specials}{title}{spezielles}
-\setinterfacemessage{javascript}{1}{Lade Scriptdatei --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unbekannte Preamble --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{lokale Datei --}
\setinterfacemessage{databases}{4}{unbekannte Datei --}
\setinterfacemessage{databases}{title}{Datenbank}
-\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}
-\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{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{files}{1}{Dateisynonym -- wird bereits fuer -- benutzt}
-\setinterfacemessage{files}{title}{files}
\setinterfacemessage{figures}{1}{Abbildung -- kann nicht gefunden werden}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{Abbildung -- wird nicht erstellt}
@@ -194,5 +191,18 @@
\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/mult-men.tex b/Master/texmf-dist/tex/context/base/mult-men.tex
index 8335d291143..4c1bc99420a 100644
--- a/Master/texmf-dist/tex/context/base/mult-men.tex
+++ b/Master/texmf-dist/tex/context/base/mult-men.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{unknown reference type --}
\setinterfacemessage{references}{2}{duplicate reference -- on page --}
\setinterfacemessage{references}{4}{illegal reference --}
-\setinterfacemessage{references}{title}{references}
\setinterfacemessage{references}{30}{unknown object --}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{language specific options [--] seamless appended}
\setinterfacemessage{linguals}{title}{language}
\setinterfacemessage{linguals}{10}{patterns --loaded}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{unknown regime --}
-\setinterfacemessage{regimes}{2}{regime -- is loaded}
-\setinterfacemessage{regimes}{title}{regime}
+\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{verbatims}{1}{file -- does not exist}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{unknown driver --}
\setinterfacemessage{specials}{6}{nesting is not permitted}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{loading script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unknown preamble --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{local file --}
\setinterfacemessage{databases}{4}{unknown file --}
\setinterfacemessage{databases}{title}{databases}
-\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}
-\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{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{files}{1}{file synonym -- is already used for --}
-\setinterfacemessage{files}{title}{files}
\setinterfacemessage{figures}{1}{figure -- can not be found}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{figure -- is not preset}
@@ -194,5 +191,18 @@
\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/mult-mes.lua b/Master/texmf-dist/tex/context/base/mult-mes.lua
index 6d177fd8fbb..5c812971136 100644
--- a/Master/texmf-dist/tex/context/base/mult-mes.lua
+++ b/Master/texmf-dist/tex/context/base/mult-mes.lua
@@ -1,4 +1,36 @@
+if not modules then modules = { } end modules ['mult-mes'] = {
+ version = 1.001,
+ comment = "companion to mult-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
return {
+ ["publications"]={
+ ["files"]={ "bibl-tra.mkiv" },
+ ["title"]={
+ ["en"]="publications",
+ },
+ ["1"]={
+ ["en"]="file -- not found, unknown style ignored",
+ },
+ ["2"]={
+ ["en"]="file -- not found, waiting for bibtex",
+ },
+ ["3"]={
+ ["en"]="wrote a new auxiliary file \\jobname.aux",
+ },
+ ["4"]={
+ ["en"]="loading database from --",
+ },
+ ["5"]={
+ ["en"]="warning: cite argument -- on line \\the\\inputlineno",
+ },
+ ["6"]={
+ ["en"]="loading formatting style from --",
+ },
+ },
["check"]={
["1"]={
["cs"]="postradam '=' po '--' na radku --",
@@ -1282,6 +1314,15 @@ return {
["no"]="obskur referanse -- (Prefix=--)",
["ro"]="referinta obscura -- (prefix=--)",
},
+ ["24"]={
+ ["en"]="references from document '--' are not exported",
+ },
+ ["25"]={
+ ["en"]="references from document '--' are not imported (export again)",
+ },
+ ["26"]={
+ ["en"]="references from document '--' are imported",
+ },
["3"]={
["cs"]="neznamy typ reference --",
["de"]="unbekannte Referenz Typ --",
@@ -2002,4 +2043,4 @@ return {
["ro"]="versiuni",
},
},
-} \ No newline at end of file
+}
diff --git a/Master/texmf-dist/tex/context/base/mult-mfr.tex b/Master/texmf-dist/tex/context/base/mult-mfr.tex
index ecfd88ecc25..78e4f9f17ef 100644
--- a/Master/texmf-dist/tex/context/base/mult-mfr.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mfr.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{type -- de réference inconnu}
\setinterfacemessage{references}{2}{réference -- dupliquée à la page --}
\setinterfacemessage{references}{4}{réference -- inconnue}
-\setinterfacemessage{references}{title}{réferences}
\setinterfacemessage{references}{30}{objet -- inconnu}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\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{regimes}{1}{encodage --}
-\setinterfacemessage{regimes}{3}{encodage -- inconnu}
-\setinterfacemessage{regimes}{2}{l'encodage -- est chargé}
-\setinterfacemessage{regimes}{title}{encodage}
+\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{verbatims}{1}{le fichier -- n'existe pas}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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é}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{pilote -- inconnu}
\setinterfacemessage{specials}{6}{l'imbrication n'est pas permise}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{chargement du jeu de script --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{préambule -- inconnu}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{fichier local --}
\setinterfacemessage{databases}{4}{fichier inconnu --}
\setinterfacemessage{databases}{title}{bases de données}
-\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é}
-\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{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{files}{1}{le synonyme de fichier -- est déjà utilisé pour --}
-\setinterfacemessage{files}{title}{fichiers}
\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}
@@ -194,5 +191,18 @@
\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/mult-mit.tex b/Master/texmf-dist/tex/context/base/mult-mit.tex
index 0efb03e90df..6d2a8f51608 100644
--- a/Master/texmf-dist/tex/context/base/mult-mit.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mit.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{riferimento di tipo sconosciuto --}
\setinterfacemessage{references}{2}{riferimento duplicato -- a pagina --}
\setinterfacemessage{references}{4}{riferimento illecito --}
-\setinterfacemessage{references}{title}{riferimenti}
\setinterfacemessage{references}{30}{oggetto sconosciuto --}
+\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}
@@ -66,6 +69,10 @@
\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) --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{opzioni specifiche per la lingua [--] aggiunte trasparentemente}
\setinterfacemessage{linguals}{title}{lingua}
\setinterfacemessage{linguals}{10}{schemi -- caricati}
-\setinterfacemessage{regimes}{1}{codifica --}
-\setinterfacemessage{regimes}{3}{codifica sconosciuta --}
-\setinterfacemessage{regimes}{2}{codifica -- caricata}
-\setinterfacemessage{regimes}{title}{codifica}
+\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{verbatims}{1}{il file -- non esiste}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{driver sconosciuto --}
\setinterfacemessage{specials}{6}{annidamento non permesso}
\setinterfacemessage{specials}{title}{specialitø}
-\setinterfacemessage{javascript}{1}{caricamento dello script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{preambolo sconosciuto --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{file locale --}
\setinterfacemessage{databases}{4}{file sconosciuto --}
\setinterfacemessage{databases}{title}{database}
-\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}
-\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{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{files}{1}{sinonimo file -- già in uso per --}
-\setinterfacemessage{files}{title}{file}
\setinterfacemessage{figures}{1}{figura -- non trovata}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{la figura -- non è preimpostata}
@@ -194,5 +191,18 @@
\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/mult-mnl.tex b/Master/texmf-dist/tex/context/base/mult-mnl.tex
index 5c52f7affa1..b8204a40b0c 100644
--- a/Master/texmf-dist/tex/context/base/mult-mnl.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mnl.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{type verwijzing -- onbekend}
\setinterfacemessage{references}{2}{dubbele verwijzing -- op pagina --}
\setinterfacemessage{references}{4}{verboden verwijzing --}
-\setinterfacemessage{references}{title}{verwijzingen}
\setinterfacemessage{references}{30}{onbekend object --}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{taal specifieke opties [--] naadloos toegevoegd}
\setinterfacemessage{linguals}{title}{taal}
\setinterfacemessage{linguals}{10}{patronen --geladen}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{onbekend regime --}
-\setinterfacemessage{regimes}{2}{regime -- wordt geladen}
-\setinterfacemessage{regimes}{title}{regime}
+\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{verbatims}{1}{file -- bestaat niet}
-\setinterfacemessage{verbatims}{title}{typen}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{onbekende driver --}
\setinterfacemessage{specials}{6}{nesting is niet toegestaan}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{script set -- wordt geladen}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{onbekende preamble --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{lokaal bestand --}
\setinterfacemessage{databases}{4}{onbekend bestand --}
\setinterfacemessage{databases}{title}{database}
-\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}
-\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{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{files}{1}{file synoniem -- is al in gebruik voor --}
-\setinterfacemessage{files}{title}{files}
\setinterfacemessage{figures}{1}{figuur -- is niet te vinden}
\setinterfacemessage{figures}{3}{maten van -- worden extern vastgesteld}
\setinterfacemessage{figures}{2}{figuur -- wordt niet preset}
@@ -194,5 +191,18 @@
\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/mult-mno.tex b/Master/texmf-dist/tex/context/base/mult-mno.tex
index 676c2cb2c71..ee6fd3273ec 100644
--- a/Master/texmf-dist/tex/context/base/mult-mno.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mno.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{ukjent referansetype --}
\setinterfacemessage{references}{2}{duplikat referanse -- pø side --}
\setinterfacemessage{references}{4}{ulovlig referanse --}
-\setinterfacemessage{references}{title}{referanser}
\setinterfacemessage{references}{30}{ukjent objekt --}
+\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}
@@ -66,6 +69,10 @@
\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)}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{spràk spesifikk opsjon [--] problemfritt tilføyd}
\setinterfacemessage{linguals}{title}{sprøk}
\setinterfacemessage{linguals}{10}{orddelingsmønster -- er lest inn}
-\setinterfacemessage{regimes}{1}{koding --}
-\setinterfacemessage{regimes}{3}{ukjent koding --}
-\setinterfacemessage{regimes}{2}{koding -- er lest inn}
-\setinterfacemessage{regimes}{title}{koding}
+\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{verbatims}{1}{fil -- eksisterer ikke}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{ukjent driver --}
\setinterfacemessage{specials}{6}{'nesting' er ikke tillatt}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{leser inn scriptsett --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{ukjent 'preamble' --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{lokal fil --}
\setinterfacemessage{databases}{4}{ukjent fil --}
\setinterfacemessage{databases}{title}{databaser}
-\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}
-\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{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{files}{1}{filesynonym -- er allerede brukt for --}
-\setinterfacemessage{files}{title}{filer}
\setinterfacemessage{figures}{1}{figure -- can not be found}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{figure -- is not preset}
@@ -194,5 +191,18 @@
\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/mult-mpe.tex b/Master/texmf-dist/tex/context/base/mult-mpe.tex
index 8335d291143..4c1bc99420a 100644
--- a/Master/texmf-dist/tex/context/base/mult-mpe.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mpe.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{unknown reference type --}
\setinterfacemessage{references}{2}{duplicate reference -- on page --}
\setinterfacemessage{references}{4}{illegal reference --}
-\setinterfacemessage{references}{title}{references}
\setinterfacemessage{references}{30}{unknown object --}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{language specific options [--] seamless appended}
\setinterfacemessage{linguals}{title}{language}
\setinterfacemessage{linguals}{10}{patterns --loaded}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{unknown regime --}
-\setinterfacemessage{regimes}{2}{regime -- is loaded}
-\setinterfacemessage{regimes}{title}{regime}
+\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{verbatims}{1}{file -- does not exist}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{unknown driver --}
\setinterfacemessage{specials}{6}{nesting is not permitted}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{loading script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unknown preamble --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{local file --}
\setinterfacemessage{databases}{4}{unknown file --}
\setinterfacemessage{databases}{title}{databases}
-\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}
-\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{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{files}{1}{file synonym -- is already used for --}
-\setinterfacemessage{files}{title}{files}
\setinterfacemessage{figures}{1}{figure -- can not be found}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{figure -- is not preset}
@@ -194,5 +191,18 @@
\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/mult-mro.tex b/Master/texmf-dist/tex/context/base/mult-mro.tex
index 3f52fbc70a4..da96a23a494 100644
--- a/Master/texmf-dist/tex/context/base/mult-mro.tex
+++ b/Master/texmf-dist/tex/context/base/mult-mro.tex
@@ -2,8 +2,11 @@
\setinterfacemessage{references}{3}{tip necunoscut de referinta --}
\setinterfacemessage{references}{2}{referinta duplicat -- la pagina --}
\setinterfacemessage{references}{4}{referinta eronata --}
-\setinterfacemessage{references}{title}{referinte}
\setinterfacemessage{references}{30}{obiect necunoscut --}
+\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}
@@ -66,6 +69,10 @@
\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 --}
@@ -80,15 +87,24 @@
\setinterfacemessage{linguals}{8}{optiunile specifice ale limbii [--] adaugate}
\setinterfacemessage{linguals}{title}{limbi}
\setinterfacemessage{linguals}{10}{sabloanele -- incarcate}
-\setinterfacemessage{regimes}{1}{codificarea --}
-\setinterfacemessage{regimes}{3}{codificarea -- este necunoscuta}
-\setinterfacemessage{regimes}{2}{codificarea -- este Encarcata}
-\setinterfacemessage{regimes}{title}{codificari}
+\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{verbatims}{1}{fisierul -- nu exista}
-\setinterfacemessage{verbatims}{title}{verbatim}
+\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}
@@ -107,21 +123,10 @@
\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{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{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}
@@ -134,9 +139,18 @@
\setinterfacemessage{specials}{7}{driver necunoscut --}
\setinterfacemessage{specials}{6}{imbricarea nu este permisa}
\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{javascript}{1}{se incarca scriptul --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{preambul necunoscut --}
+\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}
@@ -153,39 +167,22 @@
\setinterfacemessage{databases}{2}{fisier local --}
\setinterfacemessage{databases}{4}{fisier necunoscut --}
\setinterfacemessage{databases}{title}{baze de date}
-\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}
-\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{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{files}{1}{sinonimul fisierelor -- este folosit deja pentru --}
-\setinterfacemessage{files}{title}{fisiere}
\setinterfacemessage{figures}{1}{figura -- nu poate fi gasita}
\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
\setinterfacemessage{figures}{2}{figura -- nu este presetata}
@@ -194,5 +191,18 @@
\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/mult-nl.tex b/Master/texmf-dist/tex/context/base/mult-nl.tex
index 492220961e2..074d5f3d5c0 100644
--- a/Master/texmf-dist/tex/context/base/mult-nl.tex
+++ b/Master/texmf-dist/tex/context/base/mult-nl.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{opmarge}
\setinterfacevariable{atpage}{oppagina}
\setinterfacevariable{august}{augustus}
+\setinterfacevariable{author}{auteur}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{terug}
@@ -83,7 +84,10 @@
\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{bigpreference}{grotevoorkeur}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{hoofdstuk}
\setinterfacevariable{character}{letter}
\setinterfacevariable{characters}{letters}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{kleur}
\setinterfacevariable{column}{kolom}
\setinterfacevariable{columns}{kolommen}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{scherm}
\setinterfacevariable{dot}{punt}
\setinterfacevariable{doublesided}{dubbelzijdig}
+\setinterfacevariable{down}{omlaag}
\setinterfacevariable{each}{elk}
\setinterfacevariable{edge}{rand}
\setinterfacevariable{empty}{leeg}
+\setinterfacevariable{end}{eind}
\setinterfacevariable{endnote}{eindnoot}
\setinterfacevariable{enumeration}{doornummering}
\setinterfacevariable{environment}{omgeving}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\setinterfacevariable{mathmatrix}{wiskundematrix}
\setinterfacevariable{max}{max}
+\setinterfacevariable{maxdepth}{maxdepth}
+\setinterfacevariable{maxheight}{maxheight}
+\setinterfacevariable{maxwidth}{maxwidth}
\setinterfacevariable{may}{mei}
\setinterfacevariable{mediaeval}{mediaeval}
\setinterfacevariable{medium}{middel}
\setinterfacevariable{middle}{midden}
\setinterfacevariable{min}{min}
+\setinterfacevariable{mindepth}{mindepth}
\setinterfacevariable{minheight}{minhoogte}
\setinterfacevariable{minwidth}{minbreedte}
\setinterfacevariable{mirrored}{gespiegeld}
@@ -317,8 +328,12 @@
\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}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{aanelkaar}
\setinterfacevariable{setups}{instellingen}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{kort}
\setinterfacevariable{singlesided}{enkelzijdig}
\setinterfacevariable{slanted}{schuin}
\setinterfacevariable{slantedbold}{schuinvet}
@@ -410,12 +426,13 @@
\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{strict}{streng}
-\setinterfacevariable{strong}{strong}
+\setinterfacevariable{strong}{sterk}
\setinterfacevariable{strut}{strut}
\setinterfacevariable{sub}{sub}
\setinterfacevariable{subbackward}{subachteruit}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typen}
\setinterfacevariable{unavailable}{nietbeschikbaar}
+\setinterfacevariable{underbar}{onderstreep}
+\setinterfacevariable{underbars}{onderstrepen}
\setinterfacevariable{unit}{eenheid}
\setinterfacevariable{units}{eenheden}
\setinterfacevariable{unknown}{onbekend}
\setinterfacevariable{unpacked}{vanelkaar}
+\setinterfacevariable{up}{omhoog}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{gebruikt}
\setinterfacevariable{value}{waarde}
@@ -482,7 +502,7 @@
\setinterfacevariable{very}{zeer}
\setinterfacevariable{verystrict}{zeerstreng}
\setinterfacevariable{verytolerant}{zeersoepel}
-\setinterfacevariable{weak}{weak}
+\setinterfacevariable{weak}{zwak}
\setinterfacevariable{wednesday}{woensdag}
\setinterfacevariable{week}{week}
\setinterfacevariable{weekday}{weekdag}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{uitlijnen}
\setinterfaceconstant{aligncharacter}{karakteruitlijnen}
\setinterfaceconstant{alignmentcharacter}{uitlijnkarakter}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{titeluitlijnen}
\setinterfaceconstant{alternative}{variant}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{pijl}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{op}
\setinterfaceconstant{author}{auteur}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{snijwit}
\setinterfaceconstant{dash}{streep}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{datum}
\setinterfaceconstant{deepnumbercommand}{diepnummercommando}
\setinterfaceconstant{deeptextcommand}{dieptekstcommando}
@@ -594,12 +624,17 @@
\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{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{evenmarge}
\setinterfaceconstant{expansion}{expansie}
+\setinterfaceconstant{export}{exporteer}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{factor}
\setinterfaceconstant{fallback}{terugval}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{veldoffset}
\setinterfaceconstant{file}{file}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusuit}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{globaal}
\setinterfaceconstant{grid}{grid}
\setinterfaceconstant{hang}{hang}
+\setinterfaceconstant{headalign}{kopuitlijnen}
\setinterfaceconstant{headcolor}{kopkleur}
\setinterfaceconstant{headcommand}{kopcommando}
\setinterfaceconstant{headconversion}{kopconversie}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{binnen}
\setinterfaceconstant{innermargin}{binnenmarge}
\setinterfaceconstant{inputfile}{inputfile}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interactie}
\setinterfaceconstant{interlinespace}{interlinie}
\setinterfaceconstant{itemalign}{itemuitlijnen}
\setinterfaceconstant{items}{items}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{sleutelexpansie}
\setinterfaceconstant{keyword}{trefwoord}
\setinterfaceconstant{label}{label}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{links}
\setinterfaceconstant{leftcolor}{linkerkleur}
\setinterfaceconstant{leftcompoundhyphen}{linkerkoppelteken}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{markering}
\setinterfaceconstant{marstyle}{marletter}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{maxhoogte}
\setinterfaceconstant{maxwidth}{maxbreedte}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{menu}
\setinterfaceconstant{method}{methode}
\setinterfaceconstant{middle}{midden}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{mindiepte}
\setinterfaceconstant{minheight}{minhoogte}
\setinterfaceconstant{minwidth}{minbreedte}
+\setinterfaceconstant{monthconversion}{maandconversie}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{naam}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{nonder}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{volgende}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{nummerscheider}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{nummerletter}
\setinterfaceconstant{numberwidth}{nummerbreedte}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{openactie}
\setinterfaceconstant{openpageaction}{openpaginaactie}
\setinterfaceconstant{option}{optie}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientatie}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{buitenmarge}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{eigennummer}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{paginastatus}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{paginaletter}
@@ -793,16 +844,20 @@
\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{process}{proces}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{straal}
\setinterfaceconstant{random}{willekeur}
+\setinterfaceconstant{range}{bereik}
\setinterfaceconstant{reduction}{reductie}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{verwijzing}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{refereren}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{lijndikte}
\setinterfaceconstant{samepage}{zelfdepagina}
\setinterfaceconstant{sample}{monster}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{schaal}
\setinterfaceconstant{scope}{scope}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{scheider}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{teken}
\setinterfaceconstant{size}{formaat}
\setinterfaceconstant{small}{klein}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sortering}
\setinterfaceconstant{source}{bron}
\setinterfaceconstant{space}{spatie}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stapel}
\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{sub}{sub}
\setinterfaceconstant{subtitle}{subtitel}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symuitlijnen}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{bovenoffset}
\setinterfaceconstant{topspace}{kopwit}
\setinterfaceconstant{topstate}{bovenstatus}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{type}
\setinterfaceconstant{unit}{eenheid}
\setinterfaceconstant{unknownreference}{onbekendeverwijzing}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{kopoffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{wijze}
\setinterfaceconstant{wfactor}{bfactor}
\setinterfaceconstant{white}{wit}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{buitenrandbreedte}
\setinterfacecommand{outermargindistance}{buitenmargeafstand}
\setinterfacecommand{outermarginwidth}{buitenmargebreedte}
-\setinterfacecommand{overbar}{overstreep}
-\setinterfacecommand{overbars}{overstrepen}
-\setinterfacecommand{overstrike}{doorstreep}
-\setinterfacecommand{overstrikes}{doorstrepen}
\setinterfacecommand{packed}{opelkaar}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{paginadiepte}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{typebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{onderstreep}
-\setinterfacecommand{underbars}{onderstrepen}
\setinterfacecommand{unitmeaning}{betekenis}
\setinterfacecommand{unknown}{onbekend}
\setinterfacecommand{useJSscripts}{gebruikJSscripts}
diff --git a/Master/texmf-dist/tex/context/base/mult-ro.tex b/Master/texmf-dist/tex/context/base/mult-ro.tex
index ece67fead09..738e49f7219 100644
--- a/Master/texmf-dist/tex/context/base/mult-ro.tex
+++ b/Master/texmf-dist/tex/context/base/mult-ro.tex
@@ -75,6 +75,7 @@
\setinterfacevariable{atmargin}{lamargine}
\setinterfacevariable{atpage}{lapagina}
\setinterfacevariable{august}{august}
+\setinterfacevariable{author}{autor}
\setinterfacevariable{auto}{auto}
\setinterfacevariable{autointro}{autointro}
\setinterfacevariable{back}{inapot}
@@ -83,7 +84,10 @@
\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{bigpreference}{preferintamare}
@@ -108,6 +112,7 @@
\setinterfacevariable{chapter}{capitol}
\setinterfacevariable{character}{caracter}
\setinterfacevariable{characters}{caractere}
+\setinterfacevariable{cite}{cite}
\setinterfacevariable{color}{culoare}
\setinterfacevariable{column}{coloana}
\setinterfacevariable{columns}{coloane}
@@ -133,9 +138,11 @@
\setinterfacevariable{display}{display}
\setinterfacevariable{dot}{punct}
\setinterfacevariable{doublesided}{douafete}
+\setinterfacevariable{down}{down}
\setinterfacevariable{each}{fiecare}
\setinterfacevariable{edge}{bordura}
\setinterfacevariable{empty}{gol}
+\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
\setinterfacevariable{enumeration}{enumerare}
\setinterfacevariable{environment}{mediu}
@@ -265,11 +272,15 @@
\setinterfacevariable{mathcases}{mathcases}
\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}
@@ -317,8 +328,12 @@
\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}
@@ -386,6 +401,7 @@
\setinterfacevariable{serried}{serried}
\setinterfacevariable{setups}{setari}
\setinterfacevariable{sheet}{sheet}
+\setinterfacevariable{short}{short}
\setinterfacevariable{singlesided}{ofata}
\setinterfacevariable{slanted}{inclinat}
\setinterfacevariable{slantedbold}{inclinataldin}
@@ -410,6 +426,7 @@
\setinterfacevariable{spot}{spot}
\setinterfacevariable{standard}{standard}
\setinterfacevariable{start}{start}
+\setinterfacevariable{starter}{starter}
\setinterfacevariable{sticker}{sticker}
\setinterfacevariable{stop}{stop}
\setinterfacevariable{stopper}{stopper}
@@ -471,10 +488,13 @@
\setinterfacevariable{type}{type}
\setinterfacevariable{typing}{typing}
\setinterfacevariable{unavailable}{nedisponibil}
+\setinterfacevariable{underbar}{sublinie}
+\setinterfacevariable{underbars}{sublinii}
\setinterfacevariable{unit}{unitate}
\setinterfacevariable{units}{unitati}
\setinterfacevariable{unknown}{necunoscut}
\setinterfacevariable{unpacked}{despachetat}
+\setinterfacevariable{up}{up}
\setinterfacevariable{url}{url}
\setinterfacevariable{used}{folosit}
\setinterfacevariable{value}{valoare}
@@ -502,12 +522,21 @@
\setinterfaceconstant{align}{aliniere}
\setinterfaceconstant{aligncharacter}{aliniazacaracter}
\setinterfaceconstant{alignmentcharacter}{alierecaracter}
+\setinterfaceconstant{alignsymbol}{alignsymbol}
\setinterfaceconstant{aligntitle}{alinieretitlu}
\setinterfaceconstant{alternative}{alternativ}
+\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arrow}{sageata}
+\setinterfaceconstant{artauthor}{artauthor}
+\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
+\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
+\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
\setinterfaceconstant{at}{la}
\setinterfaceconstant{author}{autor}
+\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
+\setinterfaceconstant{authoretallimit}{authoretallimit}
+\setinterfaceconstant{authoretaltext}{authoretaltext}
\setinterfaceconstant{auto}{auto}
\setinterfaceconstant{autofile}{autofile}
\setinterfaceconstant{autofocus}{autofocus}
@@ -576,6 +605,7 @@
\setinterfaceconstant{cutspace}{cutspace}
\setinterfaceconstant{dash}{dash}
\setinterfaceconstant{dat}{dat}
+\setinterfaceconstant{database}{database}
\setinterfaceconstant{date}{data}
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
@@ -594,12 +624,17 @@
\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{equalheight}{equalheight}
\setinterfaceconstant{equalwidth}{equalwidth}
\setinterfaceconstant{escape}{escape}
\setinterfaceconstant{evenmargin}{marginepara}
\setinterfaceconstant{expansion}{expansiune}
+\setinterfaceconstant{export}{export}
\setinterfaceconstant{extras}{extras}
\setinterfaceconstant{factor}{factor}
\setinterfaceconstant{fallback}{fallback}
@@ -610,6 +645,8 @@
\setinterfaceconstant{fieldoffset}{offsetcamp}
\setinterfaceconstant{file}{fisier}
\setinterfaceconstant{filtercommand}{filtercommand}
+\setinterfaceconstant{finalnamesep}{finalnamesep}
+\setinterfaceconstant{firstnamesep}{firstnamesep}
\setinterfaceconstant{focus}{focus}
\setinterfaceconstant{focusin}{focusin}
\setinterfaceconstant{focusout}{focusout}
@@ -631,6 +668,7 @@
\setinterfaceconstant{global}{global}
\setinterfaceconstant{grid}{grid}
\setinterfaceconstant{hang}{suspenda}
+\setinterfaceconstant{headalign}{headalign}
\setinterfaceconstant{headcolor}{culoaretitlu}
\setinterfaceconstant{headcommand}{headcommand}
\setinterfaceconstant{headconversion}{conversietitlu}
@@ -658,14 +696,18 @@
\setinterfaceconstant{inner}{intern}
\setinterfaceconstant{innermargin}{innermargin}
\setinterfaceconstant{inputfile}{inputfile}
+\setinterfaceconstant{intent}{intent}
\setinterfaceconstant{interaction}{interactiune}
\setinterfaceconstant{interlinespace}{spatiereinterliniara}
\setinterfaceconstant{itemalign}{itemalign}
\setinterfaceconstant{items}{elemente}
+\setinterfaceconstant{juniorsep}{juniorsep}
\setinterfaceconstant{ken}{ken}
\setinterfaceconstant{keyexpansion}{keyexpansion}
\setinterfaceconstant{keyword}{keyword}
\setinterfaceconstant{label}{eticheta}
+\setinterfaceconstant{lastnamesep}{lastnamesep}
+\setinterfaceconstant{lastpubsep}{lastpubsep}
\setinterfaceconstant{left}{stanga}
\setinterfaceconstant{leftcolor}{culoarestanga}
\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
@@ -705,8 +747,10 @@
\setinterfaceconstant{marking}{marcaje}
\setinterfaceconstant{marstyle}{stilmarcaj}
\setinterfaceconstant{max}{max}
+\setinterfaceconstant{maxdepth}{maxdepth}
\setinterfaceconstant{maxheight}{inaltimemaxima}
\setinterfaceconstant{maxwidth}{latimemaxima}
+\setinterfaceconstant{maybeyear}{maybeyear}
\setinterfaceconstant{menu}{meniu}
\setinterfaceconstant{method}{metoda}
\setinterfaceconstant{middle}{mijloc}
@@ -717,8 +761,10 @@
\setinterfaceconstant{mindepth}{mindepth}
\setinterfaceconstant{minheight}{inaltimeminima}
\setinterfaceconstant{minwidth}{latimeminima}
+\setinterfaceconstant{monthconversion}{monthconversion}
\setinterfaceconstant{n}{n}
\setinterfaceconstant{name}{nume}
+\setinterfaceconstant{namesep}{namesep}
\setinterfaceconstant{nbottom}{njos}
\setinterfaceconstant{nc}{nc}
\setinterfaceconstant{next}{urmatorul}
@@ -742,6 +788,7 @@
\setinterfaceconstant{numberseparator}{separatornumar}
\setinterfaceconstant{numberseparatorset}{numberseparatorset}
\setinterfaceconstant{numberset}{numberset}
+\setinterfaceconstant{numberstarter}{numberstarter}
\setinterfaceconstant{numberstopper}{numberstopper}
\setinterfaceconstant{numberstyle}{stilnumar}
\setinterfaceconstant{numberwidth}{numberwidth}
@@ -754,7 +801,9 @@
\setinterfaceconstant{openaction}{actiunedeschidere}
\setinterfaceconstant{openpageaction}{actiunedeschiderepagina}
\setinterfaceconstant{option}{optiune}
+\setinterfaceconstant{order}{order}
\setinterfaceconstant{orientation}{orientation}
+\setinterfaceconstant{otherstext}{otherstext}
\setinterfaceconstant{outermargin}{outermargin}
\setinterfaceconstant{overprint}{overprint}
\setinterfaceconstant{ownnumber}{numarpropriu}
@@ -772,10 +821,12 @@
\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
\setinterfaceconstant{pageprefixset}{pageprefixset}
+\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
\setinterfaceconstant{pagesegments}{pagesegments}
\setinterfaceconstant{pageseparatorset}{pageseparatorset}
\setinterfaceconstant{pageset}{pageset}
+\setinterfaceconstant{pagestarter}{pagestarter}
\setinterfaceconstant{pagestate}{pagestate}
\setinterfaceconstant{pagestopper}{pagestopper}
\setinterfaceconstant{pagestyle}{stilpagina}
@@ -793,16 +844,20 @@
\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{process}{process}
+\setinterfaceconstant{pubsep}{pubsep}
\setinterfaceconstant{radius}{raza}
\setinterfaceconstant{random}{aleator}
+\setinterfaceconstant{range}{range}
\setinterfaceconstant{reduction}{reducere}
\setinterfaceconstant{ref}{ref}
+\setinterfaceconstant{refcommand}{refcommand}
\setinterfaceconstant{reference}{referinta}
\setinterfaceconstant{referenceprefix}{referenceprefix}
\setinterfaceconstant{referencing}{referinta}
@@ -836,6 +891,7 @@
\setinterfaceconstant{rulethickness}{grosimerigla}
\setinterfaceconstant{samepage}{aceeasipagina}
\setinterfaceconstant{sample}{exemplu}
+\setinterfaceconstant{samplesize}{samplesize}
\setinterfaceconstant{saveinlist}{saveinlist}
\setinterfaceconstant{scale}{scala}
\setinterfaceconstant{scope}{scop}
@@ -848,6 +904,7 @@
\setinterfaceconstant{sectionsegments}{sectionsegments}
\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
\setinterfaceconstant{sectionset}{sectionset}
+\setinterfaceconstant{sectionstarter}{sectionstarter}
\setinterfaceconstant{sectionstopper}{sectionstopper}
\setinterfaceconstant{separator}{separator}
\setinterfaceconstant{set}{set}
@@ -860,6 +917,7 @@
\setinterfaceconstant{sign}{semn}
\setinterfaceconstant{size}{dimensiune}
\setinterfaceconstant{small}{mic}
+\setinterfaceconstant{sort}{sort}
\setinterfaceconstant{sorttype}{sorttype}
\setinterfaceconstant{source}{sursa}
\setinterfaceconstant{space}{spatiu}
@@ -874,16 +932,19 @@
\setinterfaceconstant{spot}{spot}
\setinterfaceconstant{stack}{stack}
\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{sub}{sub}
\setinterfaceconstant{subtitle}{subtitlu}
\setinterfaceconstant{suffix}{suffix}
+\setinterfaceconstant{surnamesep}{surnamesep}
\setinterfaceconstant{sx}{sx}
\setinterfaceconstant{sy}{sy}
\setinterfaceconstant{symalign}{symaliniere}
@@ -923,6 +984,7 @@
\setinterfaceconstant{topoffset}{offsetsus}
\setinterfaceconstant{topspace}{spatiusus}
\setinterfaceconstant{topstate}{staresus}
+\setinterfaceconstant{totalnumber}{totalnumber}
\setinterfaceconstant{type}{type}
\setinterfaceconstant{unit}{unitate}
\setinterfaceconstant{unknownreference}{referintanecunoscuta}
@@ -933,6 +995,7 @@
\setinterfaceconstant{veroffset}{veroffset}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{voffset}{voffset}
+\setinterfaceconstant{vonsep}{vonsep}
\setinterfaceconstant{way}{mod}
\setinterfaceconstant{wfactor}{factorw}
\setinterfaceconstant{white}{alb}
@@ -1261,10 +1324,6 @@
\setinterfacecommand{outeredgewidth}{outeredgewidth}
\setinterfacecommand{outermargindistance}{outermargindistance}
\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{overbar}{barasus}
-\setinterfacecommand{overbars}{supralinie}
-\setinterfacecommand{overstrike}{liniepeste}
-\setinterfacecommand{overstrikes}{liniipeste}
\setinterfacecommand{packed}{impachetat}
\setinterfacecommand{page}{pagina}
\setinterfacecommand{pagedepth}{pagedepth}
@@ -1599,8 +1658,6 @@
\setinterfacecommand{type}{type}
\setinterfacecommand{typebuffer}{scriebuffer}
\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{underbar}{sublinie}
-\setinterfacecommand{underbars}{sublinii}
\setinterfacecommand{unitmeaning}{numeunitate}
\setinterfacecommand{unknown}{necunoscut}
\setinterfacecommand{useJSscripts}{folosestescriptJS}
diff --git a/Master/texmf-dist/tex/context/base/mult-sys.tex b/Master/texmf-dist/tex/context/base/mult-sys.tex
index 2fd74251c74..d48ce0a94e6 100644
--- a/Master/texmf-dist/tex/context/base/mult-sys.tex
+++ b/Master/texmf-dist/tex/context/base/mult-sys.tex
@@ -50,6 +50,7 @@
\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}
@@ -63,6 +64,7 @@
\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}
@@ -81,15 +83,45 @@
\definesystemconstant {Slanted}
\definesystemconstant {Unicode}
-\definesystemconstant {Serif} \definesystemconstant {Regular}
-\definesystemconstant {Sans} \definesystemconstant {Support}
-\definesystemconstant {Mono} \definesystemconstant {Type}
+\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.
@@ -119,6 +151,7 @@
\definemessageconstant {versions}
\definemessageconstant {metapost}
\definemessageconstant {chemicals}
+\definemessageconstant {publications}
%D Net come some \CONTEXT\ constants, used in the definition
%D of private commands:
@@ -157,6 +190,19 @@
\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}
%D A more experienced \TEX\ user will recognize the next four
%D constants. We need these because font-definitions are
@@ -180,6 +226,7 @@
\definesystemconstant {mapping}
\definesystemconstant {language}
\definesystemconstant {patterns}
+\definesystemconstant {rname}
\definesystemconstant {rscale}
\definesystemconstant {handling}
\definesystemconstant {features}
@@ -212,6 +259,12 @@
\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.
@@ -386,6 +439,7 @@
\definesystemvariable {ab} % AlignedBoxes
\definesystemvariable {ac} % ACcent
+\definesystemvariable {ae} % AttributEs
\definesystemvariable {ag} % AchterGrond
\definesystemvariable {al} % ALinea's
\definesystemvariable {am} % interActieMenu
@@ -450,6 +504,7 @@
\definesystemvariable {fl} % Floats
\definesystemvariable {fm} % ForMules
\definesystemvariable {fn} % subformulas
+\definesystemvariable {fo} % xml FO
\definesystemvariable {fp} % FilegroeP
\definesystemvariable {fq} % Features
\definesystemvariable {fr} % ForM
@@ -457,12 +512,15 @@
\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
@@ -508,12 +566,14 @@
\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
@@ -530,7 +590,7 @@
\definesystemvariable {ov} % OVerlay
\definesystemvariable {ox} % OffsetBox
\definesystemvariable {pa} % PAlet
-\definesystemvariable {pb} % PuBlicatie
+\definesystemvariable {pb} % PuBlication
\definesystemvariable {pc} % PageComment
\definesystemvariable {pe} % PagEhandler
\definesystemvariable {pf} % ProFiel
@@ -544,6 +604,8 @@
\definesystemvariable {ps} % PoSitioneren
\definesystemvariable {pt} % PageshifT
\definesystemvariable {py} % PropertYs
+\definesystemvariable {pv} % PublicationVariable
+\definesystemvariable {ra} % RAise
\definesystemvariable {rd} % RenDering
\definesystemvariable {rf} % ReFereren
\definesystemvariable {rg} % ReGel
@@ -590,6 +652,7 @@
\definesystemvariable {tm} % TypesynonyM
\definesystemvariable {tp} % TyPen
\definesystemvariable {tx} % TeXtflow
+\definesystemvariable {to} % TOlerance
\definesystemvariable {tr} % TRacer
\definesystemvariable {ts} % TypeScript
\definesystemvariable {tt} % TabulaTe
@@ -598,12 +661,15 @@
\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
@@ -680,6 +746,7 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/node-aux.lua b/Master/texmf-dist/tex/context/base/node-aux.lua
new file mode 100644
index 00000000000..9ed71fd728c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-aux.lua
@@ -0,0 +1,145 @@
+if not modules then modules = { } end modules ['node-aux'] = {
+ version = 1.001,
+ comment = "companion to node-spl.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local gsub, format = string.gsub, string.format
+
+local free_node = node.free
+local hpack_nodes = node.hpack
+local node_fields = node.fields
+
+function nodes.repack_hlist(list,...)
+ local temp, b = hpack_nodes(list,...)
+ list = temp.list
+ temp.list = nil
+ free_node(temp)
+ return list, b
+end
+
+function nodes.merge(a,b)
+ if a and b then
+ local t = node.fields(a.id)
+ for i=3,#t do
+ local name = t[i]
+ a[name] = b[name]
+ end
+ end
+ return a, b
+end
+
+local fields, whatsitfields = { }, { }
+
+for k, v in next, node.types() do
+ if v == "whatsit" then
+ fields[k], fields[v] = { }, { }
+ for kk, vv in next, node.whatsits() do
+ local f = node_fields(k,kk)
+ whatsitfields[kk], whatsitfields[vv] = f, f
+ end
+ else
+ local f = node_fields(k)
+ fields[k], fields[v] = f, f
+ end
+end
+
+nodes.fields, nodes.whatsitfields = fields, whatsitfields
+
+function nodes.info(n)
+ local id = n.id
+ local tp = node.type(id)
+ local list = (tp == "whatsit" and whatsitfields[n.subtype]) or fields[id]
+ logs.report(format("%14s","type"),tp)
+ for k,v in next, list do
+ logs.report(format("%14s",v),gsub(gsub(tostring(n[v]),"%s+"," "),"node ",""))
+ end
+end
+
+-- history:
+--
+-- local function cp_skipable(a,id) -- skipable nodes at the margins during character protrusion
+-- return (
+-- id ~= glyph_node
+-- or id == ins_node
+-- or id == mark_node
+-- or id == adjust_node
+-- or id == penalty_node
+-- or (id == glue_node and a.spec.writable)
+-- or (id == disc_node and a.pre == nil and a.post == nil and a.replace == nil)
+-- or (id == math_node and a.surround == 0)
+-- or (id == kern_node and (a.kern == 0 or a.subtype == NORMAL))
+-- or (id == hlist_node and a.width == 0 and a.height == 0 and a.depth == 0 and a.list == nil)
+-- or (id == whatsit_node and a.subtype ~= pdf_refximage_node and a.subtype ~= pdf_refxform_node)
+-- )
+-- end
+--
+-- local function glyph_width(a)
+-- local ch = chardata[a.font][a.char]
+-- return (ch and ch.width) or 0
+-- end
+--
+-- local function glyph_total(a)
+-- local ch = chardata[a.font][a.char]
+-- return (ch and (ch.height+ch.depth)) or 0
+-- end
+--
+-- local function non_discardable(a) -- inline
+-- return a.id < math_node -- brrrr
+-- end
+--
+-- local function calculate_badness(t,s)
+-- if t == 0 then
+-- return 0
+-- elseif s <= 0 then
+-- return INF_BAD
+-- else
+-- local r
+-- if t <= 7230584 then
+-- r = t * 297 / s
+-- elseif s >= 1663497 then
+-- r = t / floor(s / 297)
+-- else
+-- r = t
+-- end
+-- r = floor(r)
+-- if r > 1290 then
+-- return INF_BAD
+-- else
+-- return floor((r * r * r + 0x20000) / 0x40000) -- 0400000 / 01000000
+-- end
+-- end
+-- end
+--
+-- left-overs
+--
+-- local function round_xn_over_d(x, n, d)
+-- local positive -- was x >= 0
+-- if x >= 0 then
+-- positive = true
+-- else
+-- x = -x
+-- positive = false
+-- end
+-- local t = floor(x % 0x8000) * n -- 0100000
+-- local f = floor(t / 0x8000) -- 0100000
+-- local u = floor(x / 0x8000) * n + f -- 0100000
+-- local v = floor(u % d) * 0x8000 + f -- 0100000
+-- if floor(u / d) >= 0x8000 then -- 0100000
+-- logs.error("parbuilder",'arith_error')
+-- else
+-- u = 0x8000 * floor(u / d) + floor(v / d) -- 0100000
+-- end
+-- v = floor(v % d)
+-- if 2*v >= d then
+-- u = u + 1
+-- end
+-- if positive then
+-- return u
+-- else
+-- return -u
+-- end
+-- end
+
diff --git a/Master/texmf-dist/tex/context/base/node-bck.lua b/Master/texmf-dist/tex/context/base/node-bck.lua
index 6a01294f84d..94fbac85fd4 100644
--- a/Master/texmf-dist/tex/context/base/node-bck.lua
+++ b/Master/texmf-dist/tex/context/base/node-bck.lua
@@ -1,11 +1,14 @@
if not modules then modules = { } end modules ['node-bck'] = {
version = 1.001,
- comment = "companion to node-bck.tex",
+ comment = "companion to node-bck.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
+-- beware, this one takes quite some runtime, so we need a status flag
+-- maybe some page related state
+
local hlist = node.id("hlist")
local vlist = node.id("vlist")
diff --git a/Master/texmf-dist/tex/context/base/node-bck.mkiv b/Master/texmf-dist/tex/context/base/node-bck.mkiv
index 758e598e836..41a6da2cb48 100644
--- a/Master/texmf-dist/tex/context/base/node-bck.mkiv
+++ b/Master/texmf-dist/tex/context/base/node-bck.mkiv
@@ -84,14 +84,14 @@
\global\maxtabularcolorcolumn\tabulatecolumn
\fi
\setxvalue{\??tt:c:\the\tabulatecolumn}{#1}%
- \dosetattribute{background}\plusone
+ \attribute\backgroundattribute\plusone
\faststartcolor[#1]\strut\char0\faststopcolor
\endgroup}
\def\repeatsettabulatecolor
{\begingroup
\ifcsname\??tt:c:\the\tabulatecolumn\endcsname
- \dosetattribute{background}\plusone
+ \attribute\backgroundattribute\plusone
\faststartcolor[\csname\??tt:c:\the\tabulatecolumn\endcsname]\strut\char0\faststopcolor
\fi
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/node-dir.lua b/Master/texmf-dist/tex/context/base/node-dir.lua
new file mode 100644
index 00000000000..05e4835e507
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-dir.lua
@@ -0,0 +1,308 @@
+if not modules then modules = { } end modules ['node-mir'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Taco Hoekwater and Hans Hagen",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[
+<p>In the process of cleaning up the lua variant of the parbuilder
+we ran into a couple of functions (translated c macros) that were
+somewhat inefficient. More convenient is to use hashes although at
+the c-end still macros are used. In the process directions.h was
+adapted and now has the mappings as comments. This lua file is
+based on that file.
+]]--
+
+
+nodes = nodes or { }
+
+nodes.is_mirrored = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+}
+
+nodes.is_rotated = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+}
+
+nodes.textdir_is_parallel = {
+ TLT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT= {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ }
+}
+
+nodes.pardir_is_parallel = {
+ TLT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+}
+
+nodes.pardir_is_opposite = {
+ TLT = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ -- RTT = false,
+ },
+}
+
+nodes.textdir_is_opposite = {
+ TLT = {
+ -- TLT = false,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT= {
+ TLT = true, ["+TLT"] = true,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+}
+
+nodes.glyphdir_is_opposite = {
+ TLT = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT= {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+}
+
+nodes.pardir_is_equal = {
+ TLT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT= {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL= {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ -- RTT = false,
+ },
+ RTT= {
+ -- TLT = false,
+ -- TRT = false,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+ },
+}
+
+nodes.textdir_is_equal = {
+ TLT = {
+ TLT = true, ["+TLT"] = true,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ TRT= {
+ -- TLT = false,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+ RTT = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+}
+
+nodes.glyphdir_is_equal = {
+ TLT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+ },
+ TRT= {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+ },
+ LTL = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ -- RTT = false,
+ },
+ RTT = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ RTT = true, ["+RTT"] = true,
+ },
+}
+
+nodes.partextdir_is_equal = {
+ TLT = {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+ TRT= {
+ -- TLT = false,
+ -- TRT = false,
+ LTL = true, ["+LTL"] = true,
+ RTT = true, ["+RTT"] = true,
+ },
+ LTL = {
+ TLT = true, ["+TLT"] = true,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+ },
+ RTT = {
+ -- TLT = false,
+ TRT = true, ["+TRT"] = true,
+ -- LTL = false,
+ -- RTT = false,
+ },
+}
+
+nodes.textdir_is_is = {
+ TLT = true, ["+TLT"] = true,
+ -- TRT = false,
+ -- LTL = false,
+ -- RTT = false,
+}
+
+nodes.glyphdir_is_orthogonal = {
+ TLT = true, ["+TLT"] = true,
+ TRT = true, ["+TRT"] = true,
+ LTL = true, ["+LTL"] = true,
+ -- RTT = false
+}
+
+nodes.dir_is_pop = {
+ ["-TRT"] = true,
+ ["-TLT"] = true,
+ ["-LTL"] = true,
+ ["-RTT"] = true,
+}
+
+nodes.dir_negation = {
+ ["-TRT"] = "+TRT",
+ ["-TLT"] = "+TLT",
+ ["-LTL"] = "+LTL",
+ ["-RTT"] = "+RTT",
+ ["+TRT"] = "-TRT",
+ ["+TLT"] = "-TLT",
+ ["+LTL"] = "-LTL",
+ ["+RTT"] = "-RTT",
+}
diff --git a/Master/texmf-dist/tex/context/base/node-ext.lua b/Master/texmf-dist/tex/context/base/node-ext.lua
index b098829cd81..5c4eec8de11 100644
--- a/Master/texmf-dist/tex/context/base/node-ext.lua
+++ b/Master/texmf-dist/tex/context/base/node-ext.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-ext'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/node-fin.lua b/Master/texmf-dist/tex/context/base/node-fin.lua
index e83a354f24c..c6e3be44815 100644
--- a/Master/texmf-dist/tex/context/base/node-fin.lua
+++ b/Master/texmf-dist/tex/context/base/node-fin.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-fin'] = {
version = 1.001,
- comment = "companion to node-fin.tex",
+ comment = "companion to node-fin.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -75,7 +75,7 @@ end
local function process_attribute(head,plugin) -- head,attribute,enabled,initializer,resolver,processor,finalizer
local namespace = plugin.namespace
- if namespace.enabled then
+ if namespace.enabled ~= false then -- this test will go away
starttiming(attributes)
local done, used, ok = false, nil, false
local attribute = namespace.attribute or numbers[plugin.name] -- todo: plugin.attribute
@@ -438,7 +438,5 @@ states.stacked = stacked
-- -- --
statistics.register("attribute processing time", function()
- if statistics.elapsedindeed(attributes) then
- return format("%s seconds (front- and backend)",statistics.elapsedtime(attributes))
- end
+ return statistics.elapsedseconds(attributes,"front- and backend")
end)
diff --git a/Master/texmf-dist/tex/context/base/node-fin.mkiv b/Master/texmf-dist/tex/context/base/node-fin.mkiv
index 8c15eb57db2..ea9e83f16b5 100644
--- a/Master/texmf-dist/tex/context/base/node-fin.mkiv
+++ b/Master/texmf-dist/tex/context/base/node-fin.mkiv
@@ -20,20 +20,22 @@
\registerctxluafile{node-fin}{1.001} % we might generalize this one
-\definesystemattribute[trigger] % feature inheritance
+\definesystemattribute[trigger] \chardef\triggerattribute \dogetattributeid{trigger} % feature inheritance
\def\finalizeobjectbox #1{\ctxlua{nodes.process_page(tex.box[\number#1])}}
\def\finalizeshipoutbox#1{\ctxlua{nodes.process_page(tex.box[\number#1])}}
% tricky stuff:
+% THIS MIGHT BECOME OBSOLETE.
+
\newcount\attributeboxcount
-\edef\startinheritattributes{\dosetattribute {trigger}{1}}
-\edef\stopinheritattributes {\doresetattribute{trigger}}
+\edef\startinheritattributes{\attribute\triggerattribute\plusone}
+\edef\stopinheritattributes {\attribute\triggerattribute\attributeunsetvalue}
-\def\doattributedcopy {\afterassignment\dodoattributedcopy\attributeboxcount}
-\def\doattributedbox {\afterassignment\dodoattributedbox \attributeboxcount}
+\def\doattributedcopy{\afterassignment\dodoattributedcopy\attributeboxcount}
+\def\doattributedbox {\afterassignment\dodoattributedbox \attributeboxcount}
\def\dodoattributedcopy
{\startinheritattributes
diff --git a/Master/texmf-dist/tex/context/base/node-fnt.lua b/Master/texmf-dist/tex/context/base/node-fnt.lua
index 3ad9060c307..b0d073425cc 100644
--- a/Master/texmf-dist/tex/context/base/node-fnt.lua
+++ b/Master/texmf-dist/tex/context/base/node-fnt.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-fnt'] = {
version = 1.001,
- comment = "companion to font-ini.tex",
+ 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"
@@ -45,13 +45,15 @@ if tex.attribute[0] < 0 then
end
+-- this will be redone and split in a generic one and a context one
+
function nodes.process_characters(head)
-- either next or not, but definitely no already processed list
starttiming(nodes)
local usedfonts, attrfonts, done = { }, { }, false
local a, u, prevfont, prevattr = 0, 0, nil, 0
for n in traverse_id(glyph,head) do
- local font, attr = n.font, has_attribute(n,0) -- zero attribute is reserved for fonts, preset to 0 is faster (first match)
+ local font, attr = n.font, has_attribute(n,0) -- zero attribute is reserved for fonts in context
if attr and attr > 0 then
if font ~= prevfont or attr ~= prevattr then
local used = attrfonts[font]
@@ -107,7 +109,7 @@ function nodes.process_characters(head)
head, done = h or head, done or d
if n > 1 then
for i=2,n do
- local h, d = processors[i](head,font,0) -- false)
+ local h, d = processors[i](head,font,false)
head, done = h or head, done or d
end
end
@@ -119,7 +121,7 @@ function nodes.process_characters(head)
head, done = h or head, done or d
if n > 1 then
for i=2,n do
- local h, d = processors[i](head,font,0) -- false)
+ local h, d = processors[i](head,font,false)
head, done = h or head, done or d
end
end
@@ -178,7 +180,6 @@ else do
-- X000 1100 = 12 = 0x1C = leftghost
-- X001 0100 = 20 = 0x14 = rightghost
-
function nodes.protect_glyphs(head)
local done = false
for g in traverse_id(glyph,head) do
diff --git a/Master/texmf-dist/tex/context/base/node-ini.lua b/Master/texmf-dist/tex/context/base/node-ini.lua
index 3ff73c62f16..36e240238e3 100644
--- a/Master/texmf-dist/tex/context/base/node-ini.lua
+++ b/Master/texmf-dist/tex/context/base/node-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-ini'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -108,10 +108,12 @@ local penalty = node.id('penalty')
local kern = node.id('kern')
local whatsit = node.id('whatsit')
-local traverse_id = node.traverse_id
-local traverse = node.traverse
-local free_node = node.free
-local remove_node = node.remove
+local traverse_id = node.traverse_id
+local traverse = node.traverse
+local free_node = node.free
+local remove_node = node.remove
+local insert_node_before = node.insert_before
+local insert_node_after = node.insert_after
function nodes.remove(head, current, free_too)
local t = current
@@ -131,8 +133,8 @@ function nodes.delete(head,current)
return nodes.remove(head,current,true)
end
-nodes.before = node.insert_before
-nodes.after = node.insert_after
+nodes.before = insert_node_before
+nodes.after = insert_node_after
-- we need to test this, as it might be fixed now
@@ -172,21 +174,31 @@ function nodes.after(h,c,n)
return n, n
end
-function nodes.replace(head,current,new)
- if current and next then
- local p, n = current.prev, current.next
- new.prev, new.next = p, n
- if p then
- p.next = new
- else
+-- local h, c = nodes.replace(head,current,new)
+-- local c = nodes.replace(false,current,new)
+-- local c = nodes.replace(current,new)
+
+function nodes.replace(head,current,new) -- no head returned if false
+ if not new then
+ head, current, new = false, head, current
+ end
+ local prev, next = current.prev, current.next
+ if next then
+ new.next, next.prev = next, new
+ end
+ if prev then
+ new.prev, prev.next = prev, new
+ end
+ if head then
+ if head == current then
head = new
end
- if n then
- n.prev = new
- end
free_node(current)
+ return head, new
+ else
+ free_node(current)
+ return new
end
- return head, current
end
-- will move
@@ -212,7 +224,7 @@ end
nodes.count = count
--- new
+-- new, will move
function attributes.ofnode(n)
local a = n.attr
diff --git a/Master/texmf-dist/tex/context/base/node-ini.mkiv b/Master/texmf-dist/tex/context/base/node-ini.mkiv
index 210f21229b2..78725931666 100644
--- a/Master/texmf-dist/tex/context/base/node-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/node-ini.mkiv
@@ -18,6 +18,8 @@
\newcount\filterstate \filterstate\plusone
\registerctxluafile{node-ini}{1.001}
+\registerctxluafile{node-dir}{1.001}
+\registerctxluafile{node-aux}{1.001}
\registerctxluafile{node-tst}{1.001}
\registerctxluafile{node-tra}{1.001} % we might split it off (module)
\registerctxluafile{node-seq}{1.001} % we might generalize this one
@@ -29,12 +31,13 @@
\registerctxluafile{node-ser}{1.001}
\registerctxluafile{node-ext}{1.001}
\registerctxluafile{node-inj}{1.001} % we might split it off
+\registerctxluafile{node-typ}{1.001} % experimental
\newtoks \attributesresetlist
\ifdefined \v!global \else \def\v!global{global} \fi % for metatex
-\def\defineattribute
+\unexpanded\def\defineattribute
{\dodoubleempty\dodefineattribute}
\def\dodefineattribute[#1][#2]% alternatively we can let lua do the housekeeping
@@ -44,7 +47,7 @@
%\writestatus\m!systems{defining attribute #1 with number \number\lastallocatedattribute}%
\doifnotinset\v!global{#2}{\appendetoks\csname @attr@#1\endcsname\attributeunsetvalue\to\attributesresetlist}}
-\def\definesystemattribute
+\unexpanded\def\definesystemattribute
{\dodoubleempty\dodefinesystemattribute}
\def\dodefinesystemattribute[#1][#2]% alternatively we can let lua do the housekeeping
@@ -65,25 +68,6 @@
\def\resetallattributes{\the\attributesresetlist}
-% \appendtoks
-% \ctxlua {
-% callbacks.push('hpack_filter')
-% callbacks.push('vpack_filter')
-% callbacks.push('buildpage_filter')
-% callbacks.push('pre_linebreak_filter')
-% callbacks.push('pre_output_filter')
-% }%
-% \to \everybeforeoutput
-% \appendtoks
-% \ctxlua {
-% callbacks.pop('hpack_filter')
-% callbacks.pop('vpack_filter')
-% callbacks.pop('buildpage_filter')
-% callbacks.pop('pre_linebreak_filter')
-% callbacks.pop('pre_output_filter')
-% }%
-% \to \everyafteroutput
-
\newcount\shownodescounter
\def\shownextnodes {\afterassignment\doshownodes\shownextnodescounter}
@@ -93,8 +77,8 @@
\def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,false,true)}}}
\def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,true,true)}}}
-\def\starttracingnodes[#1]{\ctxlua{nodes.tracers.characters.start("#1")}}
-\def\stoptracingnodes {\ctxlua{nodes.tracers.characters.stop()}}
+\unexpanded\def\starttracingnodes[#1]{\ctxlua{nodes.tracers.characters.start("#1")}}
+\unexpanded\def\stoptracingnodes {\ctxlua{nodes.tracers.characters.stop()}}
% \starttext
% \starttracingnodes[characters]
diff --git a/Master/texmf-dist/tex/context/base/node-inj.lua b/Master/texmf-dist/tex/context/base/node-inj.lua
index dc676a412ed..9c4612a2299 100644
--- a/Master/texmf-dist/tex/context/base/node-inj.lua
+++ b/Master/texmf-dist/tex/context/base/node-inj.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-inj'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -10,7 +10,8 @@ if not modules then modules = { } end modules ['node-inj'] = {
-- This is very experimental (this will change when we have luatex > .50 and
-- a few pending thingies are available. Also, Idris needs to make a few more
--- test fonts.
+-- test fonts. Btw, future versions of luatex will have extended glyph properties
+-- that can be of help.
local next = next
@@ -50,6 +51,8 @@ local kerns = { }
-- explicitly i will provide an alternative; also, we can share
-- tables
+-- for the moment we pass the r2l key ... volt/arabtype tests
+
function nodes.set_cursive(start,nxt,factor,rlmode,exit,entry,tfmstart,tfmnext)
local dx, dy = factor*(exit[1]-entry[1]), factor*(exit[2]-entry[2])
local ws, wn = tfmstart.width, tfmnext.width
@@ -60,18 +63,19 @@ function nodes.set_cursive(start,nxt,factor,rlmode,exit,entry,tfmstart,tfmnext)
return dx, dy, bound
end
-function nodes.set_pair(current,factor,rlmode,spec,tfmchr)
+function nodes.set_pair(current,factor,rlmode,r2lflag,spec,tfmchr)
local x, y, w, h = factor*spec[1], factor*spec[2], factor*spec[3], factor*spec[4]
-- dy = y - h
if x ~= 0 or w ~= 0 or y ~= 0 or h ~= 0 then
local bound = has_attribute(current,kernpair)
if bound then
local kb = kerns[bound]
- kb[2], kb[3], kb[4], kb[5] = kb[2] + x, kb[3] + y, kb[4] + w, kb[5] + h
+ -- inefficient but singles have less, but weird anyway, needs checking
+ kb[2], kb[3], kb[4], kb[5] = (kb[2] or 0) + x, (kb[3] or 0) + y, (kb[4] or 0)+ w, (kb[5] or 0) + h
else
bound = #kerns + 1
set_attribute(current,kernpair,bound)
- kerns[bound] = { rlmode, x, y, w, h }
+ kerns[bound] = { rlmode, x, y, w, h, r2lflag, tfmchr.width }
end
return x, y, w, h, bound
end
@@ -171,6 +175,7 @@ end
function nodes.inject_kerns(head,where,keep)
local has_marks, has_cursives, has_kerns = next(marks), next(cursives), next(kerns)
if has_marks or has_cursives then
+--~ if has_marks or has_cursives or has_kerns then
if trace_injections then
nodes.trace_injection(head)
end
@@ -190,7 +195,7 @@ function nodes.inject_kerns(head,where,keep)
if k then
local kk = kerns[k]
if kk then
- local x, y, w, h = kk[2], kk[3], kk[4], kk[5]
+ local x, y, w, h = kk[2] or 0, kk[3] or 0, kk[4] or 0, kk[5] or 0
local dy = y - h
if dy ~= 0 then
ky[n] = dy
@@ -305,14 +310,15 @@ function nodes.inject_kerns(head,where,keep)
local d = mrks[index]
if d then
-- local rlmode = d[3] -- not used
- -- if rlmode and rlmode < 0 then
- -- n.xoffset = p.xoffset + d[1]
+ -- if rlmode and rlmode > 0 then
+ -- todo
-- else
- n.xoffset = p.xoffset - d[1]
---~ local k = wx[p]
---~ if k then
---~ wx[n] = k
---~ end
+ local k = wx[p]
+ if k then
+ n.xoffset = p.xoffset - d[1] - k[2]
+ else
+ n.xoffset = p.xoffset - d[1]
+ end
-- end
if mk[p] then
n.yoffset = p.yoffset + d[2]
@@ -334,23 +340,41 @@ function nodes.inject_kerns(head,where,keep)
if next(wx) then
for n, k in next, wx do
-- only w can be nil, can be sped up when w == nil
- local rl, x, w = k[1], k[2] or 0, k[4] or 0
+ local rl, x, w, r2l = k[1], k[2] or 0, k[4] or 0, k[6]
local wx = w - x
- if rl < 0 then
- if wx ~= 0 then
- insert_node_before(head,n,newkern(wx))
- end
- if x ~= 0 then
- insert_node_after (head,n,newkern(x))
- end
- else
- -- if wx ~= 0 then
- -- insert_node_after(head,n,newkern(wx))
- -- end
- if x ~= 0 then
- insert_node_before(head,n,newkern(x))
+--~ if rl < 0 then
+--~ if r2l then
+--~ if wx ~= 0 then
+--~ insert_node_before(head,n,newkern(wx))
+--~ end
+--~ if x ~= 0 then
+--~ insert_node_after (head,n,newkern(x))
+--~ end
+--~ else
+--~ if x ~= 0 then
+--~ insert_node_before(head,n,newkern(x))
+--~ end
+--~ if wx ~= 0 then
+--~ insert_node_after(head,n,newkern(wx))
+--~ end
+--~ end
+--~ else
+ if r2l then
+ if wx ~= 0 then
+ insert_node_before(head,n,newkern(wx))
+ end
+ if x ~= 0 then
+ insert_node_after (head,n,newkern(x))
+ end
+ else
+ if x ~= 0 then
+ insert_node_before(head,n,newkern(x))
+ end
+ if wx ~= 0 then
+ insert_node_after(head,n,newkern(wx))
+ end
end
- end
+--~ end
end
end
if next(cx) then
@@ -376,29 +400,54 @@ function nodes.inject_kerns(head,where,keep)
if trace_injections then
nodes.trace_injection(head)
end
- -- we assume done is true because there are kerns
for n in traverse_id(glyph,head) do
local k = has_attribute(n,kernpair)
if k then
local kk = kerns[k]
if kk then
- -- only w can be nil, can be sped up when w == nil
- local rl, x, y, w = kk[1], kk[2] or 0, kk[3] or 0, kk[4] or 0
- if y ~= 0 then
+ local rl, x, y, w = kk[1], kk[2] or 0, kk[3], kk[4]
+ if y and y ~= 0 then
n.yoffset = y -- todo: h ?
end
- local wx = w - x
- if rl < 0 then
- if wx ~= 0 then
- insert_node_before(head,n,newkern(wx))
- end
- if x ~= 0 then
- insert_node_after (head,n,newkern(x))
- end
+ if w then
+ -- copied from above
+ local r2l = kk[6]
+ local wx = w - x
+--~ if rl < 0 then
+--~ if r2l then
+--~ if x ~= 0 then
+--~ insert_node_before(head,n,newkern(x))
+--~ end
+--~ if wx ~= 0 then
+--~ insert_node_after(head,n,newkern(wx))
+--~ end
+--~ else
+--~ if wx ~= 0 then
+--~ insert_node_before(head,n,newkern(wx))
+--~ end
+--~ if x ~= 0 then
+--~ insert_node_after (head,n,newkern(x))
+--~ end
+--~ end
+--~ else
+ if r2l then
+ if wx ~= 0 then
+ insert_node_before(head,n,newkern(wx))
+ end
+ if x ~= 0 then
+ insert_node_after (head,n,newkern(x))
+ end
+ else
+ if x ~= 0 then
+ insert_node_before(head,n,newkern(x))
+ end
+ if wx ~= 0 then
+ insert_node_after(head,n,newkern(wx))
+ end
+ end
+--~ end
else
- -- if wx ~= 0 then
- -- insert_node_after(head,n,newkern(wx))
- -- end
+ -- simple (e.g. kernclass kerns)
if x ~= 0 then
insert_node_before(head,n,newkern(x))
end
diff --git a/Master/texmf-dist/tex/context/base/node-mig.lua b/Master/texmf-dist/tex/context/base/node-mig.lua
new file mode 100644
index 00000000000..f9f0ad23184
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-mig.lua
@@ -0,0 +1,120 @@
+if not modules then modules = { } end modules ['node-mig'] = {
+ version = 1.001,
+ comment = "companion to node-mig.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 hlist = node.id('hlist')
+local vlist = node.id('vlist')
+local insert = node.id('ins')
+local mark = node.id('mark')
+
+local has_attribute = node.has_attribute
+local set_attribute = node.set_attribute
+local remove_nodes = nodes.remove
+
+local migrated = attributes.private("migrated")
+
+local trace_migrations = false
+
+trackers.register("nodes.migrations", function(v) trace_migrations = v end)
+
+local migrate_inserts, migrate_marks
+
+local t_inserts, t_marks, t_sweeps = 0, 0, 0
+
+local function locate(head,first,last,ni,nm)
+ local current = head
+ while current do
+ local id = current.id
+ if id == vlist or id == hlist then
+ current.list, first, last, ni, nm = locate(current.list,first,last,ni,nm)
+ current= current.next
+ elseif migrate_inserts and id == insert then
+ local insert
+ head, current, insert = remove_nodes(head,current)
+ insert.next = nil
+ if first then
+ insert.prev, last.next = last, insert
+ else
+ insert.prev, first = nil, insert
+ end
+ last, ni = insert, ni + 1
+ elseif migrate_marks and id == mark then
+ local mark
+ head, current, mark = remove_nodes(head,current)
+ mark.next = nil
+ if first then
+ mark.prev, last.next = last, mark
+ else
+ mark.prev, first = nil, mark
+ end
+ last, nm = mark, nm + 1
+ else
+ current= current.next
+ end
+ end
+ return head, first, last, ni, nm
+end
+
+function nodes.migrate_outwards(head,where)
+ local done = false
+ if head then
+ local current = head
+ while current do
+ local id = current.id
+ if id == vlist or id == hlist and not has_attribute(current,migrated) then
+ set_attribute(current,migrated,1)
+ t_sweeps = t_sweeps + 1
+ local h = current.list
+ local first, last, ni, nm
+ while h do
+ local id = h.id
+ if id == vlist or id == hlist then
+ h, first, last, ni, nm = locate(h,first,last,0,0)
+ end
+ h = h.next
+ end
+ if first then
+ t_inserts, t_marks = t_inserts + ni, t_marks + nm
+ if trace_migrations and (ni > 0 or nm > 0) then
+ logs.report("nodes","sweep %s, %s inserts and %s marks migrated outwards",t_sweeps,ni,nm)
+ end
+ -- inserts after head
+ local n = current.next
+ if n then
+ last.next, n.prev = n, last
+ end
+ current.next, first.prev = first, current
+ done, current = true, last
+ end
+ end
+ current = current.next
+ end
+ return head, done
+ end
+end
+
+experiments.register("marks.migrate", function(v)
+ if v then
+ tasks.enableaction("mvlbuilders", "nodes.migrate_outwards")
+ end
+ migrate_marks = v
+end)
+
+experiments.register("inserts.migrate", function(v)
+ if v then
+ tasks.enableaction("mvlbuilders", "nodes.migrate_outwards")
+ end
+ migrate_inserts = v
+end)
+
+statistics.register("node migrations", function()
+ if trace_migrations and t_sweeps > 0 then
+ return format("%s sweeps, %s inserts moved, %s marks moved",t_sweeps,t_inserts,t_marks)
+ end
+end)
diff --git a/Master/texmf-dist/tex/context/base/node-mig.mkiv b/Master/texmf-dist/tex/context/base/node-mig.mkiv
new file mode 100644
index 00000000000..cd731b96f79
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-mig.mkiv
@@ -0,0 +1,60 @@
+%D \module
+%D [ file=node-mig,
+%D version=2010.01.19,
+%D title=\CONTEXT\ Node Macros,
+%D subtitle=Inserts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Node Support / Migrations}
+
+%D This is very experimental and although it is used in a
+%D real project it mostly serves a testbed for Taco and me so
+%D as prelude to extending the inserts mechanism.
+%D
+%D \starttyping
+%D \automigrateinserts
+%D
+%D \hbox{\vbox{x\footnote{1}x\footnote{2}x\footnote{3}x}}
+%D \vbox{x\footnote{4}x}
+%D \hbox{\vbox{x\footnote{5}x}}
+%D
+%D \hbox{x}
+%D \hbox{x\footnote{6}x}
+%D \hbox{x}
+%D
+%D \starttabulate
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \NC test \NC test \footnote{test} \input tufte \NC \NR
+%D \stoptabulate
+%D \stoptyping
+
+\unprotect
+
+\registerctxluafile{node-mig}{1.001}
+
+\newtoks \everyautomigratefootnotes
+\newtoks \everyautomigratemarks
+
+\def\automigrateinserts{\the\everyautomigratefootnotes}
+\def\automigratemarks {\the\everyautomigratemarks}
+
+\appendtoks
+ \let\postponenotes\relax
+ \enableexperiments[inserts.migrate]%
+\to \everyautomigratefootnotes
+
+\appendtoks
+ \enableexperiments[marks.migrate]%
+\to \everyautomigratemarks
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/node-pag.lua b/Master/texmf-dist/tex/context/base/node-pag.lua
new file mode 100644
index 00000000000..4bc53c6ddb6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-pag.lua
@@ -0,0 +1,30 @@
+if not modules then modules = { } end modules ['node-pag'] = {
+ version = 1.001,
+ comment = "companion to node-pag.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- this callback might disappear and come back in the same way
+-- as par builders
+
+pagebuilders = pagebuilders or { }
+
+local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
+
+local actions = tasks.actions("pagebuilders",5)
+
+local function processor(head,groupcode,size,packtype,maxdepth,direction)
+ starttiming(pagebuilders)
+ local _, done = actions(head,groupcode,size,packtype,maxdepth,direction)
+ stoptiming(pagebuilders)
+ return (done and head) or true
+-- return vpack(head)
+end
+
+--~ callbacks.register('pre_output_filter', processor, "preparing output box")
+
+--~ statistics.register("output preparation time", function()
+--~ return statistics.elapsedseconds(pagebuilders)
+--~ end)
diff --git a/Master/texmf-dist/tex/context/base/node-pag.mkiv b/Master/texmf-dist/tex/context/base/node-pag.mkiv
new file mode 100644
index 00000000000..487901ad043
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-pag.mkiv
@@ -0,0 +1,20 @@
+%D \module
+%D [ file=node-pag,
+%D version=2008.09.30,
+%D title=\CONTEXT\ Node Macros,
+%D subtitle=Page Building,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Node Macros / Page Building}
+
+\unprotect
+
+\registerctxluafile{node-pag}{1.001}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/node-par.lua b/Master/texmf-dist/tex/context/base/node-par.lua
index f275a103559..7be7e7917ca 100644
--- a/Master/texmf-dist/tex/context/base/node-par.lua
+++ b/Master/texmf-dist/tex/context/base/node-par.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-par'] = {
version = 1.001,
- comment = "companion to node-par.lua",
+ comment = "companion to node-par.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -9,35 +9,93 @@ if not modules then modules = { } end modules ['node-par'] = {
parbuilders = parbuilders or { }
parbuilders.constructors = parbuilders.constructors or { }
parbuilders.names = parbuilders.names or { }
+parbuilders.numbers = parbuilders.numbers or { }
parbuilders.attribute = attributes.numbers['parbuilder'] or 999
-storage.register("parbuilders.names", parbuilders.names, "parbuilders.names")
+storage.register("parbuilders.names", parbuilders.names, "parbuilders.names")
+storage.register("parbuilders.numbers", parbuilders.numbers, "parbuilders.numbers")
--- store parbuilders.names
+local constructors, names, numbers, p_attribute = parbuilders.constructors, parbuilders.names, parbuilders.numbers, parbuilders.attribute
-function parbuilders.register(name,attribute)
- parbuilders.names[attribute] = name
+local has_attribute = node.has_attribute
+local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
+
+local mainconstructor = nil -- not stored in format
+
+function parbuilders.register(name,number)
+ parbuilders.names[number] = name
+ parbuilders.numbers[name] = number
+end
+
+function parbuilders.setmain(name)
+ mainconstructor = numbers[name]
end
-function parbuilders.main(head,interupted_by_display)
- local attribute = node.has_attribute(head,parbuilders.attribute)
- if attribute then
- local constructor = parbuilders.names[attribute]
- if constructor then
- return parbuilders.constructors[constructor](head,interupted_by_display)
+-- return values:
+--
+-- true : tex will break itself
+-- false : idem but dangerous
+-- head : list of valid vmode nodes with last being hlist
+
+function parbuilders.constructor(head,followed_by_display)
+ if type(head) == "boolean" then
+ return head
+ else
+ local attribute = has_attribute(head,p_attribute) or mainconstructor
+ if attribute then
+ local constructor = names[attribute]
+ if constructor then
+ local handler = constructor and constructors[constructor]
+ if handler then
+ return handler(head,followed_by_display)
+ else
+ logs.report("parbuilders","handler '%s' is not defined",tostring(constructor))
+ return true -- let tex break
+ end
+ end
end
+ return true -- let tex break
end
- return false
end
-- just for testing
-function parbuilders.constructors.default(head,ibd)
- return false
+function parbuilders.constructors.default(head,followed_by_display)
+ return true -- let tex break
end
-- also for testing (no surrounding spacing done)
-function parbuilders.constructors.oneline(head,ibd)
+function parbuilders.constructors.oneline(head,followed_by_display)
return node.hpack(head)
end
+
+-- It makes no sense to have a sequence here as we already have
+-- pre and post hooks and only one parbuilder makes sense, so no:
+--
+-- local actions = tasks.actions("parbuilders",1)
+
+-- todo: enable one as main
+
+local actions = parbuilders.constructor
+local enabled = false
+
+function parbuilders.enable () enabled = true end
+function parbuilders.disable() enabled = false end
+
+local function processor(head,followed_by_display)
+ if enabled then
+ starttiming(parbuilders)
+ local head = actions(head,followed_by_display)
+ stoptiming(parbuilders)
+ return head
+ else
+ return true -- let tex do the work
+ end
+end
+
+callbacks.register('linebreak_filter', processor, "breaking paragraps into lines")
+
+statistics.register("linebreak processing time", function()
+ return statistics.elapsedseconds(parbuilders)
+end)
diff --git a/Master/texmf-dist/tex/context/base/node-par.mkiv b/Master/texmf-dist/tex/context/base/node-par.mkiv
index 7f7ca9977f8..cb53e643d7e 100644
--- a/Master/texmf-dist/tex/context/base/node-par.mkiv
+++ b/Master/texmf-dist/tex/context/base/node-par.mkiv
@@ -30,31 +30,49 @@
\registerctxluafile{node-par}{1.001}
-\definesystemattribute[parbuilder]
+\definesystemattribute[parbuilder] \chardef\parbuilderattribute \dogetattributeid{parbuilder}
+
+% todo auto-enable
+
+% management (enable/disable) is global and will move to lua
\newcount\nofparbuilders
-\def\defineparbuilder[#1]%
+\unexpanded\def\defineparbuilder[#1]%
{\global\advance\nofparbuilders\plusone
\ctxlua{parbuilders.register("#1",\number\nofparbuilders)}%
- \setxvalue{\??ng:#1}{\dosetattribute{parbuilder}{\number\nofparbuilders}}}
+ \setxvalue{\??ng:#1}{\attribute\parbuilderattribute\nofparbuilders}}
-\def\startparbuilder[#1]%
- {\edef\@@currentparbuilder{\number\dogetattribute{parbuilder}}%
+\unexpanded\def\startparbuilder[#1]%
+ {\edef\@@currentparbuilder{\number\attribute\parbuilderattribute}%
\globalpushmacro\@@currentparbuilder
- \getvalue{\??ng:#1}}
+ \getvalue{\??ng:#1}%
+ \checkparbuilders}
-\def\stopparbuilder
- {\globalpopmacro\@@currentparbuilder
- \dosetattribute{parbuilder}{\@@currentparbuilder}}
+\unexpanded\def\stopparbuilder
+ {\ifhmode\par\fi
+ \globalpopmacro\@@currentparbuilder
+ \attribute\parbuilderattribute\@@currentparbuilder\relax
+ \checkparbuilders}
+
+\def\setmainparbuilder[#1]%
+ {\ctxlua{parbuilders.setmain("#1")}}
% no high level interface, after all implementing a linebreaker is not something that
% the average user will do
\defineparbuilder[default] % just for testing
\defineparbuilder[oneline] % just for testing
+\defineparbuilder[basic] % just for testing
+
+\def\enableparbuilders {\ctxlua{parbuilders.enable ()}}
+\def\disableparbuilders{\ctxlua{parbuilders.disable()}}
-\def\enableparbuilders {\ctxlua{callback.register('linebreak_filter', parbuilders.main)}}
-\def\disableparbuilders{\ctxlua{callback.register('linebreak_filter', nil)}}
+\def\checkparbuilders % can be more efficient as we don't want to do this to often
+ {\ifcase\attribute\parbuilderattribute
+ \disableparbuilders
+ \else
+ \enableparbuilders
+ \fi}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/node-pro.lua b/Master/texmf-dist/tex/context/base/node-pro.lua
index acc3f1676f8..4f5b3dcbe9c 100644
--- a/Master/texmf-dist/tex/context/base/node-pro.lua
+++ b/Master/texmf-dist/tex/context/base/node-pro.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-pro'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -25,7 +25,7 @@ lists = lists or { }
chars = chars or { }
words = words or { } -- not used yet
-local actions = tasks.actions("processors",2) -- head, where, boolean
+local actions = tasks.actions("processors",4)
local n = 0
@@ -52,20 +52,20 @@ local function tracer(what,state,head,groupcode,before,after,show)
end
n = n + 1
if show then
- texio.write_nl(format("%s %s: %s, group: %s, nodes: %s -> %s, string: %s",what,n,state,groupcode,before,after,reconstruct(head)))
+ logs.report("nodes","%s %s: %s, group: %s, nodes: %s -> %s, string: %s",what,n,state,groupcode,before,after,reconstruct(head))
else
- texio.write_nl(format("%s %s: %s, group: %s, nodes: %s -> %s",what,n,state,groupcode,before,after))
+ logs.report("nodes","%s %s: %s, group: %s, nodes: %s -> %s",what,n,state,groupcode,before,after)
end
end
nodes.processors.enabled = true -- thsi will become a proper state (like trackers)
-function nodes.processors.pre_linebreak_filter(head,groupcode)
+function nodes.processors.pre_linebreak_filter(head,groupcode,size,packtype,direction)
local first, found = first_character(head)
if found then
if trace_callbacks then
local before = nodes.count(head,true)
- local head, done = actions(head,groupcode)
+ local head, done = actions(head,groupcode,size,packtype,direction)
local after = nodes.count(head,true)
if done then
tracer("pre_linebreak","changed",head,groupcode,before,after,true)
@@ -74,7 +74,7 @@ function nodes.processors.pre_linebreak_filter(head,groupcode)
end
return (done and head) or true
else
- local head, done = actions(head,groupcode)
+ local head, done = actions(head,groupcode,size,packtype,direction)
return (done and head) or true
end
elseif trace_callbacks then
@@ -84,12 +84,12 @@ function nodes.processors.pre_linebreak_filter(head,groupcode)
return true
end
-function nodes.processors.hpack_filter(head,groupcode)
+function nodes.processors.hpack_filter(head,groupcode,size,packtype,direction)
local first, found = first_character(head)
if found then
if trace_callbacks then
local before = nodes.count(head,true)
- local head, done = actions(head,groupcode)
+ local head, done = actions(head,groupcode,size,packtype,direction)
local after = nodes.count(head,true)
if done then
tracer("hpack","changed",head,groupcode,before,after,true)
@@ -98,7 +98,7 @@ function nodes.processors.hpack_filter(head,groupcode)
end
return (done and head) or true
else
- local head, done = actions(head,groupcode)
+ local head, done = actions(head,groupcode,size,packtype,direction)
return (done and head) or true
end
elseif trace_callbacks then
@@ -108,10 +108,10 @@ function nodes.processors.hpack_filter(head,groupcode)
return true
end
-callback.register('pre_linebreak_filter', nodes.processors.pre_linebreak_filter)
-callback.register('hpack_filter' , nodes.processors.hpack_filter)
+callbacks.register('pre_linebreak_filter', nodes.processors.pre_linebreak_filter,"all kind of horizontal manipulations (before par break)")
+callbacks.register('hpack_filter' , nodes.processors.hpack_filter,"all kind of horizontal manipulations")
-local actions = tasks.actions("finalizers",2) -- head, where, boolean
+local actions = tasks.actions("finalizers",1) -- head, where
-- beware, these are packaged boxes so no first_character test
-- maybe some day a hash with valid groupcodes
@@ -142,10 +142,8 @@ function nodes.processors.post_linebreak_filter(head,groupcode)
--~ return true
end
-callback.register('post_linebreak_filter', nodes.processors.post_linebreak_filter)
+callbacks.register('post_linebreak_filter', nodes.processors.post_linebreak_filter,"all kind of horizontal manipulations (after par break)")
statistics.register("h-node processing time", function()
- if statistics.elapsedindeed(nodes) then
- return format("%s seconds including kernel", statistics.elapsedtime(nodes))
- end
+ return statistics.elapsedseconds(nodes,"including kernel") -- hm, ok here?
end)
diff --git a/Master/texmf-dist/tex/context/base/node-ref.lua b/Master/texmf-dist/tex/context/base/node-ref.lua
index 04598082304..7128b1a6d20 100644
--- a/Master/texmf-dist/tex/context/base/node-ref.lua
+++ b/Master/texmf-dist/tex/context/base/node-ref.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-bck'] = {
version = 1.001,
- comment = "companion to node-bck.tex",
+ comment = "companion to node-bck.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -67,6 +67,8 @@ local function dimensions(parent,start,stop)
end
end
+-- is pardir important at all?
+
local function inject_range(head,first,last,reference,make,stack,parent,pardir,txtdir)
local width, height, depth = dimensions(parent,first,last)
if pardir == "TRT" or txtdir == "+TRT" then
@@ -112,6 +114,9 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
if id == hlist then
-- can be either an explicit hbox or a line and there is no way
-- to recognize this; anyway only if ht/dp (then inline)
+ --
+ -- to be tested: 0=unknown, 1=linebreak, 2=hbox
+--~ if id.subtype == 1 then
local sr = stack[reference]
if first then
if sr and sr[2] then
@@ -122,10 +127,10 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
if prev and prev.id == glue and prev.subtype == 15 then
width = dimensions(current,first,prev.prev) -- maybe not current as we already take care of it
else
- if moveright and first.spec then
+ if moveright and first.writable then
width = width - first.spec.stretch*current.glue_set * current.glue_sign
end
- if last.spec then
+ if last.writable then
width = width - last.spec.stretch*current.glue_set * current.glue_sign
end
end
@@ -133,6 +138,10 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
else
-- also weird
end
+--~ else
+--~ print("!!!!!!!!!!!!!!!!!")
+ -- simple
+--~ end
else
-- ok
end
@@ -185,26 +194,27 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
txtdir = current.dir
end
elseif id == hlist or id == vlist then
---~ if r and (not skip or r > skip) then
if not reference and r and (not skip or r > skip) then
inject_list(id,current,r,make,stack,pardir,txtdir)
---~ done[r] = true
end
-if r then done[r] = (done[r] or 0) + 1 end
+ if r then
+ done[r] = (done[r] or 0) + 1
+ end
local list = current.list
if list then
local _
current.list, _, pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir)
end
-if r then done[r] = done[r] - 1 end
+ if r then
+ done[r] = done[r] - 1
+ end
elseif not r then
-- just go on, can be kerns
elseif not reference then
reference, first, last, firstdir = r, current, current, txtdir
elseif r == reference then
last = current
---~ elseif not done[reference] then
-elseif (done[reference] or 0) == 0 then
+ elseif (done[reference] or 0) == 0 then
if not skip or r > skip then
head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir)
reference, first, last, firstdir = nil, nil, nil, nil
@@ -214,7 +224,6 @@ elseif (done[reference] or 0) == 0 then
end
current = current.next
end
---~ if reference and not done[reference] then
if reference and (done[reference] or 0) == 0 then
head = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir)
end
@@ -517,3 +526,8 @@ statistics.register("interactive elements", function()
return nil
end
end)
+
+function jobreferences.enable_interaction()
+ tasks.enableaction("shipouts","nodes.add_references")
+ tasks.enableaction("shipouts","nodes.add_destinations")
+end
diff --git a/Master/texmf-dist/tex/context/base/node-res.lua b/Master/texmf-dist/tex/context/base/node-res.lua
index 4f2cf5a0509..a8ea8745a72 100644
--- a/Master/texmf-dist/tex/context/base/node-res.lua
+++ b/Master/texmf-dist/tex/context/base/node-res.lua
@@ -1,13 +1,16 @@
if not modules then modules = { } end modules ['node-res'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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 gmatch, format = string.gmatch, string.format
-local copy_node, free_node, free_list, new_node = node.copy, node.free, node.flush_list, node.new
+local copy_node, free_node, free_list, new_node, node_type, node_id = node.copy, node.free, node.flush_list, node.new, node.type, node.id
+local tonumber, round = tonumber, math.round
+
+local glyph_node = node_id("glyph")
--[[ldx--
<p>The next function is not that much needed but in <l n='context'/> we use
@@ -16,18 +19,30 @@ for debugging <l n='luatex'/> node management.</p>
nodes = nodes or { }
+nodes.whatsits = { } -- table.swapped(node.whatsits())
+
local reserved = { }
+local whatsits = nodes.whatsits
-function nodes.register(n)
+for k, v in next, node.whatsits() do
+ whatsits[k], whatsits[v] = v, k -- two way
+end
+
+local function register_node(n)
reserved[#reserved+1] = n
return n
end
+nodes.register = register_node
+
function nodes.cleanup_reserved(nofboxes) -- todo
nodes.tracers.steppers.reset() -- todo: make a registration subsystem
local nr, nl = #reserved, 0
for i=1,nr do
- free_node(reserved[i])
+ local ri = reserved[i]
+ -- if not (ri.id == glue_spec and not ri.is_writable) then
+ free_node(reserved[i])
+ -- end
end
if nofboxes then
local tb = tex.box
@@ -51,15 +66,37 @@ function nodes.usage()
return t
end
-local disc = nodes.register(new_node("disc"))
-local kern = nodes.register(new_node("kern",1))
-local penalty = nodes.register(new_node("penalty"))
-local glue = nodes.register(new_node("glue"))
-local glue_spec = nodes.register(new_node("glue_spec"))
-local glyph = nodes.register(new_node("glyph",0))
-local textdir = nodes.register(new_node("whatsit",7))
-local rule = nodes.register(new_node("rule"))
-local latelua = nodes.register(new_node("whatsit",35))
+local disc = register_node(new_node("disc"))
+local kern = register_node(new_node("kern",1))
+local penalty = register_node(new_node("penalty"))
+local glue = register_node(new_node("glue")) -- glue.spec = nil
+local glue_spec = register_node(new_node("glue_spec"))
+local glyph = register_node(new_node("glyph",0))
+local textdir = register_node(new_node("whatsit",whatsits.dir)) -- 7 (6 is local par node)
+local rule = register_node(new_node("rule"))
+local latelua = register_node(new_node("whatsit",whatsits.late_lua)) -- 35
+local user_n = register_node(new_node("whatsit",whatsits.user_defined)) user_n.type = 100 -- 44
+local user_l = register_node(new_node("whatsit",whatsits.user_defined)) user_l.type = 110 -- 44
+local user_s = register_node(new_node("whatsit",whatsits.user_defined)) user_s.type = 115 -- 44
+local user_t = register_node(new_node("whatsit",whatsits.user_defined)) user_t.type = 116 -- 44
+local left_margin_kern = register_node(new_node("margin_kern",0))
+local right_margin_kern = register_node(new_node("margin_kern",1))
+local lineskip = register_node(new_node("glue",1))
+local baselineskip = register_node(new_node("glue",2))
+local leftskip = register_node(new_node("glue",8))
+local rightskip = register_node(new_node("glue",9))
+local temp = register_node(new_node("temp",0))
+
+function nodes.zeroglue(n)
+ local s = n.spec
+ return not writable or (
+ s.width == 0
+ and s.stretch == 0
+ and s.shrink == 0
+ and s.stretch_order == 0
+ and s.shrink_order == 0
+ )
+end
function nodes.glyph(fnt,chr)
local n = copy_node(glyph)
@@ -67,48 +104,195 @@ function nodes.glyph(fnt,chr)
if chr then n.char = chr end
return n
end
+
function nodes.penalty(p)
local n = copy_node(penalty)
n.penalty = p
return n
end
+
function nodes.kern(k)
local n = copy_node(kern)
n.kern = k
return n
end
-function nodes.glue(width,stretch,shrink)
- local n, s = copy_node(glue), copy_node(glue_spec)
- s.width, s.stretch, s.shrink = width, stretch, shrink
- n.spec = s
- return n
-end
+
function nodes.glue_spec(width,stretch,shrink)
local s = copy_node(glue_spec)
s.width, s.stretch, s.shrink = width, stretch, shrink
return s
end
+
+local function someskip(skip,width,stretch,shrink)
+ local n = copy_node(skip)
+ if not width then
+ -- no spec
+ elseif tonumber(width) then
+ local s = copy_node(glue_spec)
+ s.width, s.stretch, s.shrink = width, stretch, shrink
+ n.spec = s
+ else
+ -- shared
+ n.spec = copy_node(width)
+ end
+ return n
+end
+
+function nodes.glue(width,stretch,shrink)
+ return someskip(glue,width,stretch,shrink)
+end
+function nodes.leftskip(width,stretch,shrink)
+ return someskip(leftskip,width,stretch,shrink)
+end
+function nodes.rightskip(width,stretch,shrink)
+ return someskip(rightskip,width,stretch,shrink)
+end
+function nodes.lineskip(width,stretch,shrink)
+ return someskip(lineskip,width,stretch,shrink)
+end
+function nodes.baselineskip(width,stretch,shrink)
+ return someskip(baselineskip,width,stretch,shrink)
+end
+
function nodes.disc()
return copy_node(disc)
end
+
function nodes.textdir(dir)
local t = copy_node(textdir)
t.dir = dir
return t
end
-function nodes.rule(w,h,d)
+
+function nodes.rule(width,height,depth,dir)
local n = copy_node(rule)
- if w then n.width = w end
- if h then n.height = h end
- if d then n.depth = d end
+ if width then n.width = width end
+ if height then n.height = height end
+ if depth then n.depth = depth end
+ if dir then n.dir = dir end
return n
end
+
function nodes.latelua(code)
local n = copy_node(latelua)
n.data = code
return n
end
+function nodes.leftmarginkern(glyph,width)
+ local n = copy_node(left_margin_kern)
+ if not glyph then
+ logs.fatal("nodes","invalid pointer to left margin glyph node")
+ elseif glyph.id ~= glyph_node then
+ logs.fatal("nodes","invalid node type %s for left margin glyph node",node_type(glyph))
+ else
+ n.glyph = glyph
+ end
+ if width then
+ n.width = width
+ end
+ return n
+end
+
+function nodes.rightmarginkern(glyph,width)
+ local n = copy_node(right_margin_kern)
+ if not glyph then
+ logs.fatal("nodes","invalid pointer to right margin glyph node")
+ elseif glyph.id ~= glyph_node then
+ logs.fatal("nodes","invalid node type %s for right margin glyph node",node_type(p))
+ else
+ n.glyph = glyph
+ end
+ if width then
+ n.width = width
+ end
+ return n
+end
+
+function nodes.temp()
+ return copy_node(temp)
+end
+--[[
+<p>At some point we ran into a problem that the glue specification
+of the zeropoint dimension was overwritten when adapting a glue spec
+node. This is a side effect of glue specs being shared. After a
+couple of hours tracing and debugging Taco and I came to the
+conclusion that it made no sense to complicate the spec allocator
+and settled on a writable flag. This all is a side effect of the
+fact that some glues use reserved memory slots (with the zeropoint
+glue being a noticeable one). So, next we wrap this into a function
+and hide it for the user. And yes, LuaTeX now gives a warning as
+well.</p>
+]]--
+
+if tex.luatexversion > 51 then
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ n.spec = spec
+ elseif not spec.writable then
+ spec = copy_node(spec)
+ n.spec = spec
+ end
+ return spec
+ end
+
+else
+
+ function nodes.writable_spec(n)
+ local spec = n.spec
+ if not spec then
+ spec = copy_node(glue_spec)
+ else
+ spec = copy_node(spec)
+ end
+ n.spec = spec
+ return spec
+ end
+
+end
+
+local cache = { }
+
+function nodes.usernumber(num)
+ local n = cache[num]
+ if n then
+ return copy_node(n)
+ else
+ local n = copy_node(user_n)
+ if num then n.value = num end
+ return n
+ end
+end
+
+function nodes.userlist(list)
+ local n = copy_node(user_l)
+ if list then n.value = list end
+ return n
+end
+
+local cache = { } -- we could use the same cache
+
+function nodes.userstring(str)
+ local n = cache[str]
+ if n then
+ return copy_node(n)
+ else
+ local n = copy_node(user_s)
+ n.type = 115
+ if str then n.value = str end
+ return n
+ end
+end
+
+function nodes.usertokens(tokens)
+ local n = copy_node(user_t)
+ if tokens then n.value = tokens end
+ return n
+end
+
statistics.register("cleaned up reserved nodes", function()
return format("%s nodes, %s lists of %s", nodes.cleanup_reserved(tex.count["lastallocatedbox"]))
end) -- \topofboxstack
diff --git a/Master/texmf-dist/tex/context/base/node-rul.lua b/Master/texmf-dist/tex/context/base/node-rul.lua
new file mode 100644
index 00000000000..9dd89bcdae3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-rul.lua
@@ -0,0 +1,288 @@
+if not modules then modules = { } end modules ['node-rul'] = {
+ version = 1.001,
+ comment = "companion to node-rul.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- this will go to an auxiliary module
+-- beware: rules now have a dir field
+
+local glyph = node.id("glyph")
+local disc = node.id("disc")
+local rule = node.id("rule")
+
+function nodes.strip_range(first,last) -- todo: dir
+ if first and last then -- just to be sure
+ local current = first
+ while current and current ~= last do
+ local id = current.id
+ if id == glyph or id == disc then
+ --~ if id == glyph or id == rule or id == disc then
+ first = current
+ break
+ else
+ current = current.next
+ end
+ end
+ local current = last
+ while current and current ~= first do
+ local id = current.id
+ --~ if id == glyph or id == rule or id == disc then
+ if id == glyph or id == disc then
+ last = current
+ break
+ else
+ current = current.prev
+ end
+ end
+ end
+ return first, last
+end
+
+-- todo: order and maybe other dimensions
+
+local trace_ruled = false trackers.register("nodes.ruled", function(v) trace_ruled = v end)
+
+local floor = math.floor
+local n_tostring, n_tosequence = nodes.ids_tostring, nodes.tosequence
+
+local a_ruled = attributes.private('ruled')
+local a_color = attributes.private('color')
+local a_transparency = attributes.private('transparency')
+local a_colorspace = attributes.private('colormodel')
+
+local glyph = node.id("glyph")
+local disc = node.id("disc")
+local glue = node.id("glue")
+local penalty = node.id("penalty")
+local kern = node.id("kern")
+local hlist = node.id("hlist")
+local vlist = node.id("vlist")
+local rule = node.id("rule")
+local whatsit = node.id("whatsit")
+
+local new_rule = nodes.rule
+local new_kern = nodes.kern
+local new_glue = nodes.glue
+
+local insert_before, insert_after, strip_range = node.insert_before, node.insert_after, nodes.strip_range
+local list_dimensions, has_attribute, set_attribute = node.dimensions, node.has_attribute, node.set_attribute
+local hpack_nodes = node.hpack
+local dimenfactor = fonts.dimenfactor
+local texwrite = tex.write
+
+local fontdata = fonts.ids
+local variables = interfaces.variables
+
+-- we can use this one elsewhere too
+--
+-- todo: functions: word, sentence
+--
+-- glyph rule unset whatsit glue margin_kern kern math disc
+
+local checkdir = true
+
+-- we assume {glyphruns} and no funny extra kerning, ok, maybe we need
+-- a dummy character as start and end; anyway we only collect glyphs
+
+local function process_words(attribute,data,flush,head,parent) -- we have hlistdir and local dir
+ local n = head
+ if n then
+ local f, l, a, d, i, level
+ local continue, done, strip = false, false, false
+ while n do
+ local id = n.id
+ if id == glyph or id == rule then
+ local aa = has_attribute(n,attribute)
+ if aa then
+ if aa == a then
+ if not f then -- ?
+ f = n
+ end
+ l = n
+ else
+ -- possible extensions: when in same class then keep spanning
+ if f then
+ head, done = flush(head,f,l,d,level,parent,strip), true
+ end
+ f, l, a = n, n, aa
+ level, i = floor(a/1000), a%1000
+ d = data[i]
+ continue = d.continue == variables.yes
+ end
+ else
+ if f then
+ head, done = flush(head,f,l,d,level,parent,strip), true
+ end
+ f, l, a = nil, nil, nil
+ end
+ elseif f and (id == disc or (id == kern and n.subtype == 0)) then
+ l = n
+ elseif id == hlist or id == vlist then
+ if f then
+ head, done = flush(head,f,l,d,level,parent,strip), true
+ f, l, a = nil, nil, nil
+ end
+ local list = n.list
+ if list then
+ n.list = process_words(attribute,data,flush,list,n)
+ end
+ elseif checkdir and id == whatsit and n.subtype == 7 then -- only changes in dir, we assume proper boundaries
+ if f and a then
+ l = n
+ end
+ elseif f then
+ if continue then
+ if id == penalty or id == kern then
+ l = n
+ elseif id == glue then
+ l = n
+ end
+ else
+ head, done = flush(head,f,l,d,level,parent,strip), true
+ f, l, a = nil, nil, nil
+ end
+ end
+ n = n.next
+ end
+ if f then
+ head, done = flush(head,f,l,d,level,parent,strip), true
+ end
+ return head, true -- todo: done
+ else
+ return head, false
+ end
+end
+
+nodes.process_words = process_words
+
+--
+
+nodes.rules = nodes.rules or { }
+nodes.rules.data = nodes.rules.data or { }
+
+storage.register("nodes/rules/data", nodes.rules.data, "nodes.rules.data")
+
+local data = nodes.rules.data
+
+function nodes.rules.define(settings)
+ data[#data+1] = settings
+ texwrite(#data)
+end
+
+local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
+-- check for f and l
+ local r, m
+ if true then
+ f, l = strip_range(f,l)
+ end
+ local w = list_dimensions(parent.glue_set,parent.glue_sign,parent.glue_order,f,l.next)
+ local method, offset, continue, dy, rulethickness, unit, order, max, ma, ca, ta =
+ d.method, d.offset, d.continue, d.dy, d.rulethickness, d.unit, d.order, d.max, d.ma, d.ca, d.ta
+ local e = dimenfactor(unit,fontdata[f.font])
+ local colorspace = (ma > 0 and ma) or has_attribute(f,a_colorspace) or 1
+ local color = (ca > 0 and ca) or has_attribute(f,a_color)
+ local transparency = (ta > 0 and ta) or has_attribute(f,a_transparency)
+ local foreground = order == variables.foreground
+ rulethickness= rulethickness/2
+ if level > max then
+ level = max
+ end
+ if method == 0 then -- center
+ offset = 2*offset
+ m = (offset+(level-1)*dy+rulethickness)*e/2
+ else
+ m = 0
+ end
+ for i=1,level do
+ local ht = (offset+(i-1)*dy+rulethickness)*e - m
+ local dp = -(offset+(i-1)*dy-rulethickness)*e + m
+ local r = new_rule(w,ht,dp)
+ if color then
+ set_attribute(r,a_colorspace,colorspace)
+ set_attribute(r,a_color,color)
+ end
+ if transparency then
+ set_attribute(r,a_transparency,transparency)
+ end
+ local k = new_kern(-w)
+ if foreground then
+ insert_after(head,l,k)
+ insert_after(head,k,r)
+ l = r
+ else
+ head, _ = insert_before(head,f,r)
+ insert_after(head,r,k)
+ end
+ if trace_ruled then
+ logs.report("ruled", "level: %s, width: %i, height: %i, depth: %i, nodes: %s, text: %s",
+ level,w,ht,dp,n_tostring(f,l),n_tosequence(f,l,true))
+ -- level,r.width,r.height,r.depth,n_tostring(f,l),n_tosequence(f,l,true))
+ end
+ end
+ return head
+end
+
+local process = nodes.process_words
+
+nodes.rules.process = function(head) return process(a_ruled,data,flush_ruled,head) end
+
+function nodes.rules.enable()
+ tasks.enableaction("shipouts","nodes.rules.process")
+end
+
+-- elsewhere:
+--
+-- tasks.appendaction ("shipouts", "normalizers", "nodes.rules.process")
+-- tasks.disableaction("shipouts", "nodes.rules.process") -- only kick in when used
+
+local trace_shifted = false trackers.register("nodes.shifted", function(v) trace_shifted = v end)
+
+local a_shifted = attributes.private('shifted')
+
+nodes.shifts = nodes.shifts or { }
+nodes.shifts.data = nodes.shifts.data or { }
+
+storage.register("nodes/shifts/data", nodes.shifts.data, "nodes.shifts.data")
+
+local data = nodes.shifts.data
+
+function nodes.shifts.define(settings)
+ data[#data+1] = settings
+ texwrite(#data)
+end
+
+local function flush_shifted(head,first,last,data,level,parent,strip) -- not that fast but acceptable for this purpose
+ if true then
+ first, last = strip_range(first,last)
+ end
+ local prev, next = first.prev, last.next
+ first.prev, last.next = nil, nil
+ local width, height, depth = list_dimensions(parent.glue_set,parent.glue_sign,parent.glue_order,first,next)
+ local list = hpack_nodes(first,width,"exactly")
+ if first == head then
+ head = list
+ end
+ if prev then
+ prev.next, list.prev = list, prev
+ end
+ if next then
+ next.prev, list.next = list, next
+ end
+ local raise = data.dy * dimenfactor(data.unit,fontdata[first.font])
+ list.shift, list.height, list.depth = raise, height, depth
+ if trace_shifted then
+ logs.report("shifted", "width: %s, nodes: %s, text: %s",width,n_tostring(first,last),n_tosequence(first,last,true))
+ end
+ return head
+end
+
+local process = nodes.process_words
+
+nodes.shifts.process = function(head) return process(a_shifted,data,flush_shifted,head) end
+
+function nodes.shifts.enable()
+ tasks.enableaction("shipouts","nodes.shifts.process")
+end
diff --git a/Master/texmf-dist/tex/context/base/node-rul.mkiv b/Master/texmf-dist/tex/context/base/node-rul.mkiv
new file mode 100644
index 00000000000..1270eb81d7a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-rul.mkiv
@@ -0,0 +1,343 @@
+%D \module
+%D [ file=node-rul,
+%D version=2009.11.03, % 1995.10.10,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Bars,
+%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.
+
+% todo: ex and and em traveling with attribute
+
+\writestatus{loading}{ConTeXt Core Macros / Bars}
+
+%D The name of this file might change.
+
+%D \macros
+%D {underbar,underbars,
+%D overbar,overbars,
+%D overstrike,overstrikes,
+%D setupbar}
+%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 \showsetup{setupunderbar}
+
+\unprotect
+
+%definesystemattribute[ruled]
+%definesystemattribute[shifted]
+
+\registerctxluafile{node-rul}{1.001}
+
+\newtoks\checkalldefinedbars
+
+\def\barparameter #1{\csname\dobarparameter\currentbar#1\endcsname}
+\def\dobarparameter #1#2{\ifcsname\??on#1#2\endcsname\??on#1#2\else\expandafter\dobarparentparameter\csname\??on#1\s!parent\endcsname#2\fi}
+\def\dobarparentparameter#1#2{\ifx#1\relax\s!empty\else\dobarparameter#1#2\fi}
+
+\unexpanded\def\definebar
+ {\dotripleempty\dodefinebar}
+
+\def\dodefinebar[#1][#2][#3]%
+ {\ifthirdargument
+ \getparameters[\??on#1][\s!parent=#2,#3]%
+ \else
+ \getparameters[\??on#1][\s!parent=,#2]%
+ \fi
+ %
+ %\setvalue{\??on:#1}{0}%
+ %
+ \ifcsname\??on:#1:c\endcsname
+ \csname\??on:#1:c\endcsname\zerocount
+ \else
+ \expandafter\newcount\csname\??on:#1:c\endcsname
+ \fi
+ \normalexpanded{\checkalldefinedbars{\noexpand\doredefinebar{#1}\the\checkalldefinedbars}}%
+ \dodefinebarindeed{#1}%
+ \setuvalue{#1}{\doruled{#1}}}
+
+\def\dodefinebarindeed#1%
+ {\bgroup
+ \def\currentbar{#1}%
+ \doifsomethingelse{\barparameter\c!color}
+ {\donetrue\colored[\barparameter\c!color]}
+ {\donefalse}%
+ \normalexpanded
+ {\egroup
+ \scratchcounter\ctxlua{nodes.rules.define {
+ method = \barparameter\c!method,
+ offset = \barparameter\c!offset,
+ continue = "\barparameter\c!continue",
+ dy = \barparameter\c!dy,
+ rulethickness = \barparameter\c!rulethickness,
+ unit = "\barparameter\c!unit",
+ order = "\barparameter\c!order",
+ max = \barparameter\c!max,
+ ma = \ifdone\the\attribute\colormodelattribute \else0\fi,
+ ca = \ifdone\the\attribute\colorattribute \else0\fi,
+ ta = \ifdone\the\attribute\transparencyattribute\else0\fi
+ }}}%
+ \setevalue{\??on#1:a}{\the\scratchcounter}}
+
+\let\doredefinebar\dodefinebarindeed
+
+\def\doruled#1%
+ {\groupedcommand{\dodoruled{#1}}\relax}
+
+\def\dodoruled
+ {\ctxlua{nodes.rules.enable()}%
+ \glet\dodoruled\dodoruledindeed
+ \dodoruled}
+
+\def\dodoruledindeed#1%
+ {\advance\csname\??on:#1:c\endcsname\plusone
+ \scratchcounter\csname\??on:#1:c\endcsname
+ \attribute\ruledattribute\numexpr1000*\scratchcounter
+ +\csname\??on#1\ifcsname\??on#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname}
+
+% ungrouped
+
+\unexpanded\def\startbar[#1]%
+ {\begingroup
+ \dodoruled{#1}}
+
+\unexpanded\def\stopbar
+ {\endgroup}
+
+\newcount\currentbarnesting % todo: same as colors
+
+\unexpanded\def\pushbar[#1]%
+ {\global\advance\currentbarnesting\plusone
+ \expandafter\edef\csname\??on:s:\number\currentbarnesting\endcsname
+ {\attribute\ruledattribute\the\attribute\ruledattribute}% stack
+ \dodoruled{#1}}
+
+\unexpanded\def\popbar
+ {\csname\??on:s:\number\currentbarnesting\endcsname
+ \global\advance\currentbarnesting\minusone}
+
+\unexpanded\def\setupbars
+ {\dodoubleempty\dosetupbars}
+
+\def\dosetupbars[#1][#2]% not that efficient
+ {\ifsecondargument
+ \getparameters[\??on#1][#2]%
+ \dodefinebarindeed{#1}%
+ \else
+ \getparameters[\??on][#1]%
+ \the\checkalldefinedbars
+ \fi}
+
+\setupbars
+ [\c!method=0, % new: 0=center nested, 1=stack nested
+ \c!continue=\v!no,
+ \c!offset=0, % upwards, replaces: topoffset bottomoffset
+ \c!dy=0,
+ \c!max=3,
+ \c!rulethickness=.1,
+ \c!order=\v!foreground,
+ \c!unit=ex, % so now we are relative
+ \c!color=] % replaces: rulecolor
+
+% \definebar[touchbar] [\c!method=0,\c!dy=-0.4,\c!offset=-0.0]
+% \definebar[touchbars] [touchbar] [\c!continue=\v!yes]
+
+\definebar[\v!overstrike] [\c!method=0,\c!dy= 0.4,\c!offset= 0.5,\c!continue=\v!yes]
+\definebar[\v!underbar] [\c!method=1,\c!dy=-0.4,\c!offset=-0.3,\c!continue=\v!yes]
+\definebar[\v!overbar] [\c!method=1,\c!dy= 0.4,\c!offset= 1.8,\c!continue=\v!yes]
+
+\definebar[\v!overstrikes] [\v!overstrike] [\c!continue=\v!no]
+\definebar[\v!underbars] [\v!underbar] [\c!continue=\v!no]
+\definebar[\v!overbars] [\v!overbar] [\c!continue=\v!no]
+
+% we want these always so ...
+
+\expandafter\let\expandafter\overstrike \csname\v!overstrike \endcsname
+\expandafter\let\expandafter\underbar \csname\v!underbar \endcsname
+\expandafter\let\expandafter\overbar \csname\v!overbar \endcsname
+\expandafter\let\expandafter\overstrikes\csname\v!overstrikes\endcsname
+\expandafter\let\expandafter\underbars \csname\v!underbars \endcsname
+\expandafter\let\expandafter\overbars \csname\v!overbars \endcsname
+
+\unexpanded\def\setupunderbar[#1]% too incompatible for the moment
+ {}
+
+%D This will move: (a bit duplicated)
+
+\newtoks\checkalldefinedshifts
+
+\def\shiftparameter #1{\csname\doshiftparameter\currentshift#1\endcsname}
+\def\shiftparameterhash#1{\doshiftparameterhash{\??ra\currentshift}#1}
+
+\def\doshiftparameter #1#2{\ifcsname\??ra#1#2\endcsname\??ra#1#2\else\expandafter\doshiftparentparameter\csname\??ra#1\s!parent\endcsname#2\fi}
+\def\doshiftparameterhash#1#2{\ifcsname#1#2\endcsname#1\else\expandafter\doshiftparentparameterhash\csname#1\s!parent\endcsname#2\fi}
+
+\def\doshiftparentparameter #1#2{\ifx#1\relax\s!empty\else\doshiftparameter #1#2\fi}
+\def\doshiftparentparameterhash#1#2{\ifx#1\relax \else\doshiftparameterhash#1#2\fi}
+
+\def\dosetshiftattributes#1#2% style color
+ {\edef\fontattributehash {\shiftparameterhash#1}%
+ \edef\colorattributehash{\shiftparameterhash#2}%
+ \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi
+ \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi}
+
+\unexpanded\def\defineshift
+ {\dotripleempty\dodefineshift}
+
+\def\dodefineshift[#1][#2][#3]%
+ {\ifthirdargument
+ \getparameters[\??ra#1][\s!parent=#2,#3]%
+ \else
+ \getparameters[\??ra#1][\s!parent=,#2]%
+ \fi
+ %
+ %\setvalue{\??ra:#1}{0}%
+ %
+ \ifcsname\??ra:#1:c\endcsname
+ \csname\??ra:#1:c\endcsname\zerocount
+ \else
+ \expandafter\newcount\csname\??ra:#1:c\endcsname
+ \fi
+ \normalexpanded{\checkalldefinedshifts{\noexpand\doredefineshift{#1}\the\checkalldefinedshifts}}%
+ \dodefineshiftindeed{#1}%
+ \setuvalue{#1}{\doshifted{#1}}}
+
+\def\dodefineshiftindeed#1%
+ {\bgroup
+ \def\currentshift{#1}%
+ \normalexpanded
+ {\egroup
+ \scratchcounter\ctxlua{nodes.shifts.define {
+ method = \shiftparameter\c!method,
+ continue = "\shiftparameter\c!continue",
+ dy = \shiftparameter\c!dy,
+ unit = "\shiftparameter\c!unit",
+ }}}%
+ \setevalue{\??ra#1:a}{\the\scratchcounter}}
+
+\let\doredefineshift\dodefineshiftindeed
+
+\def\doshifted#1%
+ {\groupedcommand{\dodoshifted{#1}}\relax}
+
+\def\dodoshifted
+ {\ctxlua{nodes.shifts.enable()}%
+ \glet\dodoshifted\dodoshiftedindeed
+ \dodoshifted}
+
+% \def\dodoshiftedindeed#1%
+% {\def\currentshift{#1}%
+% \advance\csname\??ra:#1:c\endcsname\plusone
+% \scratchcounter\csname\??ra:#1:c\endcsname
+% \attribute\shiftedattribute\numexpr1000*\scratchcounter
+% +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname
+% \setupalign[\shiftparameter\c!align]%
+% \dosetshiftattributes\c!style\c!color}
+
+\def\dostartisolation{\char0 }
+\def\dostopisolation {\char0 }
+\def\doisolator {\char0 }
+
+\def\doisolatedgroupedalign#1#2%
+ {\groupedcommand
+ {\begingroup\dostartisolation\begingroup#1}
+ {#2\endgroup\dostopisolation\endgroup}}
+
+\def\dosetupisolatedalign#1%
+ {\doisolator
+ \setupalign[#1]\relax}
+
+\def\dodoshiftedindeed#1%
+ {\def\currentshift{#1}%
+ \advance\csname\??ra:#1:c\endcsname\plusone
+ \scratchcounter\csname\??ra:#1:c\endcsname
+ \attribute\shiftedattribute\numexpr1000*\scratchcounter
+ +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname
+ \dosetshiftattributes\c!style\c!color
+ \dosetupisolatedalign{\shiftparameter\c!align}}
+
+\def\doshifted#1%
+ {\doisolatedgroupedalign{\dodoshifted{#1}}{}}
+
+\unexpanded\def\startshift[#1]%
+ {\begingroup
+ \dodoshifted{#1}}
+
+\unexpanded\def\stopshift
+ {\endgroup}
+
+\unexpanded\def\setupshifts
+ {\dodoubleempty\dosetupshifts}
+
+\def\dosetupshifts[#1][#2]% not that efficient
+ {\ifsecondargument
+ \getparameters[\??ra#1][#2]%
+ \dodefineshiftindeed{#1}%
+ \else
+ \getparameters[\??ra][#1]%
+ \the\checkalldefinedshifts
+ \fi}
+
+\setupshifts
+ [\c!method=0,
+ \c!continue=\v!no,
+ \c!dy=0,
+ \c!unit=ex,
+ \c!align=,
+ \c!style=,
+ \c!color=]
+
+\def\v!shiftup {shiftup}
+\def\v!shiftdown{shiftdown}
+
+\defineshift [\v!shiftup] [\c!method=0,\c!dy=-1,\c!unit=ex,\c!continue=\v!yes,\c!style=\txx,\c!color=]
+\defineshift [\v!shiftdown] [\c!method=1,\c!dy=.3,\c!unit=ex,\c!continue=\v!yes,\c!style=\txx,\c!color=]
+
+% we want these always so ...
+
+\expandafter\let\expandafter\shiftup \csname\v!shiftup \endcsname
+\expandafter\let\expandafter\shiftdown \csname\v!shiftdown \endcsname
+
+\protect \endinput
+
+% obsolete:
+
+\setupunderbar
+ [\c!alternative=a,
+ \c!rulethickness=\linewidth,
+ \c!bottomoffset=1.5pt,
+ \c!topoffset=2.5pt,
+ \c!rulecolor=]
diff --git a/Master/texmf-dist/tex/context/base/node-seq.lua b/Master/texmf-dist/tex/context/base/node-seq.lua
index 43ca8a99bab..3a2cf5b6ef0 100644
--- a/Master/texmf-dist/tex/context/base/node-seq.lua
+++ b/Master/texmf-dist/tex/context/base/node-seq.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-seq'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -13,7 +13,10 @@ assume that namespaces for the functions are used, but for speed we
use locals to refer to them when compiling the chain.</p>
--ldx]]--
+-- todo: delayed: i.e. we register them in the right order already but delay usage
+
local format, gsub, concat, gmatch = string.format, string.gsub, table.concat, string.gmatch
+local type, loadstring = type, loadstring
sequencer = sequencer or { }
@@ -30,9 +33,11 @@ end
function sequencer.reset()
return {
- list = { },
+ list = { },
order = { },
- kind = { },
+ kind = { },
+ askip = { },
+ gskip = { },
}
end
@@ -68,6 +73,11 @@ function sequencer.appendaction(t,group,action,where,kind,force)
end
end
+function sequencer.enableaction (t,action) t.askip[action] = false end
+function sequencer.disableaction(t,action) t.askip[action] = true end
+function sequencer.enablegroup (t,group) t.gskip[group] = false end
+function sequencer.disablegroup (t,group) t.gskip[group] = true end
+
function sequencer.setkind(t,action,kind)
t.kind[action] = kind
end
@@ -85,7 +95,7 @@ function sequencer.compile(t,compiler,n)
elseif compiler then
t = compiler(t,n)
else
- t = sequencer.tostring(t,n)
+ t = sequencer.tostring(t)
end
return loadstring(t)()
end
@@ -100,16 +110,21 @@ return function(...)
%s
end]]
-function sequencer.tostring(t,n) -- n not done
- local list, order, kind, vars, calls = t.list, t.order, t.kind, { }, { }
+function sequencer.tostring(t)
+ local list, order, kind, gskip, askip = t.list, t.order, t.kind, t.gskip, t.askip
+ local vars, calls, args = { }, { }, nil
for i=1,#order do
local group = order[i]
- local actions = list[group]
- for i=1,#actions do
- local action = actions[i]
- local localized = localize(action)
- vars [#vars +1] = format("local %s = %s", localized, action)
- calls[#calls+1] = format(" %s(...) -- %s %i", localized, group, i)
+ if not gskip[group] then
+ local actions = list[group]
+ for i=1,#actions do
+ local action = actions[i]
+ if not askip[action] then
+ local localized = localize(action)
+ vars [#vars +1] = format("local %s = %s", localized, action)
+ calls[#calls+1] = format(" %s(...) -- %s %i", localized, group, i)
+ end
+ end
end
end
return format(template,concat(vars,"\n"),concat(calls,"\n"))
@@ -130,63 +145,42 @@ return function(head%s)
end]]
function sequencer.nodeprocessor(t,n)
- local list, order, kind, vars, calls, args = t.list, t.order, t.kind, { }, { }, nil
+ local list, order, kind, gskip, askip = t.list, t.order, t.kind, t.gskip, t.askip
+ local vars, calls, args = { }, { }, nil
if n == 0 then
args = ""
elseif n == 1 then
args = ",one"
elseif n == 2 then
args = ",one,two"
+ elseif n == 3 then
+ args = ",one,two,three"
+ elseif n == 4 then
+ args = ",one,two,three,four"
+ elseif n == 5 then
+ args = ",one,two,three,four,five"
else
args = ",..."
end
for i=1,#order do
local group = order[i]
- local actions = list[group]
- for i=1,#actions do
- local action = actions[i]
- local localized = localize(action)
- vars[#vars+1] = format("local %s = %s",localized,action)
- if kind[action] == "nohead" then
- calls[#calls+1] = format(" ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
- else
- calls[#calls+1] = format(" head, ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ if not gskip[group] then
+ local actions = list[group]
+ for i=1,#actions do
+ local action = actions[i]
+ if not askip[action] then
+ local localized = localize(action)
+ vars[#vars+1] = format("local %s = %s",localized,action)
+ if kind[action] == "nohead" then
+ calls[#calls+1] = format(" ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ else
+ calls[#calls+1] = format(" head, ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i)
+ end
+ end
end
end
end
local processor = format(template,concat(vars,"\n"),args,concat(calls,"\n"))
- -- print(processor)
+--~ print(processor)
return processor
end
-
---~ hans = {}
---~ taco = {}
-
---~ function hans.a(head,tail) print("a",head,tail) return head,tail,true end
---~ function hans.b(head,tail) print("b",head,tail) return head,tail,true end
---~ function hans.c(head,tail) print("c",head,tail) return head,tail,true end
---~ function hans.x(head,tail) print("x",head,tail) return head,tail,true end
---~ function taco.i(head,tail) print("i",head,tail) return head,tail,true end
---~ function taco.j(head,tail) print("j",head,tail) return head,tail,true end
-
---~ t = sequencer.reset()
-
---~ sequencer.appendgroup(t,"hans")
---~ sequencer.appendgroup(t,"taco")
---~ sequencer.prependaction(t,"hans","hans.a")
---~ sequencer.appendaction (t,"hans","hans.b")
---~ sequencer.appendaction (t,"hans","hans.x")
---~ sequencer.prependaction(t,"hans","hans.c","hans.b")
---~ sequencer.prependaction(t,"taco","taco.i")
---~ sequencer.prependaction(t,"taco","taco.j")
---~ sequencer.removeaction(t,"hans","hans.x")
-
---~ sequencer.setkind(t,"hans.b")
---~ sequencer.setkind(t,"taco.j","nohead")
-
---~ print(sequencer.tostring(t))
-
---~ s = sequencer.compile(t,sequencer.nodeprocessor)
-
---~ print(sequencer.nodeprocessor(t))
---~ print(s("head","tail"))
diff --git a/Master/texmf-dist/tex/context/base/node-ser.lua b/Master/texmf-dist/tex/context/base/node-ser.lua
index 65c071c0050..e632e92da04 100644
--- a/Master/texmf-dist/tex/context/base/node-ser.lua
+++ b/Master/texmf-dist/tex/context/base/node-ser.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-ser'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -196,6 +196,8 @@ local function serialize(root,name,handle,depth,m)
else
handle(format("%s %s=%q,",depth,key(k),v))
end
+ elseif t == "boolean" then
+ handle(format("%s %s=%q,",depth,key(k),tostring(v)))
elseif v then -- userdata or table
serialize(v,k,handle,depth,m+1)
end
diff --git a/Master/texmf-dist/tex/context/base/node-shp.lua b/Master/texmf-dist/tex/context/base/node-shp.lua
index 8cde38dc0a8..50b16efa581 100644
--- a/Master/texmf-dist/tex/context/base/node-shp.lua
+++ b/Master/texmf-dist/tex/context/base/node-shp.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-shp'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -20,7 +20,7 @@ local function cleanup_page(head) -- rough
local start = head
while start do
local id = start.id
- if id == disc or (id == glue and not start.spec) or (id == kern and start.kern == 0) or id == mark then
+ if id == disc or (id == glue and not start.writable) or (id == kern and start.kern == 0) or id == mark then
head, start, tmp = remove_node(head,start)
free_node(tmp)
elseif id == hlist or id == vlist then
diff --git a/Master/texmf-dist/tex/context/base/node-tex.lua b/Master/texmf-dist/tex/context/base/node-tex.lua
index 1995f4aa273..a6eef32693f 100644
--- a/Master/texmf-dist/tex/context/base/node-tex.lua
+++ b/Master/texmf-dist/tex/context/base/node-tex.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-tex'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -34,6 +34,6 @@ function kernel.kerning(head)
return head, done
end
-callback.register('hyphenate' , false)
-callback.register('ligaturing', false)
-callback.register('kerning' , false)
+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/node-tra.lua b/Master/texmf-dist/tex/context/base/node-tra.lua
index aeaa6769e5e..5acd70baf2e 100644
--- a/Master/texmf-dist/tex/context/base/node-tra.lua
+++ b/Master/texmf-dist/tex/context/base/node-tra.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-tra'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -8,11 +8,11 @@ if not modules then modules = { } end modules ['node-tra'] = {
--[[ldx--
<p>This is rather experimental. We need more control and some of this
-might become a runtime module instead.</p>
+might become a runtime module instead. This module will be cleaned up!</p>
--ldx]]--
local utf = unicode.utf8
-local format, match, concat, utfchar = string.format, string.match, table.concat, utf.char
+local format, match, concat, rep, utfchar = string.format, string.match, table.concat, string.rep, utf.char
local ctxcatcodes = tex.ctxcatcodes
@@ -26,9 +26,12 @@ nodes.tracers.characters = nodes.tracers.characters or { }
nodes.tracers.steppers = nodes.tracers.steppers or { }
local glyph = node.id('glyph')
+local hlist = node.id('hlist')
+local vlist = node.id('vlist')
local disc = node.id('disc')
local glue = node.id('glue')
local kern = node.id('kern')
+local rule = node.id('rule')
local whatsit = node.id('whatsit')
local copy_node_list = node.copy_list
@@ -137,11 +140,12 @@ function nodes.tracers.characters.start()
end
function nodes.tracers.characters.stop()
tracers.list['characters'] = list
- lmx.set('title', 'ConTeXt Character Processing Information')
- lmx.set('color-background-one', lmx.get('color-background-yellow'))
- lmx.set('color-background-two', lmx.get('color-background-purple'))
- lmx.show('context-characters.lmx')
- lmx.restore()
+ local variables = {
+ ['title'] = 'ConTeXt Character Processing Information',
+ ['color-background-one'] = lmx.get('color-background-yellow'),
+ ['color-background-two'] = lmx.get('color-background-purple'),
+ }
+ lmx.show('context-characters.lmx',variables)
nodes.process_characters = npc
tasks.restart("processors", "characters")
end
@@ -205,7 +209,7 @@ function nodes.tracers.steppers.features()
while f do
if f.id == glyph then
local tfmdata, t = fontdata[f.font], { }
- for feature, value in table.sortedpairs(tfmdata.shared.features) do
+ for feature, value in table.sortedhash(tfmdata.shared.features) do
if feature == "number" or feature == "features" then
-- private
elseif type(value) == "boolean" then
@@ -310,7 +314,7 @@ function nodes.show_list(head, message)
if message then
texio.write_nl(message)
end
- for n in traverse(head) do
+ for n in traverse_nodes(head) do
texio.write_nl(tostring(n))
end
end
@@ -330,7 +334,8 @@ function nodes.tosequence(start,stop,compact)
if start then
local t = { }
while start do
- if start.id == glyph then
+ local id = start.id
+ if id == glyph then
local c = start.char
if compact then
if start.components then
@@ -341,11 +346,19 @@ function nodes.tosequence(start,stop,compact)
else
t[#t+1] = format("U+%04X:%s",c,utfchar(c))
end
+ elseif id == whatsit and start.subtype == 6 or start.subtype == 7 then
+ t[#t+1] = "[" .. start.dir .. "]"
+ elseif id == rule then
+ if compact then
+ t[#t+1] = "|"
+ else
+ t[#t+1] = node_type(id)
+ end
else
if compact then
t[#t+1] = "[]"
else
- t[#t+1] = match(tostring(start),": (%S+)")
+ t[#t+1] = node_type(id)
end
end
if start == stop then
@@ -360,22 +373,22 @@ function nodes.tosequence(start,stop,compact)
return concat(t," ")
end
else
- return "<empty>"
+ return "[empty]"
end
end
function nodes.report(t,done)
if done then
if status.output_active then
- texio.write(format("<++ %s>",count(t)))
+ logs.report("nodes","output, changed, %s nodes",nodes.count(t))
else
- texio.write(format("<+ %s>",count(t)))
+ texio.write("nodes","normal, changed, %s nodes",nodes.count(t))
end
else
if status.output_active then
- texio.write(format("<-- %s>",count(t)))
+ logs.report("nodes","output, unchanged, %s nodes",nodes.count(t))
else
- texio.write(format("<- %s>",count(t)))
+ texio.write("nodes","normal, unchanged, %s nodes",nodes.count(t))
end
end
end
@@ -390,7 +403,7 @@ end
function nodes.ids_to_string(head,tail)
local t, last_id, last_n = { }, nil, 0
- for n in traverse_nodes(head,tail) do
+ for n in traverse_nodes(head,tail) do -- hm, does not stop at tail
local id = n.id
if not last_id then
last_id, last_n = id, 1
@@ -404,6 +417,9 @@ function nodes.ids_to_string(head,tail)
end
last_id, last_n = id, 1
end
+ if n == tail then
+ break
+ end
end
if not last_id then
t[#t+1] = "no nodes"
@@ -414,3 +430,45 @@ function nodes.ids_to_string(head,tail)
end
return concat(t," ")
end
+
+nodes.ids_tostring = nodes.ids_to_string
+
+local function show_simple_list(h,depth,n)
+ while h do
+ texio.write_nl(rep(" ",n) .. tostring(h))
+ if not depth or n < depth then
+ local id = h.id
+ if id == hlist or id == vlist then
+ show_simple_list(h.list,depth,n+1)
+ end
+ end
+ h = h.next
+ end
+end
+
+--~ \startluacode
+--~ callback.register('buildpage_filter',function() nodes.show_simple_list(tex.lists.contrib_head) end)
+--~ \stopluacode
+--~ \vbox{b\footnote{n}a}
+--~ \startluacode
+--~ callback.register('buildpage_filter',nil)
+--~ \stopluacode
+
+nodes.show_simple_list = function(h,depth) show_simple_list(h,depth,0) end
+
+function nodes.list_to_utf(h,joiner)
+ local joiner = (joiner ==true and utfchar(0x200C)) or joiner -- zwnj
+ local w = { }
+ while h do
+ if h.id == glyph then -- always true
+ w[#w+1] = utfchar(h.char)
+ if joiner then
+ w[#w+1] = joiner
+ end
+ else
+ w[#w+1] = "[-]"
+ end
+ h = h.next
+ end
+ return concat(w)
+end
diff --git a/Master/texmf-dist/tex/context/base/node-tsk.lua b/Master/texmf-dist/tex/context/base/node-tsk.lua
index d2ac57d6b97..206b4a2668c 100644
--- a/Master/texmf-dist/tex/context/base/node-tsk.lua
+++ b/Master/texmf-dist/tex/context/base/node-tsk.lua
@@ -1,15 +1,17 @@
if not modules then modules = { } end modules ['node-tsk'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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 trace_tasks = false trackers.register("tasks", function(v) trace_tasks = v end)
+-- this might move to task-*
-tasks = tasks or { }
-tasks.data = tasks.data or { }
+local trace_tasks = false trackers.register("tasks.creation", function(v) trace_tasks = v end)
+
+tasks = tasks or { }
+tasks.data = tasks.data or { }
function tasks.new(name,list)
local tasklist = sequencer.reset()
@@ -19,13 +21,45 @@ function tasks.new(name,list)
end
end
-function tasks.restart(name,group)
+function tasks.restart(name)
local data = tasks.data[name]
if data then
data.runner = false
end
end
+function tasks.enableaction(name,action)
+ local data = tasks.data[name]
+ if data then
+ sequencer.enableaction(data.list,action)
+ data.runner = false
+ end
+end
+
+function tasks.disableaction(name,action)
+ local data = tasks.data[name]
+ if data then
+ sequencer.disableaction(data.list,action)
+ data.runner = false
+ end
+end
+
+function tasks.enablegroup(name,group)
+ local data = tasks.data[name]
+ if data then
+ sequencer.enablegroup(data.list,group)
+ data.runner = false
+ end
+end
+
+function tasks.disablegroup(name,group)
+ local data = tasks.data[name]
+ if data then
+ sequencer.disablegroup(data.list,group)
+ data.runner = false
+ end
+end
+
function tasks.appendaction(name,group,action,where,kind)
local data = tasks.data[name]
if data then
@@ -66,12 +100,14 @@ local created, total = 0, 0
statistics.register("node list callback tasks", function()
if total > 0 then
- return string.format("%s unique tasks, %s created, %s calls",table.count(tasks.data),created,total)
+ return string.format("%s unique task lists, %s instances (re)created, %s calls",table.count(tasks.data),created,total)
else
return nil
end
end)
+local compile, nodeprocessor = sequencer.compile, sequencer.nodeprocessor
+
function tasks.actions(name,n) -- we optimize for the number or arguments (no ...)
local data = tasks.data[name]
if data then
@@ -84,7 +120,7 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no ..
if trace_tasks then
logs.report("nodes","creating task runner '%s'",name)
end
- runner = sequencer.compile(data.list,sequencer.nodeprocessor,0)
+ runner = compile(data.list,nodeprocessor,0)
data.runner = runner
end
return runner(head)
@@ -96,9 +132,9 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no ..
if not runner then
created = created + 1
if trace_tasks then
- logs.report("nodes","creating task runner '%s'",name)
+ logs.report("nodes","creating task runner '%s' with 1 extra arguments",name)
end
- runner = sequencer.compile(data.list,sequencer.nodeprocessor,1)
+ runner = compile(data.list,nodeprocessor,1)
data.runner = runner
end
return runner(head,one)
@@ -110,13 +146,55 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no ..
if not runner then
created = created + 1
if trace_tasks then
- logs.report("nodes","creating task runner '%s'",name)
+ logs.report("nodes","creating task runner '%s' with 2 extra arguments",name)
end
- runner = sequencer.compile(data.list,sequencer.nodeprocessor,2)
+ runner = compile(data.list,nodeprocessor,2)
data.runner = runner
end
return runner(head,one,two)
end
+ elseif n == 3 then
+ return function(head,one,two,three)
+ total = total + 1 -- will go away
+ local runner = data.runner
+ if not runner then
+ created = created + 1
+ if trace_tasks then
+ logs.report("nodes","creating task runner '%s' with 3 extra arguments",name)
+ end
+ runner = compile(data.list,nodeprocessor,3)
+ data.runner = runner
+ end
+ return runner(head,one,two,three)
+ end
+ elseif n == 4 then
+ return function(head,one,two,three,four)
+ total = total + 1 -- will go away
+ local runner = data.runner
+ if not runner then
+ created = created + 1
+ if trace_tasks then
+ logs.report("nodes","creating task runner '%s' with 4 extra arguments",name)
+ end
+ runner = compile(data.list,nodeprocessor,4)
+ data.runner = runner
+ end
+ return runner(head,one,two,three,four)
+ end
+ elseif n == 5 then
+ return function(head,one,two,three,four,five)
+ total = total + 1 -- will go away
+ local runner = data.runner
+ if not runner then
+ created = created + 1
+ if trace_tasks then
+ logs.report("nodes","creating task runner '%s' with 5 extra arguments",name)
+ end
+ runner = compile(data.list,nodeprocessor,5)
+ data.runner = runner
+ end
+ return runner(head,one,two,three,four,five)
+ end
else
return function(head,...)
total = total + 1 -- will go away
@@ -124,9 +202,9 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no ..
if not runner then
created = created + 1
if trace_tasks then
- logs.report("nodes","creating task runner '%s'",name)
+ logs.report("nodes","creating task runner '%s' with n extra arguments",name)
end
- runner = sequencer.compile(data.list,sequencer.nodeprocessor,3)
+ runner = compile(data.list,nodeprocessor,"n")
data.runner = runner
end
return runner(head,...)
@@ -137,6 +215,33 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no ..
end
end
+function tasks.table(name) --maybe move this to task-deb.lua
+ local tsk = tasks.data[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
+
tasks.new (
"processors",
{
@@ -172,3 +277,39 @@ tasks.new (
"after", -- for users
}
)
+
+tasks.new (
+ "mvlbuilders",
+ {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ }
+)
+
+tasks.new (
+ "vboxbuilders",
+ {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ }
+)
+
+--~ tasks.new (
+--~ "parbuilders",
+--~ {
+--~ "before", -- for users
+--~ "lists",
+--~ "after", -- for users
+--~ }
+--~ )
+
+--~ tasks.new (
+--~ "pagebuilders",
+--~ {
+--~ "before", -- for users
+--~ "lists",
+--~ "after", -- for users
+--~ }
+--~ )
diff --git a/Master/texmf-dist/tex/context/base/node-tst.lua b/Master/texmf-dist/tex/context/base/node-tst.lua
index 4fb6b4bcaf5..d7ea96f26d9 100644
--- a/Master/texmf-dist/tex/context/base/node-tst.lua
+++ b/Master/texmf-dist/tex/context/base/node-tst.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['node-tst'] = {
version = 1.001,
- comment = "companion to node-ini.tex",
+ 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"
@@ -17,12 +17,12 @@ local find_node_tail = node.tail or node.slide
local chardata = characters.data
-function nodes.leftskip(n)
+function nodes.the_left_margin(n) -- todo: three values
while n do
local id = n.id
if id == glue then
if n.subtype == 8 then -- 7 in c/web source
- return (n.spec and n.spec.width) or 0
+ return n.spec.width
else
return 0
end
@@ -37,14 +37,14 @@ function nodes.leftskip(n)
return 0
end
-function nodes.rightskip(n)
+function nodes.the_right_margin(n)
if n then
n = find_node_tail(n)
while n do
local id = n.id
if id == glue then
if n.subtype == 9 then -- 8 in the c/web source
- return (n.spec and n.spec.width) or 0
+ return n.spec.width
else
return 0
end
diff --git a/Master/texmf-dist/tex/context/base/node-typ.lua b/Master/texmf-dist/tex/context/base/node-typ.lua
new file mode 100644
index 00000000000..5ab6b6975f4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/node-typ.lua
@@ -0,0 +1,53 @@
+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"
+}
+
+-- this will be replaced by blob-ini cum suis so typesetting will go away
+
+local utfvalues = string.utfvalues
+
+local newglyph = nodes.glyph
+local newglue = nodes.glue
+
+local hpack, vpack = node.hpack, node.vpack
+
+typesetting = typesetting or { }
+
+local function tonodes(str,fontid,spacing) -- don't use this
+ local head, prev = nil, nil
+ for s in utfvalues(str) do
+ local next
+ if spacing and s == 32 then
+ next = newglue(spacing or 64*1024*10)
+ else
+ next = newglyph(fontid or 1,s)
+ end
+ if not head then
+ head = next
+ else
+ prev.next = next
+ next.prev = prev
+ end
+ prev = next
+ end
+ return head
+end
+
+typesetting.tonodes = tonodes
+
+function typesetting.hpack(str,fontid,spacing)
+ return hpack(tonodes(str,fontid,spacing))
+end
+
+function typesetting.vpack(str,fontid,spacing)
+ -- vpack is just a hack, and a proper implentation is on the agenda
+ -- as it needs more info etc than currently available
+ return vpack(tonodes(str,fontid,spacing))
+end
+
+--~ node.write(typesetting.hpack("Hello World!"))
+--~ node.write(typesetting.hpack("Hello World!",1,100*1024*10))
diff --git a/Master/texmf-dist/tex/context/base/pack-box.mkii b/Master/texmf-dist/tex/context/base/pack-box.mkii
index 1be84055237..8adeedb91b5 100644
--- a/Master/texmf-dist/tex/context/base/pack-box.mkii
+++ b/Master/texmf-dist/tex/context/base/pack-box.mkii
@@ -751,7 +751,7 @@
\setvalue{\??ab\??ab \v!line\v!middle}{\baselinemiddlebox}
\setvalue{\??ab\??ab \v!line\v!right }{\baselinerightbox}
-\def\offsetbox
+\unexpanded\def\offsetbox
{\dodoubleempty\dooffsetbox[]}
% left/right/top/bottomoffset -> dimensions change
@@ -841,8 +841,8 @@
% \placefigure[left,none]{}{\offset[bottomoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
% \input tufte
-\def\offset {\dodoubleempty\dooffsetbox [\hbox]} % yes or no
-\def\aligned{\dosingleempty\doalignedbox[\hbox]} % yes or no
+\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}}}
@@ -854,9 +854,9 @@
\hbox to \wd\scratchbox{#1#4#2}%
\egroup}
-\def\ltabbed{\dotabbed\relax\hss}
-\def\rtabbed{\dotabbed\hss \relax}
-\def\ctabbed{\dotabbed\hss \hss} \let\mtabbed\ctabbed
+\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
@@ -903,7 +903,7 @@
% to be documented
-\def\phantombox[#1]%
+\unexpanded\def\phantombox[#1]%
{\hbox\bgroup
\getparameters
[\??ol]
@@ -919,7 +919,7 @@
% \backgroundimage{1}{\hsize}{\vsize}{\externalfigure[cow][\c!width=3cm]}
-\def\backgroundimage#1#2#3% repeat hsize vsize
+\unexpanded\def\backgroundimage#1#2#3% repeat hsize vsize
{\bgroup
\forgetall
\dowithnextbox
diff --git a/Master/texmf-dist/tex/context/base/pack-box.mkiv b/Master/texmf-dist/tex/context/base/pack-box.mkiv
index 2ab765d7d75..6cb492aa6df 100644
--- a/Master/texmf-dist/tex/context/base/pack-box.mkiv
+++ b/Master/texmf-dist/tex/context/base/pack-box.mkiv
@@ -103,7 +103,7 @@
\egroup}%
\vbox}
-\def\defineanchor
+\unexpanded\def\defineanchor
{\doquadrupleempty\dodefineanchor}
\def\dodefineanchor[#1][#2][#3][#4]%
@@ -123,7 +123,7 @@
\def\@@collectorbox{@@collectorbox}
-\def\definecollector
+\unexpanded\def\definecollector
{\dodoubleargument\dodefinecollector}
\def\dodefinecollector[#1][#2]%
@@ -139,7 +139,7 @@
\c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint,
\c!location=rb,\c!corner=,#2]}
-\def\setupcollector
+\unexpanded\def\setupcollector
{\dodoubleargument\dosetupcollector}
\def\dosetupcollector[#1][#2]%
@@ -388,7 +388,7 @@
[#1][#2]}%
{\egroup\getvalue{#1}}}
-\def\defineornament
+\unexpanded\def\defineornament
{\dotripleempty\dodefineornament}
\def\dodefineornament[#1][#2][#3]%
@@ -430,7 +430,7 @@
\newcount\nofbleeds % per pag
-\def\setupbleeding
+\unexpanded\def\setupbleeding
{\dodoubleempty\getparameters[\??bg]}
\setupbleeding
@@ -538,11 +538,6 @@
%
% \input tufte
%
-% \placesomefloat[right]{none}
-% {\bleed[width=5cm,height=3cm,location=rb]{\externalfigure[koe][bleed]}}
-%
-% \input tufte
-%
% \placefigure
% [top,none]
% {} % no caption
@@ -746,7 +741,7 @@
\setvalue{\??ab\??ab \v!line\v!middle}{\baselinemiddlebox}
\setvalue{\??ab\??ab \v!line\v!right }{\baselinerightbox}
-\def\offsetbox
+\unexpanded\def\offsetbox
{\dodoubleempty\dooffsetbox[]}
% left/right/top/bottomoffset -> dimensions change
@@ -836,8 +831,8 @@
% \placefigure[left,none]{}{\offset[bottomoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
% \input tufte
-\def\offset {\dodoubleempty\dooffsetbox [\hbox]} % yes or no
-\def\aligned{\dosingleempty\doalignedbox[\hbox]} % yes or no
+\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}}}
@@ -849,9 +844,9 @@
\hbox to \wd\scratchbox{#1#4#2}%
\egroup}
-\def\ltabbed{\dotabbed\relax\hss}
-\def\rtabbed{\dotabbed\hss \relax}
-\def\ctabbed{\dotabbed\hss \hss} \let\mtabbed\ctabbed
+\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
@@ -898,7 +893,7 @@
% to be documented
-\def\phantombox[#1]%
+\unexpanded\def\phantombox[#1]%
{\hbox\bgroup
\getparameters
[\??ol]
@@ -914,7 +909,7 @@
% \backgroundimage{1}{\hsize}{\vsize}{\externalfigure[cow][\c!width=3cm]}
-\def\backgroundimage#1#2#3% repeat hsize vsize
+\unexpanded\def\backgroundimage#1#2#3% repeat hsize vsize
{\bgroup
\forgetall
\dowithnextbox
diff --git a/Master/texmf-dist/tex/context/base/pack-lyr.mkiv b/Master/texmf-dist/tex/context/base/pack-lyr.mkiv
index 2e1bd2a11ea..0cb3ee24456 100644
--- a/Master/texmf-dist/tex/context/base/pack-lyr.mkiv
+++ b/Master/texmf-dist/tex/context/base/pack-lyr.mkiv
@@ -36,7 +36,7 @@
\ifx\undefined\defineoverlay \message{loaded to early} \wait \fi
-\def\defineoverlay
+\unexpanded\def\defineoverlay
{\dotripleempty\dodefineoverlay}
\def\dodefineoverlay[#1][#2][#3]% overlay [layer] content
@@ -67,7 +67,7 @@
% todo : links/rechts
-\def\definelayer
+\unexpanded\def\definelayer
{\dodoubleargument\dodefinelayer}
\def\dodefinelayer[#1][#2]% \zeropoint ipv \!!zeropoint
@@ -103,7 +103,7 @@
%D After a layer is defined, you can change its
%D characteristics.
-\def\setuplayer
+\unexpanded\def\setuplayer
{\dodoubleargument\dosetuplayer}
\def\dosetuplayer[#1][#2]%
@@ -214,7 +214,7 @@
\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
+\unexpanded\def\definelayerpreset
{\dodoubleargument\dodefinelayerpreset}
% \def\dodefinelayerpreset[#1][#2]%
@@ -649,13 +649,13 @@
% The next mechanism is obsolete and will be removed in \MKIV\ (or move to
% the compatibility module.
-% \newskip\xposition \newskip\yposition
-% \newskip\xdimension \newskip\ydimension
-% \newskip\xoffset \newskip\yoffset
+\newskip\xposition \newskip\yposition
+\newskip\xdimension \newskip\ydimension
+\newskip\xoffset \newskip\yoffset
% already defined \newbox\positionbox
-\def\startpositioning
+\unexpanded\def\startpositioning
{\bgroup
\xposition \zeropoint \yposition \zeropoint
\xdimension\zeropoint \ydimension\zeropoint
@@ -663,7 +663,7 @@
\hfuzz \paperwidth \vfuzz \paperheight
\setbox\positionbox\hbox\bgroup}
-\def\stoppositioning
+\unexpanded\def\stoppositioning
{\doifnot\@@psoffset\v!yes
{\global\xoffset\zeropoint
\global\yoffset\zeropoint}%
@@ -694,7 +694,7 @@
\c!xoffset=\!!zeropoint,%
\c!yoffset=\!!zeropoint]}
-\def\setuppositioning
+\unexpanded\def\setuppositioning
{\resetpositioning
\dodoubleargument\getparameters[\??ps]}
diff --git a/Master/texmf-dist/tex/context/base/pack-obj.lua b/Master/texmf-dist/tex/context/base/pack-obj.lua
index ce1c520ce65..0ee46fc99d1 100644
--- a/Master/texmf-dist/tex/context/base/pack-obj.lua
+++ b/Master/texmf-dist/tex/context/base/pack-obj.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['pack-obj'] = {
version = 1.001,
- comment = "companion to pack-obj.tex",
+ comment = "companion to pack-obj.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/pack-obj.mkiv b/Master/texmf-dist/tex/context/base/pack-obj.mkiv
index 14afef62387..81220e32437 100644
--- a/Master/texmf-dist/tex/context/base/pack-obj.mkiv
+++ b/Master/texmf-dist/tex/context/base/pack-obj.mkiv
@@ -292,7 +292,7 @@
{% \initializepaper
\forgetall
\dontshowcomposition
- \setbox\scratchbox\vbox
+ \setbox\scratchbox\vbox attr \viewerlayerattribute \attribute\viewerlayerattribute
{\doinsertobject{#1}{#2}}%
\setbox\scratchbox#3%
{\vbox to #5\scaledpoint
@@ -304,6 +304,7 @@
%\vss\box\scratchbox
\vss\hbox to #4\scaledpoint{\box\scratchbox\hss}% fix Chof
\fi\fi}}%
+% \forcecolorhack % needed in order to use layers etc
\box\scratchbox
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/pack-rul.lua b/Master/texmf-dist/tex/context/base/pack-rul.lua
index 6bbd3c856b4..378167c979a 100644
--- a/Master/texmf-dist/tex/context/base/pack-rul.lua
+++ b/Master/texmf-dist/tex/context/base/pack-rul.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['pack-rul'] = {
version = 1.001,
- comment = "companion to pack-rul.tex",
+ comment = "companion to pack-rul.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -10,16 +10,16 @@ if not modules then modules = { } end modules ['pack-rul'] = {
<p>An explanation is given in the history document <t>mk</t>.</p>
--ldx]]--
-local texdimen, texcount, texbox, texwd = tex.dimen, tex.count, tex.box, tex.wd
+local texdimen, texcount, texbox = tex.dimen, tex.count, tex.box
local hpack, free, copy, traverse_id = node.hpack, node.free, node.copy_list, node.traverse_id
function commands.doreshapeframedbox(n)
- local noflines, lastlinelength = 0, 0
- if texwd[n] ~= 0 then
- local list = texbox[n].list
+ local noflines, lastlinelength, box = 0, 0, texbox[n]
+ if box.width ~= 0 then
+ local list = box.list
if list then
local width, done = 0, false
- for h in traverse_id('hlist',list) do
+ for h in traverse_id('hlist',list) do -- no dir etc needed
local l = h.list
if l then
done = true
@@ -37,14 +37,14 @@ function commands.doreshapeframedbox(n)
local l = h.list
if l then
-- if h.width ~= width then -- else no display math handling (uses shift)
- h.list = hpack(l,width,'exactly')
+ h.list = hpack(l,width,'exactly',h.dir)
h.shift = 0 -- needed for display math
h.width = width
-- end
end
end
end
- texwd[n] = width
+ box.width = width
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/pack-rul.mkiv b/Master/texmf-dist/tex/context/base/pack-rul.mkiv
index 26fdaadeaf5..afacc2901b1 100644
--- a/Master/texmf-dist/tex/context/base/pack-rul.mkiv
+++ b/Master/texmf-dist/tex/context/base/pack-rul.mkiv
@@ -13,6 +13,8 @@
\writestatus{loading}{ConTeXt Packaging Macros / Ruled Content}
+%D redo framedtexts like framedcontent (parameter stuff)
+
%D After a few months testing this solution is now added
%D to the core. This introduces a possible incompatibility
%D between \MKII\ and \MKIV\ but for the better.
@@ -51,7 +53,7 @@
\def\dosetuplinewidth[#1]%
{\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}}
-\def\setuplinewidth
+\unexpanded\def\setuplinewidth
{\dosingleargument\dosetuplinewidth}
%D \macros
@@ -71,7 +73,7 @@
%D
%D \showsetup{setupscreens}
-\def\setupscreens
+\unexpanded\def\setupscreens
{\dodoubleargument\getparameters[\??rs]}
%D We will communicate through module specific variables, current
@@ -293,7 +295,7 @@
\appendtoks \oninterlineskip \to \everyoverlay
-\def\defineoverlay
+\unexpanded\def\defineoverlay
{\dodoubleargument\dodefineoverlay}
\def\dodefineoverlay[#1][#2]%
@@ -415,7 +417,7 @@
\setlayoutcomponentattribute\v!background\component
\fi
\let\foregroundbox\normalforegroundbox
- \hbox to \backgroundwidth \layoutcomponentboxattribute % width in case 'foreground' is used as overlay
+ \hbox \layoutcomponentboxattribute to \backgroundwidth % width in case 'foreground' is used as overlay
{\expandafter\dododobackgroundbox\framedbackground,\s!unknown,\relax % hm, messy .. look into it
\box\framebox\hss}}}
@@ -610,6 +612,8 @@
\def\inheritlocalframed[#1]#2[#3]{\letvalue{#1\s!parent}#3}
\def\copylocalframed [#1]#2[#3]{\setvalue{#1\s!parent}{#3}}
+\let\setuplocalframed\getparameters % obsolete
+
\presetlocalframed[\??ol]
\newcount\framednesting
@@ -620,7 +624,7 @@
\expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol
\dodoubleempty\startlocalframed[\??ol:\the\framednesting]}
-\def\setupframed
+\unexpanded\def\setupframed
{\dodoubleempty\dosetupframed}
\def\dosetupframed
@@ -766,24 +770,38 @@
%D Because it is used so often the he next macro is (and
%D looks) rather optimized.
+% \def\s!root{root} % maybe configurable
+
\let\postprocessframebox\relax
\let\@@framed\s!unknown
-\def\framedparameter #1{\csname\doframedparameter\@@framed#1\endcsname}
+% \def\framedparameter #1{\csname\doframedparameter\@@framed#1\endcsname}
+% \def\framedparameterhash#1{\doframedparameterhash \@@framed#1}
+%
+% \def\doframedparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doframedparentparameter \csname#1\s!parent\endcsname#2\fi}
+% \def\doframedparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\doframedparentparameterhash\csname#1\s!parent\endcsname#2\fi}
+%
+% \def\doframedparentparameter #1#2{\ifx#1\relax\s!empty\else\doframedparameter #1#2\fi}
+% \def\doframedparentparameterhash#1#2{\ifx#1\relax \else\doframedparameterhash#1#2\fi}
+%
+% \def\doframedparentparameter#1#2{\ifx#1\relax\doframedrootparameter#2\else\doframedparameter#1#2\fi}
+% \def\doframedrootparameter #1{\ifcsname\??oi#1\endcsname\??oi#1\else\s!empty\fi}
+
+\def\framedparameter #1{\csname\doframedparameter\@@framed{#1}\endcsname}
\def\framedparameterhash#1{\doframedparameterhash \@@framed#1}
-\def\doframedparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doframedparentparameter \csname#1\s!parent\endcsname#2\fi}
+\def\doframedparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doframedparentparameter \csname#1\s!parent\endcsname{#2}\fi}
\def\doframedparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\doframedparentparameterhash\csname#1\s!parent\endcsname#2\fi}
-\def\doframedparentparameter #1#2{\ifx#1\relax\s!empty\else\doframedparameter #1#2\fi}
+\def\doframedparentparameter #1#2{\ifx#1\relax\s!empty\else\doframedparameter #1{#2}\fi}
\def\doframedparentparameterhash#1#2{\ifx#1\relax \else\doframedparameterhash#1#2\fi}
-% \def\s!root{root} % maybe configurable
-
-\def\doframedparentparameter#1#2{\ifx#1\relax\doframedrootparameter#2\else\doframedparameter#1#2\fi}
+\def\doframedparentparameter#1#2{\ifx#1\relax\doframedrootparameter#2\else\doframedparameter#1{#2}\fi}
\def\doframedrootparameter #1{\ifcsname\??oi#1\endcsname\??oi#1\else\s!empty\fi}
+\def\frameddimension#1{\the\dimexpr\framedparameter{#1}\relax}
+
\def\dosetframedattributes#1#2% style color
{\edef\fontattributehash {\framedparameterhash#1}%
\edef\colorattributehash{\framedparameterhash#2}%
@@ -866,7 +884,7 @@
% todo: protect local \framednames
-\def\startlocalframed[#1][#2]%
+\unexpanded\def\startlocalframed[#1][#2]%
{\bgroup
\inframedtrue
\edef\@@framed{#1}%
@@ -884,7 +902,7 @@
\framedparameter\c!extras
% to get the right spacing
\edef\fontattributehash{\framedparameterhash\c!foregroundstyle}%
- \ifx\fontattributehash\empty\else\dosetfontattribute \fontattributehash\c!foregroundstyle\fi
+ \ifx\fontattributehash\empty\else\dosetfontattribute\fontattributehash\c!foregroundstyle\fi
% beware, both the frame and background offset can be overruled
%
\edef\doframedsetups{\framedparameter\c!setups}%
@@ -1088,6 +1106,7 @@
\fi
\edef\framedwidth {\ifdim\!!framedwidth >\zeropoint\the\!!framedwidth \else\!!zeropoint\fi}% a new feature, visible for user
\edef\framedheight{\ifdim\!!framedheight>\zeropoint\the\!!framedheight\else\!!zeropoint\fi}% a new feature, visible for user
+ \edef\framedoffset{\the\dimexpr\ifboxhasoffset\localoffset\else\zeropoint\fi}%
\@@startframedorientation
\afterassignment\dodowithframebox
\setbox\framebox\next}
@@ -1134,7 +1153,7 @@
%D ...,bottom=\kern0pt,...
%D \stoptyping
-\def\stoplocalframed
+\unexpanded\def\stoplocalframed
{\dontshowcomposition
\@@stopframedorientation % hm, wrong place ! should rotate the result (after reshape)
\handleframedlocator\c!before\@@locallocation
@@ -1441,14 +1460,16 @@
\def\doinlinemframed[#1]#2%
{\begingroup
\mframedstyle\mathstyle\relax
- \inframed[#1]{$\triggermathstyle\mframedstyle#2$}%
+ \inframed[#1]{\Ustartmath\triggermathstyle\mframedstyle#2\Ustopmath}%
\endgroup}
+\def\funnymathstrut{\Ustartmath\triggermathstyle\mframedstyle\vphantom{(}\Ustopmath}
+
\def\dodisplaymframed[#1]#2%
{\begingroup
\mframedstyle\mathstyle\relax
- \def\normalstrut{$\triggermathstyle\mframedstyle\vphantom{(}$}%
- \framed[#1]{$\triggermathstyle\mframedstyle#2$}%
+ \let\normalstrut\funnymathstrut
+ \framed[#1]{\Ustartmath\triggermathstyle\mframedstyle#2\Ustopmath}%
\endgroup}
\def\mframed {\dosingleempty\dodisplaymframed}
@@ -1862,9 +1883,9 @@
%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 {backgroundoffset=\the\dimexpr\framedparameter\c!backgroundoffset\relax\\
+%D frameoffset=\the\dimexpr\framedparameter\c!frameoffset\relax\\
+%D depth=\the\dimexpr\framedparameter\c!depth\relax}
%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=0pt,frameoffset=0pt]{\status}}
%D \vss
%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=0pt]{\status}}
@@ -2048,7 +2069,7 @@
%D
%D \showsetup{setupblackrules}
-\def\setupblackrules
+\unexpanded\def\setupblackrules
{\dodoubleargument\getparameters[\??bj]}
%D \macros
@@ -2185,7 +2206,7 @@
%D
%D \showsetup{setupmarginrules}
-\def\setupmarginrules
+\unexpanded\def\setupmarginrules
{\dodoubleargument\getparameters[\??ka]}
%D \macros
@@ -2267,13 +2288,13 @@
%D \showsetup{vl}
%D \showsetup{hl}
-\def\complexvl[#1]%
+\def\dovlwdhtdp#1#2#3%
{\bgroup
- \!!dimena#1\strutht
- \!!dimenb#1\strutdp
+ \!!dimena#2\strutht
+ \!!dimenb#3\strutdp
\setbox\scratchbox\hbox
{\vrule
- \!!width \linewidth
+ \!!width #1\linewidth
\!!height\!!dimena
\!!depth \!!dimenb}%
\dp\scratchbox\strutdp
@@ -2281,6 +2302,9 @@
\box\scratchbox
\egroup}
+\def\complexvl[#1]%
+ {\dovlwdhtdp{1}{#1}{#1}}
+
\def\complexhl[#1]%
{\hbox
{\vrule
@@ -2412,7 +2436,7 @@
\def\dosetupthinrules[#1]%
{\getparameters[\??dl][#1]}
-\def\setupthinrules
+\unexpanded\def\setupthinrules
{\dosingleargument\dosetupthinrules}
\def\dothinrules[#1]%
@@ -2633,11 +2657,11 @@
\c!orientation=,
\c!indenting=,
#2]%
- \setvalue{\e!start#1}{\dostartframedtext[#1]}%
- \setvalue{\e!stop #1}{\dostopframedtext }%
- \setvalue {#1}{\doframedtext [#1]}}
+ \setuvalue{\e!start#1}{\dostartframedtext[#1]}%
+ \setuvalue{\e!stop #1}{\dostopframedtext }%
+ \setuvalue {#1}{\doframedtext [#1]}}
-\def\defineframedtext
+\unexpanded\def\defineframedtext
{\dodoubleempty\dodefineframedtext}
%D We define the general (and original) case by just saying:
@@ -2648,7 +2672,7 @@
%D because we have to handle an optional identifier (and
%D because these commands evolved out of a single case).
-\def\framedtextparameter#1#2%
+\def\framedtextparameter#1#2% todo: currentframedtext
{\csname\??kd#1#2\endcsname}
\def\dosetupframedtexts[#1][#2]%
@@ -2659,7 +2683,7 @@
\getparameters[\??kd\v!framedtext][#1]%
\fi}
-\def\setupframedtexts
+\unexpanded\def\setupframedtexts
{\dodoubleempty\dosetupframedtexts}
\def\dostartframedtext
@@ -2806,12 +2830,12 @@
%D
%D \showsetup{defineframed}
-\def\defineframed
+\unexpanded\def\defineframed
{\dodoubleempty\dodefineframed}
\def\dodefineframed[#1][#2]%
{\iffirstargument
- \setvalue{#1}{\dodoubleempty\doframed[#2]}%
+ \setuvalue{#1}{\dodoubleempty\doframed[#2]}%
\fi}
\def\doframed[#1][#2]%
@@ -2865,7 +2889,7 @@
%D The implementation looks a bit complicated due to the
%D optional arguments.
-\def\setuptextrules
+\unexpanded\def\setuptextrules
{\dodoubleargument\getparameters[\??tl]}
\def\complextextrule[#1]% if needed we can make it installable
@@ -2888,15 +2912,13 @@
\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
+ \doifsomething{#1}
+ {\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}}}%
\color[\@@tlrulecolor]
{\leaders\hrule\!!height\dimen4\!!depth\dimen6\hfill}}%
\ht\scratchbox\strutht
@@ -2961,14 +2983,14 @@
%D The grouped commands also supports bodyfont switching:
-\def\starttextrule#1%
+\unexpanded\def\starttextrule#1%
{\bgroup
\def\dounknowntextrule{\domiddletextrule}
\dotoptextrule{#1}
\bgroup
\doifsomething\@@tlbodyfont{\switchtobodyfont[\@@tlbodyfont]}}
-\def\stoptextrule
+\unexpanded\def\stoptextrule
{\par
\egroup
\dobottomtextrule\empty
@@ -2997,7 +3019,7 @@
%D \showsetup{fillinrules}
%D \showsetup{setupfillinrules}
-\def\setupfillinrules
+\unexpanded\def\setupfillinrules
{\dodoubleargument\getparameters[\??il]}
\definecomplexorsimpleempty\fillinrules
@@ -3080,7 +3102,7 @@
%D \showsetup{fillinline}
%D \showsetup{setupfillinlines}
-\def\setupfillinlines
+\unexpanded\def\setupfillinlines
{\dodoubleargument\getparameters[\??iv]}
\definecomplexorsimpleempty\fillinline
@@ -3160,7 +3182,7 @@
\let\stopbackground \relax
\let\background \relax}}
-\def\setupbackground
+\unexpanded\def\setupbackground
{\dosingleargument\dosetupbackground}
%D Actually typesetting the background is implemented rather
@@ -3312,50 +3334,128 @@
%D
%D \typebuffer
-\def\defineframedcontent
+% \unexpanded\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]}
+%
+% \unexpanded\def\setupframedcontent
+% {\dodoubleempty\dosetupframedcontent}
+%
+% \def\dosetupframedcontent[#1][#2]%
+% {\def\docommand##1{\getparameters[\??fc##1][#2]}%
+% \processcommacommand[#1]\docommand}
+%
+% \unexpanded\def\startframedcontent[#1]%
+% {\bgroup
+% \doifelse{#1}\v!off
+% {\let\stopframedcontent\egroup}
+% {\ifcsname\??fc#1\c!frame\endcsname
+% \dostartframedcontent{#1}%
+% \fi}}
+%
+% \def\dostartframedcontent#1%
+% {\unexpanded\def\stopframedcontent{\dostopframedcontent{#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}
+
+\def\framedcontentparameter #1{\csname\doframedcontentparameter{\??fc\@@framedcontent}#1\endcsname}
+\def\doframedcontentparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doframedcontentparentparameter\csname#1\s!parent\endcsname#2\fi}
+\def\doframedcontentparentparameter#1#2{\ifx#1\relax\s!empty\else\doframedcontentparameter#1#2\fi}
+
+\presetlocalframed[\??fc]
+
+\getparameters
+ [\??fc]
+ [\c!leftoffset=\zeropoint,
+ \c!rightoffset=\framedcontentparameter\c!leftoffset,
+ \c!topoffset=\zeropoint,
+ \c!bottomoffset=\framedcontentparameter\c!topoffset,
+ \c!strut=\v!no,
+ %\c!linecorrection=\v!no,
+ %\c!left=,
+ %\c!right=,
+ %\c!width=\v!fit,
+ \c!offset=\v!overlay]
+
+\def\letframedcontentparameter#1%
+ {\letvalue{\??fc\@@framedcontent#1}}
+
+\unexpanded\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]}
+ {\getparameters[\??fc#1][\s!parent=\??fc,#2]}
-\let\setuplocalframed\getparameters
-
-\def\setupframedcontent
+\unexpanded\def\setupframedcontent
{\dodoubleempty\dosetupframedcontent}
\def\dosetupframedcontent[#1][#2]%
{\def\docommand##1{\getparameters[\??fc##1][#2]}%
\processcommacommand[#1]\docommand}
-\def\startframedcontent[#1]%
+\unexpanded\def\startframedcontent
+ {\dosingleempty\dostartframedcontent}
+
+\def\dostartframedcontent[#1]%
{\bgroup
- \doifelse{#1}\v!off
- {\let\stopframedcontent\egroup}
- {\ifcsname\??fc#1\c!frame\endcsname
- \dostartframedcontent{#1}%
- \fi}}
-
-\def\dostartframedcontent#1%
- {\def\stopframedcontent{\dostopframedcontent{#1}}%
+ \edef\@@framedcontent{#1}%
+ \let\stopframedcontent\egroup
+ \doifnot{#1}\v!off{\dodostartframedcontent{#1}}}
+
+\def\dodostartframedcontent#1%
+ {\unexpanded\def\stopframedcontent{\dostopframedcontent{#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}%
+ \advance\hsize\dimexpr-\framedcontentparameter\c!leftoffset-\framedcontentparameter\c!rightoffset \relax
+ \advance\vsize\dimexpr-\framedcontentparameter\c!topoffset -\framedcontentparameter\c!bottomoffset\relax
+ \hskip\framedcontentparameter\c!leftoffset
\vbox\bgroup
- \vskip\getvalue{\??fc#1\c!topoffset}%
+ \vskip\framedcontentparameter\c!topoffset
\vbox\bgroup
\forgetall
\blank[\v!disable]}
@@ -3363,22 +3463,22 @@
\def\dostopframedcontent#1%
{\removelastskip
\egroup
- \vskip\getvalue{\??fc#1\c!bottomoffset}%
+ \vskip\framedcontentparameter\c!bottomoffset
\egroup
- \hskip\getvalue{\??fc#1\c!rightoffset}%
+ \hskip\framedcontentparameter\c!rightoffset
\egroup
- \doifvalue{\??fc#1\c!width}\v!fit
- {\letvalue{\??fc#1\c!width}\v!fixed}% no shapebox
+ \doif{\framedcontentparameter\c!width}\v!fit
+ {\letframedcontentparameter\c!width\v!fixed}% no shapebox
\ifinsidefloat
\donefalse
\else
- \doifelsevalue{\??fc#1\c!linecorrection}\v!yes\donetrue\donefalse
+ \doifelse{\framedcontentparameter\c!linecorrection}\v!yes\donetrue\donefalse
\fi
% plaats ?
\ifdone\startlinecorrection\fi
- \getvalue{\??fc#1\c!left}% new
+ \framedcontentparameter\c!left % new
\localframed[\??fc#1]{\box\framebox}%
- \getvalue{\??fc#1\c!right}% new
+ \framedcontentparameter\c!right % new
\ifdone\stoplinecorrection\fi
\egroup}
@@ -3566,6 +3666,7 @@
\!!framedroffset\framedparameter\c!roffset
\!!framedtoffset\framedparameter\c!toffset
\!!framedboffset\framedparameter\c!boffset
+ \relax
\ifzeropt\!!framedloffset\else \advance\!!framedwidth -\!!framedloffset \boxhasextraoffsettrue \fi
\ifzeropt\!!framedroffset\else \advance\!!framedwidth -\!!framedroffset \boxhasextraoffsettrue \fi
\ifzeropt\!!framedtoffset\else \advance\!!framedheight-\!!framedtoffset \boxhasextraoffsettrue \fi
diff --git a/Master/texmf-dist/tex/context/base/page-app.mkiv b/Master/texmf-dist/tex/context/base/page-app.mkiv
index e5c149aa0c7..7dd71cf2ab8 100644
--- a/Master/texmf-dist/tex/context/base/page-app.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-app.mkiv
@@ -96,16 +96,16 @@
\presetlocalframed[\??tg]
-\def\setupTEXpage
+\unexpanded\def\setupTEXpage
{\dodoubleargument\getparameters[\??tg]}
-\def\startTEXpage
+\unexpanded\def\startTEXpage
{\dosingleempty\dostartTEXpage}
\def\dostartTEXpage[#1]%
{\dostartfittingpage[\??tg][#1]\gobblespacetokens}
-\def\stopTEXpage
+\unexpanded\def\stopTEXpage
{\removelastspace
\dostopfittingpage}
@@ -127,14 +127,14 @@
%D
%D maybe I should support stream=yes in framed.
-\def\startTEXstream
+\unexpanded\def\startTEXstream
{\dosingleempty\dostartTEXstream}
\def\dostartTEXstream[#1]%
{\page
\defineoutputstream[tex]%
\enableoutputstream[tex]%
- \def\stopTEXstream
+ \unexpanded\def\stopTEXstream
{\disableoutputstream
\startTEXpage
\outputstreamunvbox[tex]%
@@ -203,7 +203,7 @@
%D \starttext \pagefigure[two.1] \stoptext
%D \stoptyping
-\def\startpagefigure
+\unexpanded\def\startpagefigure
{\dodoubleempty\dostartpagefigure}
\def\dostartpagefigure[#1][#2]%
@@ -212,7 +212,7 @@
\startTEXpage[\c!offset=\@@exoffset]%
\externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic
-\def\stoppagefigure
+\unexpanded\def\stoppagefigure
{\stopTEXpage
\egroup}
diff --git a/Master/texmf-dist/tex/context/base/page-bck.mkiv b/Master/texmf-dist/tex/context/base/page-bck.mkiv
index fae091c6a01..93400943d50 100644
--- a/Master/texmf-dist/tex/context/base/page-bck.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-bck.mkiv
@@ -164,7 +164,7 @@
% \def\addsomebackground#1#2#3#4% area box width height / zero test added
% {\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint
% \ifcsname\??ma#1\c!setups\endcsname % to be done
-% \doifvaluesomething{\??ma#1\c!setups}{\setups[\csname\??ma#1\c!setups\endcsname]}% should not produce funny spaces !
+% \doprocesslocalsetups{\csname\??ma#1\c!setups\endcsname}% should not produce funny spaces !
% \fi
% \setbox#2\vbox\fastlocalframed % maybe \superfastlocalframed{tag}{w}{h}
% [\??ma#1]%
@@ -175,7 +175,7 @@
\def\addsomebackground#1#2#3#4% area box width height / zero test added
{\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint
\ifcsname\??ma#1\c!setups\endcsname % to be done
- \doifvaluesomething{\??ma#1\c!setups}{\setups[\csname\??ma#1\c!setups\endcsname]}% should not produce funny spaces !
+ \doprocesslocalsetups{\csname\??ma#1\c!setups\endcsname}% should not produce funny spaces !
\fi
\localbackgroundframed{#1}{#2}{#3}{#4}%
\fi\fi\fi}
@@ -375,7 +375,7 @@
\ifdim#2>\zeropoint\relax
\ifdim#1>\zeropoint\relax
\ifcsname\??ma#3#4\c!setups\endcsname % to be done
- \doifvaluesomething{\??ma#3#4\c!setups}{\setups[\csname\??ma#3#4\c!setups\endcsname]}% should not produce funny spaces !
+ \doprocesslocalsetups{\csname\??ma#3#4\c!setups\endcsname}% should not produce funny spaces !
\fi
\fastlocalframed
[\??ma#3#4]%
@@ -407,7 +407,7 @@
%D Because the number of arguments runs from one to three,
%D we need to check for it.
-\def\setupbackgrounds
+\unexpanded\def\setupbackgrounds
{\dotripleempty\dosetupbackgrounds}
\def\dosetupbackgrounds[#1][#2][#3]%
diff --git a/Master/texmf-dist/tex/context/base/page-flt.lua b/Master/texmf-dist/tex/context/base/page-flt.lua
new file mode 100644
index 00000000000..74d1e4e8c04
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/page-flt.lua
@@ -0,0 +1,227 @@
+if not modules then modules = { } end modules ['page-flt'] = {
+ version = 1.001,
+ comment = "companion to page-flt.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local setdimen, setbox, setcount, texbox = tex.setdimen, tex.setbox, tex.setcount, tex.box
+local insert, remove = table.insert, table.remove
+local texwrite, texsprint, ctxcatcodes = tex.write, tex.sprint, tex.ctxcatcodes
+
+local copy_node_list = node.copy_list
+
+local trace_floats = false trackers.register("graphics.floats", function(v) trace_floats = v end) -- name might change
+
+-- we use floatbox, floatwidth, floatheight
+-- text page leftpage rightpage (todo: top, bottom, margin, order)
+
+floats = floats or { }
+
+local noffloats, last, default, pushed = 0, nil, "text", { }
+
+local function initialize()
+ return {
+ text = { },
+ page = { },
+ leftpage = { },
+ rightpage = { },
+ }
+end
+
+local stacks = initialize()
+
+-- list location
+
+function floats.stacked(which) -- floats.thenofstacked
+ return #stacks[which or default]
+end
+
+function floats.thestacked(which)
+ return texwrite(#stacks[which or default])
+end
+
+function floats.push()
+ insert(pushed,stacks)
+ stacks = initialize()
+ setcount("global","savednoffloats",0)
+end
+
+function floats.pop()
+ local popped = remove(pushed)
+ if popped then
+ for which, stack in next, stacks do
+ for i=1,#stack do
+ insert(popped[which],stack[i])
+ end
+ end
+ stacks = popped
+ setcount("global","savednoffloats",#stacks[default])
+ end
+end
+
+local function setdimensions(b)
+ local w, h, d = 0, 0, 0
+ if b then
+ w, h, d = b.width, b.height, b.depth
+ end
+ setdimen("global","floatwidth", w)
+ setdimen("global","floatheight", h+d)
+ return w, h, d
+end
+
+local function get(stack,n)
+ n = n or #stack
+ if n > 0 then
+ local t = stack[n]
+ if t then
+ return t, t.box, n
+ end
+ end
+end
+
+function floats.save(which,data)
+ which = which or default
+ local stack = stacks[which]
+ noffloats = noffloats + 1
+ local b = texbox.floatbox
+ local w, h, d = b.width, b.height, b.depth
+ local t = {
+ n = noffloats,
+ data = data or { },
+ box = copy_node_list(b),
+ }
+ texbox.floatbox = nil
+ insert(stack,t)
+ setcount("global","savednoffloats",#stacks[default])
+ if trace_floats then
+ logs.report("floats","saving %s float %s in slot %s (%i,%i,%i)",which,noffloats,#stack,w,h,d)
+ else
+ interfaces.showmessage("floatblocks",2,noffloats)
+ end
+end
+
+function floats.resave(which)
+ if last then
+ which = which or default
+ local stack = stacks[which]
+ local b = texbox.floatbox
+ local w, h, d = b.width, b.height, b.depth
+ last.box = copy_node_list(b)
+ texbox.floatbox = nil
+ insert(stack,1,last)
+ setcount("global","savednoffloats",#stacks[default])
+ if trace_floats then
+ logs.report("floats","resaving %s float %s in slot %s (%i,%i,%i)",which,noffloats,#stack,w,h,d)
+ else
+ interfaces.showmessage("floatblocks",2,noffloats)
+ end
+ else
+ logs.report("floats","unable to resave float")
+ end
+end
+
+function floats.flush(which,n)
+ which = which or default
+ local stack = stacks[which]
+ local t, b, n = get(stack,n or 1)
+ if t then
+ local w, h, d = setdimensions(b)
+ if trace_floats then
+ logs.report("floats","flushing %s float %s from slot %s (%i,%i,%i)",which,t.n,n,w,h,d)
+ else
+ interfaces.showmessage("floatblocks",3,t.n)
+ end
+ texbox.floatbox = b
+ last = remove(stack,n)
+ last.box = nil
+ setcount("global","savednoffloats",#stacks[default])
+ else
+ setdimensions()
+ end
+end
+
+function floats.thevar(name,default)
+ local value = last and last.data[name] or default
+ if value and value ~= "" then
+ texsprint(ctxcatcodes,value)
+ end
+end
+
+function floats.consult(which,n)
+ which = which or default
+ local stack = stacks[which]
+ local t, b, n = get(stack,n)
+ if t then
+ local w, h, d = setdimensions(b)
+ if trace_floats then
+ logs.report("floats","consulting %s float %s in slot %s (%i,%i,%i)",which,t.n,n,w,h,d)
+ end
+ return t, b, n
+ else
+ if trace_floats then
+ logs.report("floats","nothing to consult")
+ end
+ setdimensions()
+ end
+end
+
+function floats.collect(which,maxwidth,distance)
+ which = which or default
+ local stack = stacks[which]
+ local n, m = #stack, 0
+ for i=1,n do
+ local t, b, n = get(stack,i)
+ if t then
+ local w, h, d = setdimensions(b)
+ if w + distance < maxwidth then
+ m = m + 1
+ maxwidth = maxwidth - w - distance
+ else
+ break
+ end
+ else
+ break
+ end
+ end
+ if m == 0 then
+ m = 1
+ end
+ setcount("global","nofcollectedfloats",m)
+end
+
+function commands.doifsavedfloatelse(which)
+ local stack = stacks[which or default]
+ commands.doifelse(#stack>0)
+end
+
+function floats.thecheckedpagefloat(packed)
+ local result = ""
+ if structure.pages.is_odd() then
+ if #stacks.rightpage > 0 then
+ result = "rightpage"
+ elseif #stacks.page > 0 then
+ result = "page"
+ elseif #stacks.leftpage > 0 then
+ if packed then
+ result = "leftpage"
+ else
+ result = "empty"
+ end
+ end
+ else
+ if #stacks.leftpage > 0 then
+ result = "leftpage"
+ elseif #stacks.page > 0 then
+ result = "page"
+ elseif #stacks.rightpage > 0 then
+ if packed then
+ result = "rightpage"
+ else
+ result = "empty"
+ end
+ end
+ end
+ texsprint(ctxcatcodes,result)
+end
diff --git a/Master/texmf-dist/tex/context/base/page-flt.mkiv b/Master/texmf-dist/tex/context/base/page-flt.mkiv
new file mode 100644
index 00000000000..944626b8e9c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/page-flt.mkiv
@@ -0,0 +1,233 @@
+%D \module
+%D [ file=page-flt,
+%D version=2010.04,08,
+%D title=\CONTEXT\ Page Macros,
+%D subtitle=Float Management,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Page Macros / Float Management}
+
+%D This module has code that previously was in other modules. There is
+%D also float related code in \type {strc-flt.mkiv}.
+
+\registerctxluafile{page-flt}{1.001}
+
+\unprotect
+
+%D To be checked and removed
+
+%def\dosavefloatinfo {\showmessage\m!floatblocks2{\the\totalnoffloats}}
+\def\doinsertfloatinfo {\showmessage\m!floatblocks4{\the\totalnoffloats}}
+\def\dofloatflushedinfo{\showmessage\m!floatblocks3{\the\numexpr\totalnoffloats-\savednoffloats\relax}}
+
+%D Extra float registers.
+
+\newif\ifsomefloatwaiting \somefloatwaitingfalse
+\newif\ifroomforfloat \roomforfloattrue
+\newif\ifnofloatpermitted \nofloatpermittedfalse
+\newif\ifcenterfloatbox \centerfloatboxtrue
+\newif\iflocalcenterfloatbox \localcenterfloatboxfalse
+\newif\ifglobalcenterfloatbox \globalcenterfloatboxfalse
+\newif\ifflushingfloats \flushingfloatsfalse
+\newif\ifpackflushedfloats \packflushedfloatstrue % for the moment
+\newif\ifpackcolumnfloats \packcolumnfloatstrue
+
+\newcount\totalnoffloats
+\newcount\savednoffloats
+\newcount\noffloatinserts
+\newcount\nofcollectedfloats % communication channel
+
+\newbox \floatlist
+\newbox \savedfloatlist
+\newbox \floattext
+
+\newdimen\floatwidth
+\newdimen\floatheight
+\newdimen\floatdepth
+\newdimen\floattextwidth
+\newdimen\floattextheight
+
+\newbox \floatbox
+\newbox \savedfloatbox
+
+%D From now on we manage the float stack at the \LUA\ end instead of packing
+%D them in a box and splitting off stacked floats. It's not so much less code
+%D but it's cleaner this way. It also opens op some posibilities as we can now
+%D more conveniently cary additional information around.
+
+\newtoks \everyfloatscheck
+
+\appendtoks
+ \ifcase\savednoffloats
+ \global\somefloatwaitingfalse
+ \else
+ \global\somefloatwaitingtrue
+ \fi
+\to \everyfloatscheck
+
+\def\dofloatsflush#1#2%
+ {\ctxlua{floats.flush("#1",\number#2)}%
+ \the\everyfloatscheck}
+
+\def\dofloatssave#1%
+ {\ctxlua{floats.save("#1")}%
+ \the\everyfloatscheck}
+
+\def\dofloatsresave#1%
+ {\ctxlua{floats.resave("#1")}%
+ \the\everyfloatscheck}
+
+\def\dopushsavedfloats
+ {\ctxlua{floats.push()}%
+ \the\everyfloatscheck}
+
+\def\dopopsavedfloats
+ {\ctxlua{floats.pop()}%
+ \the\everyfloatscheck}
+
+\def\dofloatsgetinfo#1%
+ {\ctxlua{floats.consult("#1")}}
+
+\def\doifsavedfloatelse#1%
+ {\ctxlua{commands.doifsavedfloatelse("#1")}}
+
+\def\dofloatscollect#1#2#3%
+ {\ctxlua{floats.collect("#1",\number\dimexpr#2,\number\dimexpr#3)}}
+
+\def\dofloatsnofstacked#1%
+ {\ctxlua{floats.thestacked("#1")}}
+
+\def\dofloatsgetvariable#1%
+ {\ctxlua{floats.thevar("specification")}}
+
+\let\dopushcolumnfloats\dopushsavedfloats
+\let\dopopcolumnfloats \dopopsavedfloats
+
+\def\dofloatssavepagefloat#1#2%
+ {\ctxlua{floats.save("#1", { specification = "#2" })}}
+
+%D The following code is in transition as we don't want to break the
+%D current single column, multi column, and columnset mechanism.
+%D
+%D First we reimplement some helpers.
+
+\def\dogetfloat
+ {\ifsomefloatwaiting
+ \dofloatsflush{text}{1}%
+ \ifcenterfloatbox
+ \ifdim\wd\globalscratchbox<\hsize
+ \global\setbox\floatbox\hbox to \hsize{\hss\box\floatbox\hss}%
+ \else
+ % retain special alignments
+ \ifinsidecolumns
+ \ifdim\wd\floatbox>\makeupwidth
+ \global\wd\floatbox\makeupwidth
+ \fi
+ \fi
+ \fi
+ \fi
+ \else
+ \global\savednoffloats\zerocount
+ \global\setbox\floatbox\emptybox
+ \fi}
+
+\def\dosavefloat
+ {\dofloatssave{text}%
+ \nonoindentation} % brrr nonoindentation here
+
+\def\doresavefloat
+ {\dofloatsresave{text}}
+
+\def\doreversesavefloat
+ {\dofloatsresave{text}}
+
+\def\doflushsavedfloats % simplified \OTRONEdodoflushfloats
+ {\doloop
+ {\ifsomefloatwaiting
+ \docheckiffloatfits
+ \ifroomforfloat
+ \dogetfloat
+ \doplacefloatbox
+ \else
+ \exitloop
+ \fi
+ \else
+ \exitloop
+ \fi}}
+
+%D Page floats use different stacks.
+
+\newtoks \everybeforeflushedpagefloat
+
+\def\doflushsomepagefloat#1% future releases can do more clever things
+ {\dofloatsflush{#1}{1}%
+ \edef\floatspecification{\dofloatsgetvariable{specification}}%
+ \the\everybeforeflushedpagefloat
+ \vbox to \textheight
+ {\doifnotinset\v!high\floatspecification\vfill
+ \box\floatbox
+ \doifnotinset\v!low\floatspecification\vfill}%
+ \vfill\eject}
+
+% \def\doflushpagefloats
+% {\doifoddpageelse
+% {\ifnum\dofloatsnofstacked{rightpage}>\zerocount
+% \doflushsomepagefloat{rightpage}%
+% \else\ifnum\dofloatsnofstacked{page}>\zerocount
+% \doflushsomepagefloat{page}
+% \else\ifnum\dofloatsnofstacked{leftpage}>\zerocount
+% \null\vfill\eject
+% %\doflushsomepagefloat{leftpage}%
+% \fi\fi\fi}
+% {\ifnum\dofloatsnofstacked{leftpage}>\zerocount
+% \doflushsomepagefloat{leftpage}%
+% \else\ifnum\dofloatsnofstacked{page}>\zerocount
+% \doflushsomepagefloat{page}
+% \else\ifnum\dofloatsnofstacked{rightpage}>\zerocount
+% \null\vfill\eject
+% %\doflushsomepagefloat{rightpage}%
+% \fi\fi\fi}}
+
+\def\doflushpagefloats
+ {\edef\checkedpagefloat{\ctxlua{floats.thecheckedpagefloat()}}% (true) for packed
+ \ifx\checkedpagefloat\empty
+ % nothing
+ \else\ifx\checkedpagefloat\v!empty
+ \null\vfill\eject
+ \else
+ \doflushsomepagefloat\checkedpagefloat
+ \fi\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}
+
+\ifdefined\doflushfloats\else \let\doflushfloats\relax \fi
+\ifdefined\flushfloatbox\else \let\flushfloatbox\relax \fi
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-flw.mkiv b/Master/texmf-dist/tex/context/base/page-flw.mkiv
index 3eb867a78f4..81b4fedcbfd 100644
--- a/Master/texmf-dist/tex/context/base/page-flw.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-flw.mkiv
@@ -18,7 +18,7 @@
\unprotect
-\def\definetextflow
+\unexpanded\def\definetextflow
{\dodoubleempty\dodefinetextflow}
\def\dodefinetextflow[#1][#2]% flow settings
@@ -47,7 +47,7 @@
\def\doiftextflow#1%
{\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument}
-\def\starttextflow[#1]%
+\unexpanded\def\starttextflow[#1]%
{\doiftextflowcollectorelse{#1}
{\global\setbox\textflowcollector{#1}\vbox
\bgroup
@@ -55,7 +55,7 @@
\hsize\textflowparameter{#1}\c!width
\doifsomething{\textflowparameter{#1}\c!style}%
{\doconvertfont{\textflowparameter{#1}\c!style}}%
- \def\stoptextflow{\endgraf\egroup}}
+ \unexpanded\def\stoptextflow{\endgraf\egroup}}
{\let\stoptextflow\relax}}
\def\flushtextflow#1%
diff --git a/Master/texmf-dist/tex/context/base/page-imp.mkiv b/Master/texmf-dist/tex/context/base/page-imp.mkiv
index fd0482585f3..a0f32ef8611 100644
--- a/Master/texmf-dist/tex/context/base/page-imp.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-imp.mkiv
@@ -108,7 +108,7 @@
\newtoks \collectedtextdata
-\long\def\starttextdata#1\stoptextdata
+\long\unexpanded\def\starttextdata#1\stoptextdata
{\doglobal\appendtoks#1\to\collectedtextdata}
\def\flushtextdata
@@ -248,7 +248,7 @@
\newconditional\arrangedbackgroundokay % more ifs -> conditionals
-\def\setuparranging[#1]%
+\unexpanded\def\setuparranging[#1]%
{\ifarrangingdisabled \else
\doifelse{#1}\v!disable
{\global\arrangingdisabledtrue}
@@ -387,6 +387,7 @@
\def\outputarrangedbox#1%
{\bgroup
+ \forgetall % somehow we're back and need to redo this
\gotonextarrangepage
\ifnum\arrangedrotationO\arrangedrotationE>\zerocount
\setbox#1\vbox
@@ -806,7 +807,7 @@
% #1=name #2=horizontal|vertical #3=shiftlist
-\def\definepageshift
+\unexpanded\def\definepageshift
{\dotripleargument\dodefinepageshift}
\def\dodefinepageshift[#1][#2][#3]%
@@ -847,7 +848,7 @@
\next
\fi}
-\def\setuppageshift
+\unexpanded\def\setuppageshift
{\dotripleempty\dosetuppageshift}
\def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical
@@ -1145,7 +1146,7 @@
%D \stoppagecomment
%D \stoptyping
-\def\setuppagecomment
+\unexpanded\def\setuppagecomment
{\dosingleempty\dosetuppagecomment}
\def\dosetuppagecomment[#1]%
@@ -1180,7 +1181,7 @@
\def\@@pcprintpapersize{\printpapersize}
-\def\placepagecommentTB
+\unexpanded\def\placepagecommentTB
{\vbox to \printpaperheight
{%\forgetall
\hsize\printpaperwidth
@@ -1198,7 +1199,7 @@
\doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}%
\vskip\@@pcoffset}}
-\def\placepagecommentLR
+\unexpanded\def\placepagecommentLR
{\hbox to \printpaperwidth
{\hskip\@@pcoffset
\doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss
diff --git a/Master/texmf-dist/tex/context/base/page-ini.mkii b/Master/texmf-dist/tex/context/base/page-ini.mkii
index 65bc27f538c..816b7d94497 100644
--- a/Master/texmf-dist/tex/context/base/page-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/page-ini.mkii
@@ -1,4 +1,4 @@
-%D \module
+ %D \module
%D [ file=page-ini,
%D version=2000.10.20,
%D title=\CONTEXT\ Page Macros,
diff --git a/Master/texmf-dist/tex/context/base/page-ini.mkiv b/Master/texmf-dist/tex/context/base/page-ini.mkiv
index 6beba4492c5..07d3422829c 100644
--- a/Master/texmf-dist/tex/context/base/page-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-ini.mkiv
@@ -128,7 +128,7 @@
\ifx\dosetuplayout\undefined % overloaded in page-lay !
- \def\setuplayout{\dodoubleempty\getparameters[\??ly]}
+ \unexpanded\def\setuplayout{\dodoubleempty\getparameters[\??ly]}
\fi
@@ -187,13 +187,13 @@
{\appendtoks\dowithotrcommand#1\to\registeredotrcommands}
\def\dopresetotrcommand#1%
- {\expandafter\let\expandafter#1\csname\@@OTR
- \ifcsname\@@OTR\OTRidentifier\expandafter\gobbleoneargument\string#1\endcsname
- \OTRidentifier
- \else\ifcsname\@@OTR\OTRdefault\expandafter\gobbleoneargument\string#1\endcsname % fallback
- \OTRdefault
- \fi\fi
- \expandafter\gobbleoneargument\string#1\endcsname}
+ {\expandafter\let\expandafter#1\csname\@@OTR
+ \ifcsname\@@OTR\OTRidentifier\expandafter\gobbleoneargument\string#1\endcsname
+ \OTRidentifier
+ \else\ifcsname\@@OTR\OTRdefault\expandafter\gobbleoneargument\string#1\endcsname % fallback
+ \OTRdefault
+ \fi\fi
+ \expandafter\gobbleoneargument\string#1\endcsname}
\def\activateotr#1#2%
{\def\OTRidentifier{#1}%
@@ -222,17 +222,20 @@
\registerotrcommand\doflushfloats % \def\doflushfloats {\OTRcommand\doflushfloats}
\registerotrcommand\flushfloatbox % \def\flushfloatbox {\OTRcommand\flushfloatbox}
\registerotrcommand\docheckiffloatfits % \def\docheckiffloatfits {\OTRcommand\docheckiffloatfits}
-\registerotrcommand\someherefloat % \def\someherefloat {\OTRcommand\someherefloat}
-\registerotrcommand\somefixdfloat % \def\somefixdfloat {\OTRcommand\somefixdfloat}
-\registerotrcommand\somepagefloat % \def\somepagefloat {\OTRcommand\somepagefloat}
-\registerotrcommand\sometopsfloat % \def\sometopsfloat {\OTRcommand\sometopsfloat}
-\registerotrcommand\somebotsfloat % \def\somebotsfloat {\OTRcommand\somebotsfloat}
-\registerotrcommand\somesidefloat % \def\somesidefloat {\OTRcommand\somesidefloat}
\registerotrcommand\flushsavedfloats % \def\flushsavedfloats {\OTRcommand\flushsavedfloats}
\registerotrcommand\synchronizehsize % \def\synchronizehsize {\OTRcommand\synchronizehsize}
\registerotrcommand\gotonextpage % \def\gotonextpage {\OTRcommand\gotonextpage }
\registerotrcommand\gotonextpageX % \def\gotonextpageX {\OTRcommand\gotonextpageX} % will become obsolete
+% wrong, will be redone
+%
+% \registerotrcommand\someherefloat % \def\someherefloat {\OTRcommand\someherefloat}
+% \registerotrcommand\somefixdfloat % \def\somefixdfloat {\OTRcommand\somefixdfloat}
+% \registerotrcommand\somepagefloat % \def\somepagefloat {\OTRcommand\somepagefloat}
+% \registerotrcommand\sometopsfloat % \def\sometopsfloat {\OTRcommand\sometopsfloat}
+% \registerotrcommand\somebotsfloat % \def\somebotsfloat {\OTRcommand\somebotsfloat}
+% \registerotrcommand\somesidefloat % \def\somesidefloat {\OTRcommand\somesidefloat}
+
% beter een \installotr#1 met #1 = macro en auto test
\newif \iftraceotr
@@ -243,7 +246,7 @@
% When issuing two \par\penalty-\plustenthousand's, only the first
% triggers the otr; obscure feature or optimization?
-\def\outputcounter{-100010} % -10010
+\newcount\outputcounter \outputcounter=-100010 % -10010
\def\doinvokeoutput
{\iftraceotr
@@ -252,35 +255,50 @@
\expandafter\dodoinvokeoutput
\fi}
-\def\outputmessage#1#2#3%
- {\iftraceotr\writestatus\m!otr{#1 #2 \number#3}\fi}
+\def\doshowoutputmessage#1#2#3%
+ {\writestatus\m!otr{#1 #2 \number#3}}
\def\dodoinvokeoutput#1%
- {\outputmessage+{special}{#1}%
- \bgroup\par\penalty#1\relax\egroup
- \outputmessage-{special}{#1}}
+ {\bgroup\par\penalty#1\egroup}
\def\dodotracedoutput#1%
- {\outputmessage+{traced}{#1/\the\outputpenalty}%
+ {\doshowoutputmessage+{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}}
+ \doshowoutputmessage-{traced}{#1/\the\outputpenalty}}
\def\installoutput#1#2% \invoke \action
- {\decrement\outputcounter
- \edef#1{\noexpand\doinvokeoutput{\outputcounter}}%
- \setvalue{\@@OTR\outputcounter}{#2}}
+ {\global\advance\outputcounter\minusone
+ \edef#1{\noexpand\doinvokeoutput{\number\outputcounter}}%
+ \setvalue{\@@OTR\number\outputcounter}{#2}}
+
+\def\invoketracedoutputroutine
+ {\doshowoutputmessage+{trying}\outputpenalty
+ \ifcsname\@@OTR\the\outputpenalty\endcsname
+ \doshowoutputmessage+{special}\outputpenalty
+ \csname\@@OTR\the\outputpenalty\endcsname
+ \doshowoutputmessage-{special}\outputpenalty
+ \else
+ \doshowoutputmessage+{normal}\outputpenalty
+ \the\OTRcommand\output
+ \doshowoutputmessage-{normal}\outputpenalty
+ \fi
+ \doshowoutputmessage-{trying}\outputpenalty}
-\def\invokeoutputroutine
- {\outputmessage+{trying}\outputpenalty
- \executeifdefined{\@@OTR\the\outputpenalty}\dodonormaloutput
- \outputmessage-{trying}\outputpenalty}
+\def\invokenormaloutputroutine
+ {\ifcsname\@@OTR\the\outputpenalty\endcsname
+ \csname\@@OTR\the\outputpenalty\endcsname
+ \else
+ \the\OTRcommand\output
+ \fi}
-\def\dodonormaloutput
- {\outputmessage+{normal}\outputpenalty
- \the\OTRcommand\output
- \outputmessage-{normal}\outputpenalty}
+\def\invokeoutputroutine
+ {\iftraceotr
+ \expandafter\invoketracedoutputroutine
+ \else
+ \expandafter\invokenormaloutputroutine
+ \fi}
\mainoutput{\invokeoutputroutine} \output{\inotrtrue\the\mainoutput}
@@ -425,8 +443,6 @@
\newif\ifbalancingcolumns
\newif\ifcollectingcontent
\newif\ifcolumnoverflow
-\newif\iffinalflushingfloats
-\newif\ifpackflushedfloats \packflushedfloatstrue % for the moment
\newdimen\intercolumnwidth
\newdimen\localcolumnwidth
@@ -505,8 +521,7 @@
% 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!
+ \setvsize} % this is needed for interacting components, like floats and multicolumns
\def\dofinaloutput#1#2% \vbox: prevents spurious spaces in every..pagebody
{\forgetall
@@ -521,7 +536,6 @@
{\forgetall
\beforefinaloutput
\the\everybeforeshipout
- \setpagecounters
\message{[-\the\realpageno]}%
\setbox\scratchbox\hbox{\dopagebody#1#2}%
\deadcycles\zerocount
@@ -549,12 +563,13 @@
\fi#1#2%
\resetselectiepagina
\incrementpagenumber
+ \incrementsubpagenumber
\checkpagedimensions
\ifnum\outputpenalty>\superpenalty \else
\dosupereject
\fi
\doflushspread
- \dopostponeblock}
+ \doflushpostponedcontent}
\def\dooutput
{\finaloutput\unvbox\normalpagebox}
@@ -571,7 +586,7 @@
\space#1:\space\ascii\space
\!!doneatrue}}
-\def\placeversioninfo % nog engels maken
+\unexpanded\def\placeversioninfo % nog engels maken
{\ifcase\conceptmode
% 0 : nothing
\or
@@ -704,7 +719,48 @@
\v!frame=>\chardef\gridboxlinemode \plusthree,
\v!nonumber=>\chardef\gridboxlinenomode\zerocount,
\v!right=>\chardef\gridboxlinenomode\plusone,
- \v!left=>\chardef\gridboxlinenomode\plustwo]}
+ \v!left=>\chardef\gridboxlinenomode\plustwo,
+ \v!outer=>\chardef\gridboxlinenomode\plusthree]%
+ \ifcase\showgridstate
+ \let\addtextgridlayer\gobbleoneargument
+ \else % 1=bottom 2=top
+ \let\addtextgridlayer\doaddtextgridlayer
+ \fi}
+
+\definepalet
+ [layout]
+ [grid=red,
+ page=green]
+
+% if really needed for speed we can cache the grid
+
+\let\addtextgridlayer\gobbleoneargument
+
+\def\doaddtextgridlayer#1% to be checked for color and layer
+ {\startcolor[layout:grid]%
+ \setgridbox\scratchbox\makeupwidth\textheight % todo: check color
+ \global\setbox#1\hbox
+ {\ifcase\showgridstate\or\or\box#1\hskip-\makeupwidth\fi
+ \bgroup % color
+ \ifcase\layoutcolumns\else
+ \gray
+ \setlayoutcomponentattribute\v!grid\v!columns
+ \hbox \layoutcomponentboxattribute to \makeupwidth
+ {\dorecurse\layoutcolumns
+ {\hskip\layoutcolumnwidth
+ \ifnum\recurselevel<\layoutcolumns
+ \vrule
+ \!!height\ht\scratchbox
+ \!!depth\dp\scratchbox
+ \!!width\layoutcolumndistance
+ \fi}}%
+ \hskip-\makeupwidth
+ \fi
+ \setlayoutcomponentattribute\v!grid\v!lines
+ \hbox \layoutcomponentboxattribute{\box\scratchbox}%
+ \egroup
+ \ifcase\showgridstate\or\hskip-\makeupwidth\box#1\fi}%
+ \stopcolor}
\def\buildpagebox#1%
{\setbox#1\vbox to \paperheight
@@ -840,10 +896,10 @@
{%\getallmarks % now in following token register
\the\everybeforepagebody
\starttextproperties
- \setnextsubpageno % nog eens: als in pagina (tbv standaard opmaak)
+% \setnextsubpageno % nog eens: als in pagina (tbv standaard opmaak)
\dontshowboxes % dan hier blokkeren en verderop resetten
-% \shipoutfacingpage
- \checkmargeblokken
+% \shipoutfacingpage
+ \checkmarginblocks
\the\beforeeverypage
\normalexpanded{\global\beforepage\emptytoks\the\beforepage}% \scratchtoks\beforepage\global\beforepage\emptytoks\the\scratchtoks % was \flushtoks\beforepage
\inpagebodytrue\buildpagebody#1#2%
@@ -1009,7 +1065,13 @@
\executepagebreakhandler\v!yes
\fi
\ifnum\prevrealpageno<\realpageno
- \global\chardef\pageornamentstate\zerocount
+ % there must have been a reason why i added the ifcase
+ % but it fails on tests/mkiv/pages/ornaments-001.tex
+ % as WS found out so we have to wait till the next side
+ % effect shows up
+ % \ifcase\pageornamentstate\or
+ \global\chardef\pageornamentstate\zerocount
+ % \fi
\fi
\egroup}
@@ -1182,14 +1244,12 @@
% \definepagebreak[instance][forsure]
% \definepagebreak[forsure][yes,+4]
-\def\definepagebreak
+\unexpanded\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]
@@ -1201,7 +1261,7 @@
\long\def\installcolumnbreakhandler#1#2#3% #1=otr-id #2=tag
{\long\setvalue{\??cn:#1:#2}{#3}}
-\def\definecolumnbreak
+\unexpanded\def\definecolumnbreak
{\dodoubleargument\dodefinecolumnbreak}
\def\dodefinecolumnbreak[#1][#2]% non recursive, meant for simple mappings
@@ -1402,10 +1462,10 @@
\newbox\facingpage
-\def\setupoppositeplacing
+\unexpanded\def\setupoppositeplacing
{\dodoubleargument\getparameters[\??np]}
-\def\startopposite
+\unexpanded\def\startopposite
{\dowithnextboxcontent
{\hsize\makeupwidth}%
{\global\setbox\facingpage\vbox
@@ -1418,7 +1478,7 @@
\box\nextbox}}%
\vbox\bgroup}
-\def\stopopposite
+\unexpanded\def\stopopposite
{\egroup}
\def\finishfacingpage
diff --git a/Master/texmf-dist/tex/context/base/page-lay.mkiv b/Master/texmf-dist/tex/context/base/page-lay.mkiv
index 18972c3502e..28f9be594dc 100644
--- a/Master/texmf-dist/tex/context/base/page-lay.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-lay.mkiv
@@ -202,10 +202,10 @@
%D
%D \showsetup{definepapersize}
-\def\definepapersize
+\unexpanded\def\definepapersize
{\dodoubleempty\dodefinepapersize}
-\def\definepapersize
+\unexpanded\def\definepapersize
{\dotripleempty\dodefinepapersize}
\def\dodefinepapersize[#1][#2][#3]%
@@ -275,7 +275,7 @@
\def\paperscale{1} \newif\ifnegateprintbox
-\def\setuppaper[#1]%
+\unexpanded\def\setuppaper[#1]%
{\getparameters[\??pp][\c!paper=,\c!page=,#1]%
\edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}%
\doifelsenothing\@@pppage
@@ -286,7 +286,7 @@
{\dodosetuppapersize[\@@pppage][\printpapersize]}
{\dodosetuppapersize[\@@pppage][\@@pppaper]}}}
-\def\setuppapersize
+\unexpanded\def\setuppapersize
{\dodoubleempty\dosetuppapersize}
\def\dosetuppapersize[#1][#2]%
@@ -424,7 +424,7 @@
% \def\checkforems[#1]%
% {\processcommalist[#1]\docheckforems}
-\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi
+\ifx\setups\undefined \unexpanded\def\setups[#1]{\setdefaultpenalties} \fi
% \newtoks \everybeforelayout \relax
% \newtoks \everyafterlayout \relax
@@ -434,6 +434,8 @@
{\expanded{\dododosetuppapersize[\layoutparameter\c!page][\layoutparameter\c!paper]}}%
\dorecalculatelayout}
+\ifdefined\docheckgridsnapping \else \let\docheckgridsnapping\relax \fi
+
\def\dorecalculatelayout
{%\the\everybeforelayout
\setups[\layoutparameter\c!preset]%
@@ -448,15 +450,11 @@
\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 !
+ \docheckgridsnapping
+ \doprocesslocalsetups{\layoutparameter\c!setups}% depends on gridsnapping !
\simplesetupwhitespace
\simplesetupblank
+ \setupinterlinespace[\v!reset]% \synchronizegloballinespecs
\global\cutspace\layoutparameter\c!cutspace
\relax
\doifelse{\layoutparameter\c!width}\v!middle
@@ -535,7 +533,6 @@
\calculatehsizes
\calculatevsizes
\calculatepseudocolumns
- \checkgridsnapping
\recalculatebackgrounds}
\def\calculatepseudocolumns
@@ -656,7 +653,7 @@
\v!doublesided=>\doublesidedprinttrue,
\v!singlesided=>\doublesidedprintfalse]}
-\def\definelayout
+\unexpanded\def\definelayout
{\dodoubleargument\dodefinelayout}
\def\dodefinelayout[#1][#2]%
@@ -685,7 +682,7 @@
\checkcurrentlayout % here ?
\presetcenterpagebox}
-\def\setuplayout
+\unexpanded\def\setuplayout
{\dodoubleempty\dosetuplayout}
\let\@@zaheight\!!zeropoint
@@ -718,7 +715,7 @@
\fi}
\def\adaptpagedimensionsindeed
- {\rawdoifinsetelse\realfolio\adaptedpages
+ {\rawdoifinset\realfolio\adaptedpages
{\removefromcommalist\realfolio\adaptedpages
\getvalue{\??za\realfolio}%
\letbeundefined{\??za\realfolio}}}
@@ -996,14 +993,12 @@
%D it is used in cross referencing. The next switch is set
%D when we start at an even page.
-\newif\ifshiftedrealpageno
-
-% We could use nested if here plu ssone \@EAEAEA's but but the
+% We could use nested if here plus some \@EAEAEA's but but the
% next variant has less expansion which is nicer in tracing.
-\def\doifoddpageelse {\ifshiftedrealpageno\expandafter\doifoddpageelseyes\else\expandafter\doifoddpageelsenop\fi}
-\def\doifoddpageelseyes{\ifodd\realpageno\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi}
-\def\doifoddpageelsenop{\ifodd\realpageno\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi}
+\def\doifoddpageelse {\ifodd\pagenoshift\expandafter\doifoddpageelseyes \else\expandafter\doifoddpageelsenop \fi}
+\def\doifoddpageelseyes{\ifodd\realpageno \expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments \fi}
+\def\doifoddpageelsenop{\ifodd\realpageno \expandafter\firstoftwoarguments \else\expandafter\secondoftwoarguments\fi}
\let\doifonevenpaginaelse\doifoddpageelse
@@ -1035,6 +1030,30 @@
\def\settexthoffset
{\texthoffset\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}}
+% The next hack is too tricky as we may shipout more pages:
+%
+% \def\freezepagestatechecks
+% {\the\everyfreezepagestatechecks}
+%
+% \newtoks \everyfreezepagestatechecks
+%
+% \appendtoks
+% \doifbothsides
+% {\let\doifbothsides\firstofthreearguments}%
+% {\let\doifbothsides\secondofthreearguments}%
+% {\let\doifbothsides\thirdofthreearguments}%
+% \rightorleftpageaction
+% {\let\rightorleftpageaction\firstoftwoarguments}%
+% {\let\rightorleftpageaction\secondoftwoarguments}%
+% \doifmarginswapelse
+% {\let\doifmarginswapelse\firstoftwoarguments}%
+% {\let\doifmarginswapelse\secondoftwoarguments}%
+% \to \everyfreezepagestatechecks
+%
+% \prependtoks
+% \freezepagestatechecks
+% \to \everybeforeshipout
+
\def\goleftonpage
{\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax}
@@ -1106,11 +1125,11 @@
%D {\definelayout}, so this hack will disappear in future
%D versions.
-\def\startlocallayout
+\unexpanded\def\startlocallayout
{\globalpushmacro\restorepapersize
\globalpushmacro\currentlayout}
-\def\stoplocallayout
+\unexpanded\def\stoplocallayout
{\globalpopmacro\currentlayout
\globalpopmacro\restorepapersize
\restorepapersize
@@ -1167,7 +1186,7 @@
\c!leftedgedistance=\layoutparameter\c!edgedistance,
\c!leftmargin=\layoutparameter\c!margin,
\c!leftmargindistance=\layoutparameter\c!margindistance,
- \c!width=.71428571429\paperwidth, % 15.0cm
+ \c!width=.71428571429\paperwidth, % 15.0cm \dimexpr\
\c!rightmargindistance=\layoutparameter\c!margindistance,
\c!rightmargin=\layoutparameter\c!margin,
\c!rightedgedistance=\layoutparameter\c!edgedistance,
diff --git a/Master/texmf-dist/tex/context/base/page-lin.lua b/Master/texmf-dist/tex/context/base/page-lin.lua
index 0efb6314e93..1f2c9625116 100644
--- a/Master/texmf-dist/tex/context/base/page-lin.lua
+++ b/Master/texmf-dist/tex/context/base/page-lin.lua
@@ -8,14 +8,19 @@ if not modules then modules = { } end modules ['page-lin'] = {
-- experimental
+local trace_numbers = false trackers.register("lines.numbers", function(v) trace_numbers = v end)
+
local format = string.format
-local texsprint, texbox = tex.sprint, tex.box
+local texsprint, texwrite, texbox = tex.sprint, tex.write, tex.box
local ctxcatcodes = tex.ctxcatcodes
+local variables = interfaces.variables
+
+nodes = nodes or { }
+nodes.lines = nodes.lines or { }
+nodes.lines.data = nodes.lines.data or { } -- start step tag
-nodes = nodes or { }
-nodes.lines = nodes.lines or { }
-nodes.lines.data = nodes.lines.data or { } -- start step tag
+storage.register("lines/data", nodes.lines.data, "nodes.lines.data")
-- if there is demand for it, we can support multiple numbering streams
-- and use more than one attibute
@@ -30,27 +35,34 @@ local current_list = { }
local cross_references = { }
local chunksize = 250 -- not used in boxed
-local has_attribute = node.has_attribute
-local traverse_id = node.traverse_id
-local traverse = node.traverse
-local copy_node = node.copy
+local has_attribute = node.has_attribute
+local traverse_id = node.traverse_id
+local traverse = node.traverse
+local copy_node = node.copy
+local hpack_node = node.hpack
+local insert_node_after = node.insert_after
+local insert_node_before = node.insert_before
+
+local whatsit = node.id("whatsit")
local data = nodes.lines.data
+local last = #data
nodes.lines.scratchbox = nodes.lines.scratchbox or 0
-- cross referencing
function nodes.lines.number(n)
+ n = tonumber(n)
local cr = cross_references[n] or 0
cross_references[n] = nil
return cr
end
-local function resolve(n,m)
+local function resolve(n,m) -- we can now check the 'line' flag (todo)
while n do
local id = n.id
- if id == whatsit then
+ if id == whatsit then -- why whatsit
local a = has_attribute(n,line_reference)
if a then
cross_references[a] = m
@@ -62,33 +74,88 @@ local function resolve(n,m)
end
end
--- boxed variant
+function nodes.lines.finalize(t)
+ local getnumber = nodes.lines.number
+ for _,p in next, t do
+ for _,r in next, p do
+ if r.metadata.kind == "line" then
+ local e = r.entries
+ local u = r.userdata
+ e.linenumber = getnumber(e.text or 0) -- we can nil e.text
+ e.conversion = u and u.conversion
+ r.userdata = nil -- hack
+ end
+ end
+ end
+end
+
+local filters = jobreferences.filters
+local helpers = structure.helpers
+
+jobreferences.registerfinalizer(nodes.lines.finalize)
+
+filters.line = filters.line or { }
+
+function filters.line.default(data)
+-- helpers.title(data.entries.linenumber or "?",data.metadata)
+ texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",data.entries.conversion or "numbers",data.entries.linenumber or "0"))
+end
+
+function filters.line.page(data,prefixspec,pagespec) -- redundant
+ helpers.prefixpage(data,prefixspec,pagespec)
+end
+
+function filters.line.linenumber(data) -- raw
+ texwrite(data.entries.linenumber or "0")
+end
+
+-- boxed variant, todo: use number mechanism
nodes.lines.boxed = { }
+-- todo: cache setups, and free id no longer used
+-- use interfaces.cachesetup(t)
+
function nodes.lines.boxed.register(configuration)
- data[#data+1] = configuration
- return #data
+ last = last + 1
+ data[last] = configuration
+ if trace_numbers then
+ logs.report("lines","registering setup %s",last)
+ end
+ return last
end
+
function nodes.lines.boxed.setup(n,configuration)
local d = data[n]
if d then
- for k,v in pairs(configuration) do d[k] = v end
+ if trace_numbers then
+ logs.report("lines","updating setup %s",n)
+ end
+ for k,v in next, configuration do
+ d[k] = v
+ end
else
+ if trace_numbers then
+ logs.report("lines","registering setup %s (br)",n)
+ end
data[n] = configuration
end
return n
end
-local leftskip = nodes.leftskip
+local the_left_margin = nodes.the_left_margin
-local function check_number(n,a) -- move inline
+local function check_number(n,a,skip) -- move inline
local d = data[a]
if d then
- local s = d.start
+ local s = d.start or 1
current_list[#current_list+1] = { n, s }
- if d.start % d.step == 0 then
- texsprint(ctxcatcodes, format("\\makenumber{%s}{%s}{%s}{%s}{%s}\\endgraf", d.tag or "", s, n.shift, n.width, leftskip(n.list)))
+ if not skip and s % d.step == 0 then
+ local tag = d.tag or ""
+ texsprint(ctxcatcodes, format("\\makenumber{%s}{%s}{%s}{%s}{%s}{%s}\\endgraf",tag,s,n.shift,n.width,the_left_margin(n.list),n.dir))
+ if trace_numbers then
+ logs.report("numbers","making number %s for setup %s: %s (%s)",#current_list,a,s,d.continue or "no")
+ end
else
texsprint(ctxcatcodes, "\\skipnumber\\endgraf")
end
@@ -101,24 +168,30 @@ function nodes.lines.boxed.stage_one(n)
local head = texbox[n]
if head then
local list = head.list
- --~ while list.id == vlist and not list.next do
- --~ list = list.list
- --~ end
+ local last_a, skip = nil, false
for n in traverse_id(hlist,list) do -- attr test here and quit as soon as zero found
if n.height == 0 and n.depth == 0 then
-- skip funny hlists
else
local a = has_attribute(n.list,line_number)
if a and a > 0 then
+ if last_a ~= a then
+ if data[a].method == variables.next then
+ skip = true
+ end
+ last_a = a
+ end
if has_attribute(n,display_math) then
if nodes.is_display_math(n) then
- check_number(n,a)
+ check_number(n,a,skip)
end
else
- if node.first_character(n.list) then
- check_number(n,a)
- end
+ -- the following test fails somehow (change in luatex?)
+ -- if node.first_character(n.list) then
+ check_number(n,a,skip)
+ -- end
end
+ skip = false
end
end
end
@@ -132,116 +205,11 @@ function nodes.lines.boxed.stage_two(n,m)
for l in traverse_id(hlist,texbox[m].list) do
t[#t+1] = copy_node(l)
end
- for j=1,#current_list do
- local l = current_list[j]
- local n, m = l[1], l[2]
- i = i + 1
- t[i].next = n.list
- n.list = t[i]
+ for i=1,#current_list do
+ local li = current_list[i]
+ local n, m, ti = li[1], li[2], t[i]
+ ti.next, n.list = n.list, ti
resolve(n,m)
end
end
end
-
--- flow variant
---
--- it's too hard to make this one robust, so for the moment it's not
--- available; todo: line refs
-
-if false then
-
- nodes.lines.flowed = { }
-
- function nodes.lines.flowed.prepare(tag)
- for i=1,#data do -- ??
- texsprint(ctxcatcodes,format("\\ctxlua{nodes.lines.flowed.prepare_a(%s)}\\ctxlua{nodes.lines.flowed.prepare_b(%s)}",i,i))
- end
- end
-
- function nodes.lines.flowed.prepare_a(i)
- local d = data[i]
- local p = d.present
- if p and p < chunksize then
- local b = nodes.lines.scratchbox
- texsprint(ctxcatcodes, format("{\\forgetall\\global\\setbox%s=\\vbox{\\unvbox%s\\relax\\offinterlineskip", b, b))
- while p < chunksize do
- texsprint(ctxcatcodes, format("\\mkmaketextlinenumber{%s}{%s}\\endgraf",d.start,1))
- p = p + 1
- d.start = d.start + d.step
- end
- d.present = p
- texsprint(ctxcatcodes, "}}")
- end
- end
-
- function nodes.lines.flowed.prepare_b(i)
- local d = data[i]
- local b = nodes.lines.scratchbox
- local l = texbox[b]
- if l then
- l = l.list
- local n = d.numbers
- while l do
- if l.id == hlist then
- local m = copy_node(l)
- m.next = nil
- if n then
- n.next = m
- else
- d.numbers = m
- end
- n = m
- end
- l = l.next
- end
- end
- tex.box[b] = nil
- end
-
- function nodes.lines.flowed.cleanup(i)
- if i then
- node.flush_list(data[i].numbers)
- else
- for i=1,#data do
- node.flush_list(data[i].numbers)
- end
- end
- end
-
- local function check_number(n,a)
- local d = data[a]
- if d then
- local m = d.numbers
- if m then
- d.numbers = m.next
- m.next = n.list
- n.list = m
- d.present = d.present - 1
- end
- end
- end
-
- function nodes.lines.flowed.apply(head)
- for n in node.traverse(head) do
- local id = n.id
- if id == hlist then
- if n.height == 0 and n.depth == 0 then
- -- skip funny hlists
- else
- local a = has_attribute(n,line_number)
- if a and a > 0 then
- if has_attribute(n,display_math) then
- if nodes.is_display_math(n) then
- check_number(n,a)
- end
- else
- check_number(n,a)
- end
- end
- end
- end
- end
- return head, true
- end
-
-end
diff --git a/Master/texmf-dist/tex/context/base/page-lin.mkiv b/Master/texmf-dist/tex/context/base/page-lin.mkiv
index c82d4d5206e..51f02763985 100644
--- a/Master/texmf-dist/tex/context/base/page-lin.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-lin.mkiv
@@ -17,15 +17,17 @@
\unprotect
+% todo: save settings
+
% low level interface
\registerctxluafile{page-lin}{1.001}
-\definesystemattribute[line-number]
-\definesystemattribute[line-reference]
+\definesystemattribute[line-number] \chardef\linenumberattribute \dogetattributeid{line-number}
+\definesystemattribute[line-reference] \chardef\linereferenceattribute \dogetattributeid{line-reference}
-\appendtoksonce\doresetattribute{line-number}\to\everyforgetall
-\appendtoksonce\dosetattribute{display-math}{1}\to\everybeforedisplayformula
+\appendtoksonce \attribute\linenumberattribute \attributeunsetvalue \to \everyforgetall
+\appendtoksonce \attribute\displaymathattribute\plusone \to \everybeforedisplayformula
\newcount\linenumber
\newbox \linenumberscratchbox
@@ -34,34 +36,17 @@
\newconditional\tracelinenumbering
-\def\mkaddtextlinenumbers#1#2#3% box col max
- {\bgroup
- \def\skipnumber{\hbox{}}%
- \ifcase#3\relax
- \let\makenumber\mkskiplinenumber
- \or
- \let\makenumber\mkleftlinenumber
- \else\ifcase#2\relax
- \let\makenumber\mkskiplinenumber
- \or
- \let\makenumber\mkleftlinenumber
- \else
- \let\makenumber\mkrightlinenumber
- \fi\fi
- \mkprocesstextlinenumbers{#1}%
- \egroup}
-
\def\mkprocesstextlinenumbers#1%
{\setbox\linenumberscratchbox\vbox{\forgetall\offinterlineskip\ctxlua{nodes.lines.boxed.stage_one(\number#1)}}%
\ctxlua{nodes.lines.boxed.stage_two(\number#1,\number\linenumberscratchbox)}}% can move to lua code
-% id nr shift width leftskip
+% id nr shift width leftskip dir
-\def\mkskiplinenumber #1#2#3#4#5{}
-\def\mkleftlinenumber #1#2#3#4#5{\hbox{\llap{#2\quad\hskip#3\scaledpoint}}}
-\def\mkrightlinenumber#1#2#3#4#5{\hbox{\rlap{\hskip#4\scaledpoint\hskip#3\scaledpoint\quad#2}}}
+% \def\mkskiplinenumber #1#2#3#4#6#5{}
+% \def\mkleftlinenumber #1#2#3#4#5#6{\hbox{\llap{#2\quad\hskip#3\scaledpoint}}}
+% \def\mkrightlinenumber#1#2#3#4#5#6{\hbox{\rlap{\hskip#4\scaledpoint\hskip#3\scaledpoint\quad#2}}}
-\def\makenumber#1#2{\hbox{\llap{#1\quad\hskip#2\scaledpoint}}\endgraf}%
+\let\makenumber\gobblesixarguments
\newconditional\boxcontentneedsprocessing
@@ -69,38 +54,54 @@
\def\mkdoprocessboxcontents #1{\mkaddtextlinenumbers{#1}\plusone \plusone}
\def\mkdoprocesscolumncontents#1{\mkaddtextlinenumbers{#1}\currentcolumn\nofcolumns}
-\def\mkcurrentstart{0}
-\def\mkcurrentstep {1}
+\def\mklinenumberparameters
+ {continue = "\linenumberparameter\c!continue",
+ start = \linenumberparameter\c!start,
+ step = \linenumberparameter\c!step,
+ method = "\linenumberparameter\c!method",
+ tag = "\currentlinenumbering"}
-\def\mkdefinetextlinenumbering#1%
- {\begingroup
- \scratchcounter\ctxlua{tex.sprint(nodes.lines.boxed.register({start=\mkcurrentstart,step=\mkcurrentstep,tag="#1"}))}%
- \setxvalue{ln:c:#1}{\number\scratchcounter}%
- \endgroup}
+\def\mklinenumberupdateparameters
+ {continue = "\linenumberparameter\c!continue"}
+
+\def\mkdefinetextlinenumbering
+ {\setxvalue{ln:c:\currentlinenumbering}{\number\ctxlua{tex.sprint(nodes.lines.boxed.register({\mklinenumberparameters}))}}}
-\def\mkstarttextlinenumbering#1#2%
+\def\mkupdatetextlinenumbering
+ {\ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:\currentlinenumbering},{\mklinenumberupdateparameters})}}
+
+\def\mkstarttextlinenumbering#1#2% always when assignment
{\globallet\mkprocesspagecontents \mkdoprocesspagecontents
\globallet\mkprocesscolumncontents\mkdoprocesscolumncontents
\global\settrue\boxcontentneedsprocessing % see core-rul.mkiv
+ \edef\currentlinenumbering{#1}%
\ifcase#2\relax
- % continue
+ \mkupdatetextlinenumbering % continue
\or
- \mkdefinetextlinenumbering{#1}% restart
+ \mkdefinetextlinenumbering % only when assignment
\fi
- \dosetattribute{line-number}{\getvalue{ln:c:#1}}}
+ \attribute\linenumberattribute\getvalue{ln:c:\currentlinenumbering}\relax}
-\def\mksetuptextlinenumbering#1%
- {\ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:#1},{start=\mkcurrentstart,step=\mkcurrentstep,tag="#1"})}}
+\def\mksetuptextlinenumbering
+ {\ifcsname ln:c:\currentlinenumbering\endcsname
+ \ctxlua{nodes.lines.boxed.setup(\getvalue{ln:c:\currentlinenumbering},{\mklinenumberparameters})}%
+ \fi}
\def\mkstoptextlinenumbering
- {\doresetattribute{line-number}}
+ {\attribute\linenumberattribute\attributeunsetvalue}
+
+% we could make this a bit more efficient by putting the end reference
+% in the same table as the start one but why make things complex ...
+
+\let\dofinishlinereference\dofinishfullreference
\def\mksomelinereference#1#2#3%
{\dontleavehmode\begingroup
\global\advance\linerefcounter\plusone
- \dosetattribute{line-reference}\linerefcounter
- % this will change and is troublesome anyway
- #3\textreference[#2]{\noexpand\ctxlua{tex.sprint(nodes.lines.number(\the\linerefcounter))}}%
+ \attribute\linereferenceattribute\linerefcounter
+ #3%
+ % for the moment we use a simple system i.e. no prefixes etc .. todo: store as number
+ \expanded{\dodosetreference{line}{#2}{conversion=\linenumberparameter\c!conversion}{\the\linerefcounter}}% kind labels userdata text
\endgroup}
\def\mkstartlinereference#1{\mksomelinereference{#1}{lr:b:#1}{}\ignorespaces}
@@ -117,7 +118,7 @@
\let\currentlinenumbering\empty
\chardef\linenumbermode = 1 % 0=continue, 1=restart
-\chardef\linenumberlocation = 1 % 0=middle, 1=left, 2=right, 3=inner, 4=outer, 5=text
+\chardef\linenumberlocation = 1 % 0=middle, 1=left, 2=right, 3=inner, 4=outer, 5=text, 6=begin, 7=end
\chardef\linenumberalignment = 5 % 0=middle, 1=left, 2=right, 5=auto
\newevery \beforeeverylinenumbering \relax
@@ -127,14 +128,14 @@
\newdimen\linenumberwidth
\newdimen\linenumberdistance
-\def\definelinenumbering
+\unexpanded\def\definelinenumbering
{\dosingleempty\dodefinelinenumbering}
\def\dodefinelinenumbering[#1]%
- {\def\currentlinenumbering{#1}%
- \mkdefinetextlinenumbering\currentlinenumbering}
+ {\edef\currentlinenumbering{#1}%
+ \mkdefinetextlinenumbering}
-\def\setuplinenumbering
+\unexpanded\def\setuplinenumbering
{\dodoubleempty\dosetuplinenumbering}
\def\dosetuplinenumbering[#1][#2]%
@@ -145,7 +146,7 @@
\let\currentlinenumbering\empty
\getparameters[\??rn][#1]%
\fi
- \mksetuptextlinenumbering\currentlinenumbering}
+ \mksetuptextlinenumbering}
\def\linenumberparameter#1%
{\csname\??rn\ifcsname\??rn\currentlinenumbering#1\endcsname\currentlinenumbering\fi#1\endcsname}
@@ -153,13 +154,12 @@
\def\linenumberattributes
{\doattributes{\??rn\ifcsname\??rn\currentlinenumbering\c!style\endcsname\currentlinenumbering\fi}}
-\definelinenumbering
-
\setuplinenumbering
[\c!conversion=\v!numbers,
\c!start=1,
\c!step=1,
- \c!continue=v!no,
+ \c!method=\v!first,
+ \c!continue=\v!no,
\c!location=\v!left,
\c!style=,
\c!color=,
@@ -170,15 +170,14 @@
\c!distance=\zeropoint,
\c!align=\v!auto]
-\def\startlinenumbering
+\definelinenumbering
+
+\unexpanded\def\startlinenumbering
{\dodoubleempty\dostartlinenumbering}
% no intermediate changes in values, define a class, otherwise each range
% would need a number
-\def\mkcurrentstart{\linenumberparameter\c!start}
-\def\mkcurrentstep {\linenumberparameter\c!step }
-
% todo: text
\expandafter\chardef\csname\??rn:l:\v!middle \endcsname \zerocount
@@ -191,6 +190,8 @@
\expandafter\chardef\csname\??rn:l:\v!inner \endcsname \plusthree
\expandafter\chardef\csname\??rn:l:\v!outer \endcsname \plusfour
\expandafter\chardef\csname\??rn:l:\v!text \endcsname \plusfive
+\expandafter\chardef\csname\??rn:l:\v!begin \endcsname \plussix
+\expandafter\chardef\csname\??rn:l:\v!end \endcsname \plusseven
\expandafter\chardef\csname\??rn:a:\v!middle \endcsname \zerocount
\expandafter\chardef\csname\??rn:a:\v!right \endcsname \plusone
@@ -204,32 +205,37 @@
\chardef\linenumbermode\plusone
\ifsecondargument
\def\currentlinenumbering{#1}%
- \doifnumberelse{#2}% downward compatible
- {\setvalue{\??rn#1\c!start}{#2}}%
- {\doif{#2}\v!continue{\chardef\linenumbermode\zerocount}}%
+ \doifassignmentelse{#2}
+ {\getparameters[\??rn\currentlinenumbering][#2]}
+ {\doifnumberelse{#2}% downward compatible
+ {\setvalue{\??rn#1\c!start}{#2}}%
+ {\doif{#2}\v!continue
+ {\getparameters[\??rn\currentlinenumbering][\c!continue=\v!yes]%
+ \chardef\linenumbermode\zerocount}}}%
\else\iffirstargument
\doifnumberelse{#1}% downward compatible
{\let\currentlinenumbering\empty
\setvalue{\??rn\c!start}{#1}}%
{\doifelse{#1}\v!continue
{\let\currentlinenumbering\empty
+ \getparameters[\??rn\currentlinenumbering][\c!continue=\v!yes]%
\chardef\linenumbermode\zerocount}
{\def\currentlinenumbering{#1}}}%
\fi\fi
- \doifelse{\linenumberparameter\c!continue}\v!yes
+ \doif{\linenumberparameter\c!continue}\v!yes
{\chardef\linenumbermode\zerocount}%
\numberinglinestrue
\the\beforeeverylinenumbering
\mkstarttextlinenumbering\currentlinenumbering\linenumbermode}
-\def\stoplinenumbering
+\unexpanded\def\stoplinenumbering
{\mkstoptextlinenumbering
\the\aftereverylinenumbering
\endgroup}
% number placement
-\let\mkskiplinenumber \gobblefivearguments
+\let\mkskiplinenumber \gobblesixarguments
\def\mkdoinnerlinenumber{\doifoddpageelse\mkdoleftlinenumber\mkdorightlinenumber}
\def\mkdoouterlinenumber{\doifoddpageelse\mkdorightlinenumber\mkdoleftlinenumber}
@@ -245,6 +251,12 @@
\expandafter\mkdoinnerlinenumber
\or
\expandafter\mkdoouterlinenumber
+ \or
+ \expandafter\mkdotextlinenumber
+ \or
+ \expandafter\mkdobeginlinenumber
+ \or
+ \expandafter\mkdoendlinenumber
\fi}
\def\mkrightlinenumber
@@ -258,32 +270,72 @@
\expandafter\mkdoouterlinenumber
\or
\expandafter\mkdoinnerlinenumber
+ \or
+ \expandafter\mkdotextlinenumber
+ \or
+ \expandafter\mkdoendlinenumber
+ \or
+ \expandafter\mkdobeginlinenumber
\fi}
\def\mkaddtextlinenumbers#1#2#3% box col max
{\bgroup
+ \chardef\linenumberbox #1\relax
+ \chardef\linenumbercolumn #2\relax
+ \chardef\linenumberlastcolumn#3\relax
+ \fullrestoreglobalbodyfont
\def\skipnumber{\hbox{}}%
- \ifcase#3\relax
- \let\makenumber\mkskiplinenumber
+ \let\makenumber\maketextlinenumber
+ \mkprocesstextlinenumbers\linenumberbox
+ \egroup}
+
+\def\maketextlinenumber#1%
+ {\edef\currentlinenumbering{#1}%
+ \chardef\linenumberlocation \executeifdefined{\??rn:l:\linenumberparameter\c!location}\plusone % left
+ \chardef\linenumberalignment\executeifdefined{\??rn:a:\linenumberparameter\c!align }\plusfive % auto
+ \ifcase\linenumberlastcolumn\relax
+ \let\domakenumber\mkskiplinenumber
\or
- \let\makenumber\mkleftlinenumber
- \else\ifcase#2\relax
- \let\makenumber\mkskiplinenumber
+ % one column
+ \ifcase\linenumberlocation
+ \let\domakenumber\mkskiplinenumber
+ % hm
+ \or
+ \let\domakenumber\mkleftlinenumber
+ \or
+ \let\domakenumber\mkrightlinenumber
+ \or % inner
+ \let\domakenumber\mkdoinnerlinenumber
+ \or % outer
+ \let\domakenumber\mkdoouterlinenumber
+ \or % text
+ \let\domakenumber\mkdotextlinenumber
+ \or
+ \let\domakenumber\mkdobeginlinenumber
+ \or
+ \let\domakenumber\mkdoendlinenumber
+ \fi
+ \else\ifcase\linenumbercolumn\relax
+ \let\domakenumber\mkskiplinenumber
\or
- \let\makenumber\mkdoleftlinenumber
+ \let\domakenumber\mkleftlinenumber
\ifcase\linenumberlocation\or
\chardef\linenumberlocation\plusone
\or
\chardef\linenumberlocation\plustwo
- \or
+ \else
\chardef\linenumberlocation\plusone
\or
\chardef\linenumberlocation\plusone
\or
\chardef\linenumberlocation\plusone
+ \or
+ \chardef\linenumberlocation\plusone % todo
+ \or
+ \chardef\linenumberlocation\plusone % todo
\fi
\else
- \let\makenumber\mkdorightlinenumber
+ \let\domakenumber\mkrightlinenumber
\ifcase\linenumberlocation\or
\chardef\linenumberlocation\plustwo
\or
@@ -292,21 +344,52 @@
\chardef\linenumberlocation\plustwo
\or
\chardef\linenumberlocation\plustwo
+ \or
+ \chardef\linenumberlocation\plustwo % todo
+ \or
+ \chardef\linenumberlocation\plustwo % todo
\fi
\fi\fi
- \mkprocesstextlinenumbers{#1}%
- \egroup}
+ \domakenumber{#1}}
-\def\mkdoleftlinenumber #1#2#3#4#5%
- {\hbox{\llap{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}}
-\def\mkdorightlinenumber#1#2#3#4#5%
- {\hbox{\rlap{\hskip#4\scaledpoint\hskip#3\scaledpoint\dosomelinenumber{#1}{1}{#2}{#5}}}}
+\def\mkdotextlinenumber #1#2#3#4#5#6% beware, one needs so compensate for this in the width !
+ {\hbox{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}
+
+\def\mkdotextlinenumber #1#2#3#4#5#6% beware, one needs so compensate for this in the width !
+ {\hbox{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}
+
+\def\mkdoleftlinenumber #1#2#3#4#5#6%
+ {\naturalhbox to \zeropoint
+ {\ifcase\istltdir#6\else \hskip-#4\scaledpoint \fi
+ \llap{\dosomelinenumber{#1}{2}{#2}{#5}\kern#3\scaledpoint}}}
+
+\def\mkdorightlinenumber#1#2#3#4#5#6%
+ {\naturalhbox to \zeropoint
+ {\ifcase\istltdir#6\else \hskip-#4\scaledpoint \fi
+ \rlap{\hskip#4\scaledpoint\hskip#3\scaledpoint\dosomelinenumber{#1}{1}{#2}{#5}}}}
+
+\def\mkdobeginlinenumber #1#2#3#4#5#6%
+ {\ifcase\istltdir#6\relax
+ \chardef\linenumberlocation\plusone
+ \expandafter\mkdoleftlinenumber
+ \else
+ \chardef\linenumberlocation\plustwo
+ \expandafter\mkdorightlinenumber
+ \fi{#1}{#2}{#3}{#4}{#5}{#6}}
+
+\def\mkdoendlinenumber#1#2#3#4#5#6%
+ {\ifcase\istltdir#6\relax
+ \chardef\linenumberlocation\plustwo
+ \expandafter\mkdorightlinenumber
+ \else
+ \chardef\linenumberlocation\plusone
+ \expandafter\mkdoleftlinenumber
+ \fi{#1}{#2}{#3}{#4}{#5}{#6}}
\def\dosomelinenumber#1#2#3#4% tag 1=left|2=right linenumber leftskip
{\begingroup
\def\currentlinenumbering{#1}%
- \chardef\linenumberlocation \executeifdefined{\??rn:l:\linenumberparameter\c!location}\plusone % left
- \chardef\linenumberalignment\executeifdefined{\??rn:a:\linenumberparameter\c!align }\plusfive % auto
+ \def\linenumber{#3}% unsafe
\doifelse{\linenumberparameter\c!width}\v!margin
{\linenumberwidth\leftmarginwidth}
{\linenumberwidth\linenumberparameter\c!width}%
@@ -365,8 +448,8 @@
% referencing
\def\someline [#1]{\mkstartlinereference{#1}\mkstoplinereference{#1}}
-\def\startline[#1]{\mkstartlinereference{#1}}
-\def\stopline [#1]{\mkstoplinereference {#1}}
+\unexpanded\def\startline[#1]{\mkstartlinereference{#1}}
+\unexpanded\def\stopline [#1]{\mkstoplinereference {#1}}
\def\mkshowstartlinereference#1%
{\ifconditional\tracelinenumbering
@@ -386,11 +469,14 @@
% eventually we will do this in lua
+\def\currentreferencelinenumber{\ctxlua{jobreferences.filter("linenumber")}}
+
\def\doifelsesamelinereference#1#2#3%
{\doifreferencefoundelse{lr:b:#1}
- {\let\fline\currenttextreference
+ {\edef\fline{\currentreferencelinenumber}%
\doifreferencefoundelse{lr:e:#1}
- {\let\tline\currenttextreference
+ {\edef\tline{\currentreferencelinenumber}%
+ %[\fline,\tline]
\ifx\fline\tline#2\else#3\fi}
{\unknownreference{#1}#2}}
{\unknownreference{#1}#2}}
@@ -404,35 +490,9 @@
{\in{#1}[lr:b:#2]}
{\in{#1}[lr:b:#2]--\in[lr:e:#2]}}}
-\protect \endinput
-
-\iffalse % \iftrue
-
- \appendtoks\ctxlua{nodes.lines.flowed.prepare()}\to\everyshipout
- \appendtoks\ctxlua{nodes.lines.flowed.cleanup()}\to\everybye
-
- \def\mkstarttextlinenumbering#1#2%
- {\ctxlua{nodes.lines.flowed.prepare("#1")}%
- \dosetattribute{line-number}{#2}}
+\def\inlinerange[#1]%
+ {\doifelsesamelinereference{#1}
+ {\in[lr:b:#1]}
+ {\in[lr:b:#1]--\in[lr:e:#1]}}
- \def\mkstoptextlinenumbering
- {\doresetattribute{line-number}}
-
- \def\mkmaketextlinenumber#1#2%
- {\hbox \bgroup
- \ifcase#2\relax
- %
- \or
- \llap{#1\quad\hskip#2\scaledpoint}%
- \else
- \rlap{\hskip\textwidth\quad#1\hskip#2\scaledpoint}%
- \fi
- \egroup}
-
- \ctxlua{
- nodes.lines.scratchbox = \number\linenumberscratchbox ;
- % callback.register('vpack_filter', nodes.lines.flowed.apply)
- callback.register('post_linebreak_filter', nodes.lines.flowed.apply)
- }
-
-\fi
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-mak.mkiv b/Master/texmf-dist/tex/context/base/page-mak.mkiv
index 45a1f11674c..fd89a45ff77 100644
--- a/Master/texmf-dist/tex/context/base/page-mak.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-mak.mkiv
@@ -34,7 +34,7 @@
%D \showsetup{setupmakeup}
%D \showsetup{startmakeup}
-\def\definemakeup
+\unexpanded\def\definemakeup
{\dodoubleargument\dodefinemakeup}
\def\dodefinemakeup[#1][#2]%
@@ -64,7 +64,7 @@
\setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}%
\setvalue{\e!stop #1\e!makeup}{\stopmakeup}}
-\def\setupmakeup
+\unexpanded\def\setupmakeup
{\dodoubleargument\dosetupmakeup}
\def\dosetupmakeup[#1]%
@@ -84,7 +84,7 @@
\let\currentmakeup\empty
-\def\startmakeup
+\unexpanded\def\startmakeup
{\dodoubleempty\dostartmakeup}
\def\dostartmakeup[#1][#2]%
@@ -126,11 +126,11 @@
\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
- \setups[\makeupparameter\c!setups]%
+ \doifsomething{\makeupparameter\c!color}{\startcolor[\makeupparameter\c!color]}% can be made faster
+ \doprocesslocalsetups{\makeupparameter\c!setups}%
\hsize\makeupparameter\c!width
\doifsomething{\makeupparameter\c!align}
{\setupalign[\makeupparameter\c!align]}%
@@ -139,9 +139,9 @@
\def\dodostopmakeup
{\endgraf
\makeupparameter\c!bottom
+ \doifsomething{\makeupparameter\c!color}{\stopcolor}%
\egroup
\flushmarks % new, here, else empty pages
- \stopregistercolor
\doflushmakeup
\egroup
\calculatehsizes
@@ -198,7 +198,7 @@
%D by setting their associated status variables. The
%D connection between them is made by the following macro
-\def\setupmakeuplayout
+\unexpanded\def\setupmakeuplayout
{\setupfooter[\c!state=\makeupparameter\c!footerstate]%
\setupheader[\c!state=\makeupparameter\c!headerstate]%
\setuptext [\c!state=\makeupparameter\c!textstate]%
diff --git a/Master/texmf-dist/tex/context/base/page-mar.mkiv b/Master/texmf-dist/tex/context/base/page-mar.mkiv
index b85a99aa618..464b4f9bb09 100644
--- a/Master/texmf-dist/tex/context/base/page-mar.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-mar.mkiv
@@ -46,7 +46,7 @@
%D therefore embed them in some macro's that (force and)
%D remove the indentation and restore it afterwards.
-\def\definemarginline
+\unexpanded\def\definemarginline
{\dodoubleargument\dodefinemarginline}
\def\dodefinemarginline[#1][#2]%
@@ -58,7 +58,7 @@
\c!hoffset=\leftmargindistance,
\c!command=,
#2]%
- \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}}
+ \setuvalue{#1}{\dohandlemarginline{#1}}}
\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname}
\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}}
@@ -120,9 +120,6 @@
\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}}}
@@ -196,7 +193,7 @@
\newcount\margincontentlevel
\newdimen\margincontentheight
-\def\setupinmargin
+\unexpanded\def\setupinmargin
{\dodoubleempty\dosetupinmargin}
\def\dosetupinmargin[#1][#2]%
@@ -439,7 +436,7 @@
\makemargintextblock\v!right\v!left{#2}%
\rlap{\placemargincontentseparator}}}
-\def\placemargincontentseparator
+\unexpanded\def\placemargincontentseparator
{\ifnum\margincontentlevel>\zerocount
\ifx\margincontentseparator\empty\else
\bgroup
@@ -502,7 +499,7 @@
{\dodoinmargin[#1][#2][#3][#4][#5]}
{\dodoinmargin[#1][#2][#3][][#4]}}
-\def\defineinmargin
+\unexpanded\def\defineinmargin
{\doquadrupleempty\dodefineinmargin}
\def\dodefineinmargin[#1][#2][#3][#4]%
@@ -764,7 +761,7 @@
\global\chardef\margintextcollected\zerocount
\global\collectedmargintexts\emptytoks}
-\def\placemargincontent
+\unexpanded\def\placemargincontent
{\ifcase\margintextcollected\else % was level check
\bgroup
\redoconvertfont % !!
@@ -775,7 +772,7 @@
% For old times sake (i use it in project styles) we provide
-\def\placemargintexts {\placemargincontent}
+\unexpanded\def\placemargintexts {\placemargincontent}
\def\resetmargetitels {\resetmargincontent}
\def\margewoordpositie{\margewoord} % obsolete, now no longer range
diff --git a/Master/texmf-dist/tex/context/base/page-mis.mkiv b/Master/texmf-dist/tex/context/base/page-mis.mkiv
index a620835e470..f7c3d529d1a 100644
--- a/Master/texmf-dist/tex/context/base/page-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-mis.mkiv
@@ -15,24 +15,24 @@
\unprotect
-\newif\ifmargeblokken
+\newif\ifmarginblocks
\def\dosetupmarginblocks[#1]%
{\getparameters[\??mb][#1]%
\doifelse\@@mbstate\v!start
{\showmessage\m!layouts4\empty
- \margeblokkentrue
+ \marginblockstrue
\let\somenextfloat\dosomenextfloat
\let\startmarginblock\dostartmarginblock
\let\stopmarginblock\dostopmarginblock}%
{\showmessage\m!layouts5\empty
- \margeblokkenfalse
+ \marginblocksfalse
\def\somenextfloat[##1]%
{\someelsefloat[##1,\v!here]}%
\let\startmarginblock\dontstartmargeblok
\let\stopmarginblock\dontstopmargeblok}}
-\def\setupmarginblocks
+\unexpanded\def\setupmarginblocks
{\dosingleargument\dosetupmarginblocks}
\newbox\marginbox
@@ -43,11 +43,11 @@
\unvcopy\marginbox
\ifvoid\marginbox\else\expandafter\@@mbinbetween\fi
\box\floatbox\filbreak}%
- \ifdim\ht\marginbox>\textheight
- \dosavefloatinfo
- \else
- \doinsertfloatinfo
- \fi}
+ \ifdim\ht\marginbox>\textheight
+ % \dosavefloatinfo
+ \else
+ \doinsertfloatinfo
+ \fi}
\newbox\preparedmarginbox
@@ -64,16 +64,16 @@
\@@mbbottom}%
\fi}
-\def\plaatsrechtermargeblok
+\unexpanded\def\placerightmarginblock
{\hskip\rightmarginwidth}
-\def\plaatslinkermargeblok
+\unexpanded\def\placeleftmarginblock
{\hskip\leftmarginwidth}
-\def\checkmargeblokken
- {\ifvoid\marginbox\else\docheckmargeblokken\fi}
+\def\checkmarginblocks
+ {\ifvoid\marginbox\else\docheckmarginblocks\fi}
-\def\docheckmargeblokken % erg inefficient
+\def\docheckmarginblocks % erg inefficient
{\setbox\preparedmarginbox\vbox
{\forgetall
\splittopskip\topskip
@@ -88,13 +88,13 @@
\setbox\preparedmarginbox\vbox
{\@@mbbefore\box\preparedmarginbox\@@mbafter}%
\def\rightmarginbox
- {\def\plaatsrechtermargeblok
+ {\unexpanded\def\placerightmarginblock
{\setbox\preparedmarginbox\hbox to \rightmarginwidth
{\@@mbleft\box\preparedmarginbox\@@mbright}%
\vsmashbox\preparedmarginbox
\box\preparedmarginbox}}%
\def\leftmarginbox
- {\def\plaatslinkermargeblok
+ {\unexpanded\def\placeleftmarginblock
{\setbox\preparedmarginbox\hbox to \leftmarginwidth
{\@@mbright\box\preparedmarginbox\@@mbleft}%
\vsmashbox\preparedmarginbox
@@ -134,7 +134,7 @@
\egroup
\@@mbafter}
-\newcounter\nofpostponedblocks
+\newcount\nofpostponedblocks
\newif\ifinpostponing
@@ -159,66 +159,39 @@
%
% \starttext \dorecurse{4}{\input tufte \page} \stoptext
-\newtoks \postponedpageblocks
-\newcounter\nofpostponedpageblocks
+\newtoks \postponedpageblocks
+\newcount \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}
+\def\dodoflushpostponedblocks
+ {\bgroup % we need the font switch, else problems inside split verbatim
+ \setnormalcatcodes % postponing in verbatim
+ \restoreglobalbodyfont
+ \global\pagetotal\zeropoint
+ \global\inpostponingtrue
+ \the\postponedpageblocks
+ \dorecurse\nofpostponedblocks
+ {\getbuffer[pbuf-\recurselevel]}%
+ \doflushfloats % new but potential dangerous
+ \global\nofpostponedblocks\zerocount
+ \global\inpostponingfalse
+ \egroup}
-% \let\flushrestfloats\relax
+\def\doflushpostponedblocks
+ {\ifinpostponing \else
+ \ifcase\nofpostponedblocks \else \dodoflushpostponedblocks \fi
+ \ifcase\nofpostponedpageblocks \else \dodoflushpostponedblocks \fi
+ \fi}
-\def\dopostponeblock
- {\bgroup % new may 2004
- \setsystemmode\v!postponing % new may 2004
+\def\doflushpostponedcontent
+ {\bgroup
+ \setsystemmode\v!postponing
\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
- \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
- \egroup
- \fi
- \egroup} % new may 2004
+ \doflushpagefloats
+ \doflushpostponedblocks
+ \egroup}
\def\getpostponedblock#1#2%
{\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi
@@ -231,20 +204,20 @@
\doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}}
\def\nodostartpostponing[#1]%
- {\doglobal\increment\nofpostponedpageblocks
+ {\global\advance\nofpostponedpageblocks\plusone % hm, never reset?
\bgroup % a little bit of misusing grouping
\doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient
\doglobal\appendetoks\noexpand\getpostponedblock
- {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks
+ {\realfolio}{\number\nofpostponedpageblocks}\to\postponedpageblocks
\egroup
- \showmessage\m!layouts3\nofpostponedpageblocks
- \dostartbuffer[rbuf-\nofpostponedpageblocks]%
+ \showmessage\m!layouts3{\number\nofpostponedpageblocks}%
+ \dostartbuffer[rbuf-\number\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]}}
+ {\global\advance\nofpostponedblocks\plusone
+ \showmessage\m!layouts3{\number\nofpostponedblocks}%
+ \expanded{\dostartbuffer[pbuf-\number\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}}
% Setups:
diff --git a/Master/texmf-dist/tex/context/base/page-mul.mkiv b/Master/texmf-dist/tex/context/base/page-mul.mkiv
index 789cfbe439c..88ec7a5e7be 100644
--- a/Master/texmf-dist/tex/context/base/page-mul.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-mul.mkiv
@@ -424,18 +424,7 @@
%\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
+ \dopushcolumnfloats
\dimen0\dimexpr\pagetotal+\parskip+\openlineheight\relax
\ifdim\dimen0<\pagegoal
\allowbreak
@@ -525,7 +514,7 @@
\synchronizeoutput % new may 2004 / we need to: \pagegoal\vsize
\checkendcolumnfootnotes
\dosomebreak\allowbreak
- \restoresavedfloats}
+ \dopopcolumnfloats}
%D Because some initializations happen three times, we
%D defined a macro for them. Erasing \type{\everypar} is
@@ -602,7 +591,7 @@
\setfalse\someprecolumncontent % will be set elsewhere
\else
\settrue\someprecolumncontent
-\mkprocessboxcontents\precolumnbox
+ \mkprocessboxcontents\precolumnbox
\fi
\forgetall
\setmulticolumnsout
@@ -920,6 +909,7 @@
{\lower\scratchdimen\vbox{\placenoteinserts}}%
\ht0=\openstrutheight % \strutht
\dp0=\openstrutdepth % \strutdp
+ \wd0=\zeropoint
\scratchdimen\ht\firstcolumnbox
\global\setbox\firstcolumnbox\vbox to \scratchdimen
{\box\firstcolumnbox
@@ -937,11 +927,12 @@
{\lower\scratchdimen\vbox{\placenoteinserts}}%
\ht0=\openstrutheight % \strutht
\dp0=\openstrutdepth % \strutdp
+ \wd0=\zeropoint
\scratchdimen\ht\lastcolumnbox
\global\setbox\lastcolumnbox\vbox to \scratchdimen
{\box\lastcolumnbox
\vskip-\scratchdimen
- box0}%
+ \box0}%
\fi
\egroup
\fi
@@ -1226,30 +1217,51 @@
%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
+\def\dopushcolumnfloats
+ {\ifsomefloatwaiting
+ \showmessage\m!columns6{\the\savednoffloats}%
+ \global\setbox\savedfloatlist\box\floatlist
+ \xdef\dopopcolumnfloats
+ {\global\savednoffloats\the\savednoffloats
+ \global\setbox\floatlist\box\savedfloatlist
+ \global\noexpand\somefloatwaitingtrue}%
+ \global\savednoffloats\zerocount
+ \global\somefloatwaitingfalse
\else
- \setlocalcolumnfloats
+ \global\let\dopopcolumnfloats\relax
\fi}
-\def\setglobalcolumnfloats
- {\everypar\emptytoks
- \let\flushcolumnfloat\relax
- %\let\doroomfloat\relax
- \let\docheckiffloatfits\relax
- \let\flushcolumnfloats\noflushcolumnfloats}
+\let\dopopcolumnfloats\relax
+
+% \def\setcolumnfloats % messy as it adapts everypar
+% {\xdef\globalsavednoffloats{\the\savednoffloats}%
+% \ifnum\globalsavednoffloats>\zerocount
+% \setglobalcolumnfloats % hm, we always push so this never happens
+% \else
+% \setlocalcolumnfloats
+% \fi}
+
+\def\setcolumnfloats % messy as it adapts everypar, we need to adapt this
+ {\setlocalcolumnfloats}
+
+\newconditional\onlylocalcolumnfloats % temp hack as we will redo floats (grid snapping is also messy now)
+
+\def\OTRMULdocheckiffloatfits{\ifconditional\onlylocalcolumnfloats\docolumnroomfloat \else\relax \fi}
+\def\OTRMULdosetbothinserts {\ifconditional\onlylocalcolumnfloats\relax \else\OTRONEdosetbothinserts\fi}
+\def\OTRMULdotopinsertions {\ifconditional\onlylocalcolumnfloats\relax \else\OTRONEdotopinsertions \fi}
+\def\OTRMULdoflushfloats {\ifconditional\onlylocalcolumnfloats\doflushcolumnfloats\else\OTRONEdoflushfloats \fi}
\def\setlocalcolumnfloats
- {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}%
+ {\settrue\onlylocalcolumnfloats
+ \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}
+ \let\flushcolumnfloats\doflushcolumnfloats}
+
+\def\setglobalcolumnfloats
+ {\setfalse\onlylocalcolumnfloats
+ \everypar\emptytoks
+ \let\flushcolumnfloat\relax
+ \let\flushcolumnfloats\noflushcolumnfloats}
\def\noflushcolumnfloats
{\bgroup
@@ -1314,24 +1326,17 @@
\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
+ \dofloatsgetinfo{text}%
\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
+ \snaptogrid\vbox{\vskip\floatheight}}% copy?
+ \advance\dimen0\dimexpr\ht\scratchbox+2\openlineheight+.5\lineheight\relax\relax % needed because goal a bit higher
\ifdim\dimen0>\dimen2
\global\roomforfloatfalse
\else
\global\roomforfloattrue
\fi
- \ifdim\wd\floatbox>\hsize
+ \ifdim\floatwidth>\hsize
\showmessage\m!columns{11}\empty
\global\roomforfloatfalse
\fi
@@ -1351,40 +1356,33 @@
\let\doflushcolumnfloat\relax
\getcolumnstatus\column\mofcolumns\total\dimen0\goal\dimen2\\%
\ifdim\dimen0>\zeropoint
- \dogetfloat
- \ifdim\wd\floatbox>\hsize
- \doresavefloat
+ \dofloatsgetinfo{text}%
+ \ifdim\floatwidth>\hsize
+ % dropped ?
\else
- %\setbox2=\vbox
- % {\blank[\@@bkspacebefore]
- % \snaptogrid\vbox{\copy\floatbox}%
- % \blank[\@@bkspaceafter]
- \setbox2=\vbox
+ \setbox2\vbox
{\blank[\@@bkspacebefore]
- \snaptogrid\vbox{\copy\floatbox}}%
+ \snaptogrid\vbox{\vskip\floatheight}}%
\advance\dimen0 \ht2
\ifdim\dimen0>\dimen2
\ifnum\mofcolumns<\nofcolumns
\advance\mofcolumns \plusone
-%% bug %% \edef\currenttopcolumnbox{\getvalue{\@@topcol\the\count255}}%
\ifdim\ht\currenttopcolumnbox=\zeropoint
+ \dofloatsflush{text}{1}%
\global\setbox\currenttopcolumnbox\vbox
- {\snaptogrid\vbox{\copy\floatbox}
+ {\snaptogrid\vbox{\box\floatbox}
\whitespace % nodig ?
\blank[\@@bkspaceafter]}%
- \dimen4=\ht\currenttopcolumnbox
- \advance\dimen4 \dp\currenttopcolumnbox
+ \dimen4=\htdp\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
@@ -1394,6 +1392,7 @@
\blank[\@@bkspacebefore]
\nobreak
\fi
+ \dofloatsflush{text}{1}%
\flushfloatbox
\blank[\@@bkspaceafter]
\fi
@@ -1416,6 +1415,7 @@
%D When handling lots of (small) floats spacing can get worse
%D because of lining out the columns.
+
\def\doflushcolumnfloats
{\ifpostponecolumnfloats\else
\bgroup
@@ -1430,53 +1430,49 @@
\global\setbox\currenttopcolumnbox\vbox
{\snaptogrid\vbox
{\copy\currenttopcolumnbox
- \hbox{\vphantom{\copy\floatbox}}}
+ \hbox{\vphantom{\vskip\floatheight}}}% known from previous
\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
+ \dofloatsgetinfo{text}%
+ \ifdim\floatwidth>\hsize
+ \dimen0\dimexpr\floatwidth+\intercolumnwidth+.5pt\relax
+ \dimen2\dimexpr\hsize +\intercolumnwidth+.5pt\relax
\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
+ \dimen0\dimexpr\count0\hsize+\count0\intercolumnwidth-\intercolumnwidth\relax
+ \dofloatsflush{text}{1}%
+ \ifdim\floatwidth>\finalcolumntextwidth % better somewhere else too
+ \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}%
+ \fi % otherwise the graphic may disappear
\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]}%
+ [ \v!left=>\box\floatbox\hss,
+ \v!right=>\hss\box\floatbox,
+ \s!default=>\hss\box\floatbox\hss,
+ \s!unknown=>\hss\box\floatbox\hss]}%
\fi
\showmessage\m!columns{13}\empty
\else
- % \showmessage\m!columns{13}\empty
+ \dofloatsflush{text}{1}%
+ \ifdim\floatwidth>\finalcolumntextwidth % better somewhere else too
+ \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}%
+ \fi % otherwise the graphic may disappear
+ % \showmessage\m!columns{13}\empty
\fi
\ifdim\ht\floatbox>\zeropoint\relax
\global\setbox\currenttopcolumnbox\vbox
{\snaptogrid\vbox
- {\copy\currenttopcolumnbox
- \copy\floatbox}
+ {\box\currenttopcolumnbox % was copy
+ \box\floatbox}
\whitespace % nodig ?
\blank[\@@bkspaceafter]}%
\fi
- \dimen6\ht\currenttopcolumnbox
- \advance\dimen6 \dp\currenttopcolumnbox
+ \dimen6\htdp\currenttopcolumnbox
\fi
\ifdim\dimen4<\ht\currenttopcolumnbox
\dimen4\ht\currenttopcolumnbox
@@ -1531,7 +1527,7 @@
%
% \stopcolumns
-\def\setupcolumns
+\unexpanded\def\setupcolumns
{\dosingleempty\dosetupcolumns}
\def\dosetupcolumns[#1]%
@@ -1624,7 +1620,7 @@
\ifdim\ctxparskip>\zeropoint\relax
\setupwhitespace[\@@klblank]%
\fi
- \def\stopcolumns
+ \unexpanded\def\stopcolumns
{\endmulticolumns
\global\insidecolumnsfalse
\endgroup
@@ -1648,7 +1644,7 @@
%D interwoven and therefore to be integrated when the multi
%D column modules are merged. (moved from cont-new.tex)
-\def\setupcolumnspan[#1]%
+\unexpanded\def\setupcolumnspan[#1]%
{\getparameters[\??ks][#1]}
\presetlocalframed
@@ -1708,10 +1704,10 @@
%\topskipcorrection % becomes an option !
\EveryPar{\begstrut\EveryPar{}}} % also !
-\def\startcolumnspan
+\unexpanded\def\startcolumnspan
{\dosingleempty\dostartcolumnspan}
-\def\stopcolumnspan
+\unexpanded\def\stopcolumnspan
{\egroup}
\setupcolumns
@@ -1732,7 +1728,7 @@
%D Undocumented and still under development.
-\def\startsimplecolumns
+\unexpanded\def\startsimplecolumns
{\dosingleempty\dostartsimplecolumns}
\def\dostartsimplecolumns[#1]%
@@ -1746,7 +1742,7 @@
\setbox\scratchbox\vbox\bgroup
\forgetall} % \blank[\v!disable]
-\def\stopsimplecolumns
+\unexpanded\def\stopsimplecolumns
{\removebottomthings
\egroup
\rigidcolumnbalance\scratchbox
diff --git a/Master/texmf-dist/tex/context/base/page-not.mkiv b/Master/texmf-dist/tex/context/base/page-not.mkiv
index 9628b9d5f29..95229f9d054 100644
--- a/Master/texmf-dist/tex/context/base/page-not.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-not.mkiv
@@ -29,17 +29,15 @@
\flushnotes
\savenotecontent
\fi
- \savenotedata
- \checknotes}
+ \savenotedata}
\def\checkendcolumnfootnotes
- {\restorenotedata % maybe better just \checknotes
+ {\restorenotedata
\ifcase\clevernotes\else
\restorenotecontent
\fi}
-\def\checksinglecolumnfootnotes
- {\checknotes} % niet : \restorenotedata
+\let\checksinglecolumnfootnotes\relax
\newdimen\totalinsertionheight
@@ -58,8 +56,7 @@
\flushnotes
\savenotecontent
\fi
- \savenotedata
- \checknotes}
+ \savenotedata}
\def\checkendcolumnfootnotes
{\restorenotedata
diff --git a/Master/texmf-dist/tex/context/base/page-one.mkiv b/Master/texmf-dist/tex/context/base/page-one.mkiv
index 73f69d58253..bbd35181e7b 100644
--- a/Master/texmf-dist/tex/context/base/page-one.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-one.mkiv
@@ -33,61 +33,6 @@
\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
@@ -231,28 +176,6 @@
\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
@@ -362,17 +285,6 @@
\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
@@ -423,57 +335,35 @@
\def\OTRONEflushfloatbox % nog verder doorvoeren en meer info in marge
{\ifcenterfloatbox \ifdim\wd\floatbox<\hsize
- \setbox\floatbox\hbox to \hsize{\hss\box\floatbox\hss}%
+ \global\setbox\floatbox\hbox to \hsize{\hss\box\floatbox\hss}%
\fi \fi
- \snaptogrid\hbox{\iftestfloatbox\ruledhbox\fi{\copy\floatbox}}}
+ \snaptogrid\hbox{\iftestfloatbox\ruledhbox\fi{\box\floatbox}}} % was copy
\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
+ \centerfloatboxfalse % not needed as we do call directly
+ \dofloatscollect{text}{\hsize}{1em}%
\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}%
+ {\hfil
+ \dorecurse\nofcollectedfloats
+ {\ifcase\columndirection % nog document wide
+ \dofloatsflush{text}{1}%
+ \else
+ \dofloatsflushn{text}{\the\numexpr\nofcollectedfloats-\recurselevel+1\relax}%
+ \fi
+ \ifdim\wd\floatbox>\makeupwidth % \hsize
+ \hbox to \makeupwidth{\hss\box\floatbox\hss}%
+ \else
+ \box\floatbox
+ \fi
+ \ifnum\recurselevel<\nofcollectedfloats
+ \hfil
+ \fi}%
+ \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
@@ -494,8 +384,7 @@
\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
+ \dimen0\dimexpr\pagetotal+\floatheight+\floattopskip-\pageshrink\relax
\dimen2\pagegoal
\relax % needed
\ifcase\textfloatmethod
@@ -601,20 +490,9 @@
\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\OTRONEsomepagefloat [#1]{\dofloatssavepagefloat{page} {#1}}
+\def\OTRONEsomeleftpagefloat [#1]{\dofloatssavepagefloat{leftpage} {#1}}
+\def\OTRONEsomerightpagefloat[#1]{\dofloatssavepagefloat{rightpage}{#1}}
\def\OTRONEsometopsfloat[#1]%
{\ifdim\topinserted=\zeropoint
@@ -622,7 +500,7 @@
\else
\topofinsertfalse
\fi
- \global\advance\topinserted \ht\floatbox+\dp\floatbox+\floatbottomskip\relax
+ \global\advance\topinserted\dimexpr\ht\floatbox+\dp\floatbox+\floatbottomskip\relax
\insert\topins
{\forgetall
\iftopofinsert
diff --git a/Master/texmf-dist/tex/context/base/page-par.mkiv b/Master/texmf-dist/tex/context/base/page-par.mkiv
index a5dea2e635d..fb8631eec83 100644
--- a/Master/texmf-dist/tex/context/base/page-par.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-par.mkiv
@@ -17,7 +17,7 @@
\newcount\internalparagraphnumber
-\def\setupparagraphnumbering
+\unexpanded\def\setupparagraphnumbering
{\dosingleempty\dosetupparagraphnumbering}
\def\dosetupparagraphnumbering[#1]%
diff --git a/Master/texmf-dist/tex/context/base/page-plg.mkiv b/Master/texmf-dist/tex/context/base/page-plg.mkiv
index bbee2eb57ba..7d7612153d7 100644
--- a/Master/texmf-dist/tex/context/base/page-plg.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-plg.mkiv
@@ -186,10 +186,10 @@
\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\unexpanded\def\startpagelayout[#1]#2\stoppagelayout
% {\long\setvalue{\??ly\c!method:#1}{#2}}
-\long\def\startpagelayout
+\long\unexpanded\def\startpagelayout
{\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout}
\long\def\dostartpagelayout[#1]#2\stoppagelayout
diff --git a/Master/texmf-dist/tex/context/base/page-set.mkii b/Master/texmf-dist/tex/context/base/page-set.mkii
index b8a0751795c..eb01799ae8d 100644
--- a/Master/texmf-dist/tex/context/base/page-set.mkii
+++ b/Master/texmf-dist/tex/context/base/page-set.mkii
@@ -545,26 +545,9 @@
%\gdef\localcolumnmaxcells{0}% here ?
\global\mofcolumns\nofcolumns} % otherwise problems in finaloutput
-% \def\OTRSETdofinaloutput
-% {\ifdim\ht\OTRfinalpagebox=\teksthoogte
-% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap
-% \ifcase\OTRSETbalancemethod
-% \finaloutput\box\OTRfinalpagebox
-% \else\ifdim\OTRSETbalht>\zeropoint
-% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht
-% {\box\OTRfinalpagebox}%
-% \global\dp\OTRfinalpagebox\strutdepth
-% \box\OTRfinalpagebox
-% \else
-% \finaloutput\box\OTRfinalpagebox
-% \fi \fi
-% \globallet\OTRSETbalht\zeropoint
-% % \egroup
-% \fi}
-
\def\OTRSETdofinaloutput
{\ifdim\ht\OTRfinalpagebox=\textheight
- \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
+ \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
\ifcase\OTRSETbalancemethod
\finaloutput\box\OTRfinalpagebox
\else\ifdim\OTRSETbalht>\zeropoint
@@ -585,7 +568,7 @@
\finaloutput\box\OTRfinalpagebox
\fi \fi
\globallet\OTRSETbalht\zeropoint
- \egroup
+ \egroup
\fi}
\definesystemvariable {mc}
@@ -1784,66 +1767,6 @@
\def\localcolumnmaxcells{0}
-% currently line represents real line, i.e. on the grid, and
-% not something noflines (also, watch out for switching from
-% 2-3 columns on one page with both sets balanced: the
-% second set does not see the first set
-
-% \def\OTRSETinitbalancing
-% {\ifcase\OTRSETbalancemethod\or
-% \let\savedcolumnmaxcells\columnmaxcells
-% \ifnum\realpageno=\balancingpageno\relax
-% \ifnum\mofcolumns=\plusone
-% \dorecurse\nofcolumns
-% {\!!counta\recurselevel\relax
-% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax
-% \ifcase\!!countb
-% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax
-% \fi
-% \ifcase\!!countb
-% \!!countb \savedcolumnmaxcells\relax
-% \fi
-% % can be an option: absolute versus relative
-% \ifnum\OTRSETbalancemethod=\plusthree
-% \advance\!!countb\precolumnlines
-% \ifnum\!!countb>\localcolumnmaxcells\relax
-% \xdef\localcolumnmaxcells{\the\!!countb}%
-% \fi
-% \advance\!!countb \plusone
-% \dostepwiserecurse\!!countb\columnmaxcells\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \else
-% \globallet\localcolumnmaxcells\columnmaxcells
-% \advance\!!countb-\columnmaxcells
-% \!!countb-\!!countb
-% \advance\!!countb \minusone
-% \ifnum\!!countb>\zerocount
-% \dostepwiserecurse\plusone\!!countb\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \fi
-% \fi}%
-% \OTRSETsetvsize % ! ! !
-% \fi
-% \fi
-% \fi}
-%
-% \def\OTRSETpresetbalancing
-% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
-% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
-% \ifnum\commalistsize>\plusone
-% \scratchcounter\zerocount
-% \def\docommand##1%
-% {\advance\scratchcounter\plusone
-% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
-% \processcommacommand
-% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand
-% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
-% \fi}}
-
% don't loose empty 1page/1column with area (example **)
%
% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
@@ -1859,32 +1782,6 @@
\def\setupcolumnsetarea {\setupcolumntextarea}
\def\setupcolumnsetareatext{\setupcolumntextareatext}
-% so this will be changed
-
-% \def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% % todo: nothing if no footnotes, else empty page
-% \dostepwiserecurse\mofcolumns\nofcolumns\plusone
-% {\vskip-\struttotal\verticalstrut\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint % no, see example **
-% \ifnum\mofcolumns=\nofcolumns
-% \OTRSETflushfinalfootnotes
-% \else
-% % probably todo
-% \fi
-% \vfill
-% \eject
-% % brr, may result in empty page after nicely fit text
-% % or if left, then lost of first column only text
-% \ifnum\mofcolumns>1
-% \OTRSETdofinalflush
-% \OTRSETdofinaloutput
-% \fi
-% \fi
-% \fi}
-
\def\OTRSETnobalance
{\iflastcolumnfootnotes % testen ! optie
% inhibit flush of floats !
@@ -2037,31 +1934,12 @@
% test:
%
-% \definecolumnset[two] [n=2,balance=yes]
-% \definecolumnset[three][n=3,balance=yes]
-% \setupcolumnset [two] [1] [lines=10]
-% \setupcolumnset [two] [2] [lines=10]
-%
-% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset
-% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset
-%
-% with:
-%
-% \installoutput\OTRSETflushpreposttext
-% {%\ifvoid\normalpagebox
-% % \global\setbox\precolumnbox\vbox{}%
-% %\else
-% \global\setbox\precolumnbox\vbox
-% {\unvcopy\normalpagebox}%
-% \global\setbox\precolumnbox\vbox to \ht\precolumnbox
-% {\box\normalpagebox}%
-% %\fi
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
-% testcase : pascal demo-bbi, paragraaf/aanduiding koppen
+% \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
@@ -2081,30 +1959,6 @@
\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
-% {\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\OTRSEThandlepreposttext
{\ifdim\ht\precolumnbox>\zeropoint % new
\getnoflines{\ht\precolumnbox}%
@@ -2423,6 +2277,7 @@
\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
@@ -2573,7 +2428,8 @@
%\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
%\c!leftoffset=\columntextareaparameter\c!clipoffset,%
\c!offset=\columntextareaparameter\c!clipoffset,%
- \c!rightoffset=\zeropoint,%
+ \c!offset=\columntextareaparameter\c!clipoffset,%
+ \c!rightoffset=\columntextareaparameter\c!rightoffset,%
\c!width=\!!widthb,%
\c!height=\!!heighta]%
{\copy\scratchbox}%
@@ -2590,7 +2446,8 @@
%\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
%\c!rightoffset=\columntextareaparameter\c!clipoffset,%
\c!offset=\columntextareaparameter\c!clipoffset,%
- \c!leftoffset=\zeropoint,%
+ \c!offset=\columntextareaparameter\c!clipoffset,%
+ \c!leftoffset=\columntextareaparameter\c!leftoffset,%
\c!width=\!!widtha,%
\c!height=\!!heighta,%
\c!hoffset=\!!widthb]%
@@ -2798,206 +2655,6 @@
% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
% \stopcolumnset
-% We need to set the \dimen globally since we are in the
-% OTR. Unfortunately this interferes with local settings,
-% although we may assume that they will not cross page
-% boundaries.
-
-\def\OTRSETcheckcontent
- {\bgroup
- \donefalse
- \def\OTRSETcheckcontent##1%
- {\setbox\scratchbox##1\recurselevel
- \setbox\scratchbox\vbox{\unvbox\scratchbox}%
- \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}%
- \dorecurse{\nofcolumns}
- {\OTRSETcheckcontent\columngettextbox
- \OTRSETcheckcontent\columngetfootbox
- \OTRSETcheckcontent\columngettopbox
- \OTRSETcheckcontent\columngetbotbox}%
- \ifdone\egroup\donefalse\else\egroup\donetrue\fi}
-
-\def\OTRSETgetcolumntextheight#1% max - boven - top
- {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1%
- \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen -\ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen -\ht\columnbotbox#1} % not used
-
-\def\OTRSETgetcolumnnaturalheight#1% max - boven - top
- {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}%
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen \ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen \ht\columnbotbox#1} % not used
-
-\def\OTRSETdobalance% splitten in met en zonder footnotes
- {\bgroup
- \maxdeadcycles=1000
- % collect content and notes
- \bgroup
- \OTRSEToutput
- {\global\setbox1\vbox{\unvbox\normalpagebox}%
- \global\setbox3\vbox{\unvbox\footins}}%
- \verticalstrut\vskip-\struttotal % makes footnotes flush
- \eject
- \global\collectingcontentfalse
- % check for footnotes only
- \ifdim\ht1<\topskip % real dirty
- \global\setbox1=\vbox{}
- % fix height of first line
- \ifdim\ht3>\!!zeropoint
- \global\setbox3\vbox
- {\setfootnotebodyfont
- \kern-\strutht
- \kern\topskip
- \unvbox3}
- \fi
- % prepare trial box
- \global\setbox5\vbox
- {\ifdim\ht1>\zeropoint
- \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi
- \fi
- \ifdim\ht3>\zeropoint \unvcopy3 \fi}
- \egroup
- % erase old stuff
- \columnerasetextboxes
- \columnerasefootboxes
- % prepare floats
- \OTRSETdotopinsertions
- \OTRSETdobotinsertions % not used can be removed
- % calculate available space
- \!!heighta\zeropoint % available total height
- \dorecurse{\nofcolumns}
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \advance\!!heighta \scratchdimen}
- % quick check
- \ifdim\ht5>\!!heighta
- % use normal routine
- \columnerasetextboxes
- \columnerasefootboxes
- % TEMP, TODO, FORCE NEXT PASS !
- \unvbox1
- \unvbox3
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \donefalse
- %\writestatus\m!columns{no balancing, text overflows height}%
- \else\ifdim\ht5>\zeropoint \relax
- % some text and/or notes
- \donetrue
- \else
- \donefalse
- \dorecurse\nofcolumns
- {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}%
- \ifdone
- % no text and notes, but figures
- \else
- % no text, no notes, no figures
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \writestatus\m!columns{no balancing, nothing to be placed}%
- \fi
- \fi\fi
- \ifdone
- \ifdim\ht5>\zeropoint \relax
- % balancing text and notes
- %\writestatus\m!columns{text may fit, balancing}%
- \newcounter\loopcounter
- \newcounter\balancinglines
- \doloop
- {\increment\loopcounter\relax
- % initialize
- \columnerasetextboxes
- \columnerasefootboxes
- \setbox0=\copy5
- \splittopskip\topskip
- % pre-split loop and quality calculation
- %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines}
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc}
- % just one method
- \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen
- \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen
- %\writestatus\m!columns{first column: \the\dimen4}%
- %\writestatus\m!columns{last column: \the\dimen6}%
- \ifdim\dimen4=\dimen6
- \donetrue % perfect balance
- \else\ifdim\dimen4>\dimen6
- \donefalse % not yet good enough
- \increment\balancinglines % try again
- \edef\balancingcount{\the\!!counta}
- \else
- \donetrue % worse balance
- \ifnum\balancinglines>0 % take previous
- \decrement\balancinglines
- \fi
- \fi\fi
- % extra check
- % \ifdim\ht0>\zeropoint\relax \donefalse \fi
- % another check
- \ifdone
- %\writestatus\m!columns{balancing finished in pass \loopcounter}%
- \else \ifnum\loopcounter>100 \donetrue
- %\writestatus\m!columns{balancing aborted after pass \loopcounter}%
- \else
- %\writestatus\m!columns{balancing continued after pass \loopcounter}%
- \fi \fi
- % final balancing pass
- \ifdone
- \setbox0\copy1
- \setbox2\copy3
- \columnerasetextboxes
- \columnerasefootboxes
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- % split off text
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc
- \setbox4\vbox{\unvcopy\columntextbox\recurselevel}
- \advance\!!heightc -\ht4
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\box4
- \advance\!!heightc \skip\footins
- \fi
- \fi
- % split off footnotes
- \ifdim\ht0>\zeropoint\relax \else
- \ifdim\ht2>\zeropoint\relax
- \setbox4\vsplit2 to \!!heightc
- \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick
- \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax
- \columnsettextbox\recurselevel\hbox
- {\raise\strutdp\hbox % ugly but needed
- {\setfootnotebodyfont % both these moves
- \lower\strutdp\hbox{\placebottomnotes}}}
- \else
- \columnsetfootbox\recurselevel\hbox{\placebottomnotes}
- \fi
- \fi
- \fi}
- \exitloop
- \fi}
- \else
- % no reason to balance floats
- \fi
- \fi
- \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist
- \OTRSETdoflush
- \fi
- \egroup}
-
\protect \endinput
% extreme examples (1)
diff --git a/Master/texmf-dist/tex/context/base/page-set.mkiv b/Master/texmf-dist/tex/context/base/page-set.mkiv
index 8dc8a2fd9f0..cc6fbb5e6d9 100644
--- a/Master/texmf-dist/tex/context/base/page-set.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-set.mkiv
@@ -268,8 +268,8 @@
\def\OTRSETerasegridcells#1#2#3#4%
{\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}}
-\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]}
-\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]}
+\unexpanded\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]}
+\unexpanded\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]}
\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value
{% not needed, is already relative
@@ -423,7 +423,7 @@
\localcolumnwidth\OTRSETlocalwidth\mofcolumns
\offinterlineskip
\setbox\scratchbox\vbox to \!!heighta
- {\topskipcorrection % not needed
+ {%\topskipcorrection % not needed
\ifcase\OTRSETbalancemethod
% no
\or
@@ -541,23 +541,6 @@
%\gdef\localcolumnmaxcells{0}% here ?
\global\mofcolumns\nofcolumns} % otherwise problems in finaloutput
-% \def\OTRSETdofinaloutput
-% {\ifdim\ht\OTRfinalpagebox=\teksthoogte
-% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap
-% \ifcase\OTRSETbalancemethod
-% \finaloutput\box\OTRfinalpagebox
-% \else\ifdim\OTRSETbalht>\zeropoint
-% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht
-% {\box\OTRfinalpagebox}%
-% \global\dp\OTRfinalpagebox\strutdepth
-% \box\OTRfinalpagebox
-% \else
-% \finaloutput\box\OTRfinalpagebox
-% \fi \fi
-% \globallet\OTRSETbalht\zeropoint
-% % \egroup
-% \fi}
-
\def\OTRSETdofinaloutput
{\ifdim\ht\OTRfinalpagebox=\textheight
\bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
@@ -923,36 +906,6 @@
\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
@@ -1195,15 +1148,6 @@
\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
@@ -1354,15 +1298,6 @@
\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
@@ -1394,13 +1329,15 @@
\global\setbox\floatbox\lastbox}%
\fi}
+% for the moment resave is still needed here
+
\def\OTRSETsavebox#1% clean up the skips
{\OTRSETunpreparebox{#1}%
- \dosavefloat}
+ \dofloatssave{text}}
\def\OTRSETresavebox#1% clean up the skips
{\OTRSETunpreparebox{#1}%
- \doresavefloat}
+ \dofloatsresave{text}}
\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge
{\iftestfloatbox\ruledhbox\fi{\box\floatbox}}
@@ -1410,10 +1347,11 @@
\def\OTRSETsavebox##1{\!!doneafalse}%
\doloop
{\ifsomefloatwaiting
-\OTRSETskipstart
- \dogetfloat
- \ifdim\wd\floatbox>\zeropoint
+ \OTRSETskipstart
+ \dofloatsgetinfo{text}%
+ \ifdim\floatwidth>\zeropoint
\!!doneatrue
+ \dofloatsflush{text}{1}%
\dp\floatbox\zeropoint
\OTRSETstoreincolumnslot{TBLR}\floatbox
\if!!donea
@@ -1525,7 +1463,7 @@
% vanaf hier:
-\def\definecolumnset
+\unexpanded\def\definecolumnset
{\dodoubleargument\dodefinecolumnset}
\def\dodefinecolumnset[#1][#2]%
@@ -1559,7 +1497,7 @@
\c!width=\getvalue{\??mc#1\c!width},
\c!distance=\getvalue{\??mc#1\c!distance}]}
-\def\setupcolumnset
+\unexpanded\def\setupcolumnset
{\dotripleargument\dosetupcolumnset}
\def\dosetupcolumnset[#1][#2][#3]%
@@ -1688,7 +1626,7 @@
\let\currentcolumnset\empty
\chardef\OTRSETfinish\zerocount
-\def\startcolumnset
+\unexpanded\def\startcolumnset
{\dodoubleempty\dostartcolumnset}
\def\dostartcolumnset[#1][#2]%
@@ -1724,7 +1662,6 @@
% \input knuth \endgraf \input knuth
% \stoptext
-
\def\OTRSETflushleftovers % new per 13/4/2006
{\OTRSETdoifcellelse{1}{1}
{\bgroup
@@ -1738,7 +1675,7 @@
\egroup}
{}}
-\def\stopcolumnset
+\unexpanded\def\stopcolumnset
{\relax
\ifnum\columnsetlevel=\plusone
\endgraf % needed, else wrong vsize in one par case
@@ -1785,61 +1722,6 @@
% 2-3 columns on one page with both sets balanced: the
% second set does not see the first set
-% \def\OTRSETinitbalancing
-% {\ifcase\OTRSETbalancemethod\or
-% \let\savedcolumnmaxcells\columnmaxcells
-% \ifnum\realpageno=\balancingpageno\relax
-% \ifnum\mofcolumns=\plusone
-% \dorecurse\nofcolumns
-% {\!!counta\recurselevel\relax
-% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax
-% \ifcase\!!countb
-% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax
-% \fi
-% \ifcase\!!countb
-% \!!countb \savedcolumnmaxcells\relax
-% \fi
-% % can be an option: absolute versus relative
-% \ifnum\OTRSETbalancemethod=\plusthree
-% \advance\!!countb\precolumnlines
-% \ifnum\!!countb>\localcolumnmaxcells\relax
-% \xdef\localcolumnmaxcells{\the\!!countb}%
-% \fi
-% \advance\!!countb \plusone
-% \dostepwiserecurse\!!countb\columnmaxcells\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \else
-% \globallet\localcolumnmaxcells\columnmaxcells
-% \advance\!!countb-\columnmaxcells
-% \!!countb-\!!countb
-% \advance\!!countb \minusone
-% \ifnum\!!countb>\zerocount
-% \dostepwiserecurse\plusone\!!countb\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \fi
-% \fi}%
-% \OTRSETsetvsize % ! ! !
-% \fi
-% \fi
-% \fi}
-%
-% \def\OTRSETpresetbalancing
-% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
-% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
-% \ifnum\commalistsize>\plusone
-% \scratchcounter\zerocount
-% \def\docommand##1%
-% {\advance\scratchcounter\plusone
-% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
-% \processcommacommand
-% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand
-% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
-% \fi}}
-
% don't loose empty 1page/1column with area (example **)
%
% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
@@ -1851,36 +1733,12 @@
% better:
-\def\definecolumnsetarea {\definecolumntextarea}
-\def\setupcolumnsetarea {\setupcolumntextarea}
-\def\setupcolumnsetareatext{\setupcolumntextareatext}
+\unexpanded\def\definecolumnsetarea {\definecolumntextarea}
+\unexpanded\def\setupcolumnsetarea {\setupcolumntextarea}
+\unexpanded\def\setupcolumnsetareatext{\setupcolumntextareatext}
% so this will be changed
-% \def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% % todo: nothing if no footnotes, else empty page
-% \dostepwiserecurse\mofcolumns\nofcolumns\plusone
-% {\vskip-\struttotal\verticalstrut\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint % no, see example **
-% \ifnum\mofcolumns=\nofcolumns
-% \OTRSETflushfinalfootnotes
-% \else
-% % probably todo
-% \fi
-% \vfill
-% \eject
-% % brr, may result in empty page after nicely fit text
-% % or if left, then lost of first column only text
-% \ifnum\mofcolumns>1
-% \OTRSETdofinalflush
-% \OTRSETdofinaloutput
-% \fi
-% \fi
-% \fi}
-
\def\OTRSETnobalance
{\iflastcolumnfootnotes % testen ! optie
% inhibit flush of floats !
@@ -1937,17 +1795,6 @@
\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
@@ -1959,14 +1806,6 @@
\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
@@ -1997,67 +1836,16 @@
\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}%
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
% test:
%
-% \definecolumnset[two] [n=2,balance=yes]
-% \definecolumnset[three][n=3,balance=yes]
-% \setupcolumnset [two] [1] [lines=10]
-% \setupcolumnset [two] [2] [lines=10]
+% \definecolumnset[test-1] %[balance=yes]
+% \definecolumnset[test-2] %[balance=yes]
%
-% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset
-% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset
+% \setupcolumnsetlines[test-1][1][1] [4]
+% \setupcolumnsetlines[test-1][1][2][10]
%
-% with:
-%
-% \installoutput\OTRSETflushpreposttext
-% {%\ifvoid\normalpagebox
-% % \global\setbox\precolumnbox\vbox{}%
-% %\else
-% \global\setbox\precolumnbox\vbox
-% {\unvcopy\normalpagebox}%
-% \global\setbox\precolumnbox\vbox to \ht\precolumnbox
-% {\box\normalpagebox}%
-% %\fi
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
-% testcase : pascal demo-bbi, paragraaf/aanduiding koppen
+% \startcolumnset [test-1] \dorecurse {1}{\input tufte \par} \stopcolumnset
+% \startcolumnset [test-2] \dorecurse {2}{\input ward \par} \stopcolumnset
\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi
@@ -2077,30 +1865,6 @@
\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
-% {\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\OTRSEThandlepreposttext
{\ifdim\ht\precolumnbox>\zeropoint % new
\getnoflines{\ht\precolumnbox}%
@@ -2403,7 +2167,7 @@
% links rechts => odd, even, n, named
-\def\definecolumntextarea
+\unexpanded\def\definecolumntextarea
{\dotripleempty\dodefinecolumntextarea}
\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig !
@@ -2422,13 +2186,14 @@
\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
+\unexpanded\def\setupcolumntextarea
{\dotripleempty\dosetupcolumntextarea}
\def\dosetupcolumntextarea[#1][#2][#3]%
@@ -2486,7 +2251,7 @@
{\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}}
{\copy\placeholderboxd}}
-\def\placecolumntextareas
+\unexpanded\def\placecolumntextareas
{\ifodd\realpageno
\doplacecolumntextareas\columnrightareas\v!right
\else
@@ -2572,7 +2337,8 @@
%\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
%\c!leftoffset=\columntextareaparameter\c!clipoffset,%
\c!offset=\columntextareaparameter\c!clipoffset,%
- \c!rightoffset=\zeropoint,%
+ \c!offset=\columntextareaparameter\c!clipoffset,%
+ \c!rightoffset=\columntextareaparameter\c!rightoffset,%
\c!width=\!!widthb,%
\c!height=\!!heighta]%
{\copy\scratchbox}%
@@ -2589,7 +2355,7 @@
%\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
%\c!rightoffset=\columntextareaparameter\c!clipoffset,%
\c!offset=\columntextareaparameter\c!clipoffset,%
- \c!leftoffset=\zeropoint,%
+ \c!leftoffset=\columntextareaparameter\c!leftoffset,%
\c!width=\!!widtha,%
\c!height=\!!heighta,%
\c!hoffset=\!!widthb]%
@@ -2597,7 +2363,7 @@
\OTRSETsetgridcell\!!counta\!!countb\box0%
\fi}
-\def\setupcolumntextareatext
+\unexpanded\def\setupcolumntextareatext
{\dotripleempty\dosetupcolumntextareatext}
\long\def\dosetupcolumntextareatext[#1][#2][#3]%
@@ -2652,7 +2418,7 @@
{\!!counta#1\!!countb#2\docalculatecolumnsetspan
\edef\columnsetspanhsize{\the\!!widtha}}
-\def\definecolumnsetspan
+\unexpanded\def\definecolumnsetspan
{\dodoubleempty\dodefinecolumnsetspan}
\def\dodefinecolumnsetspan[#1][#2]%
@@ -2679,7 +2445,7 @@
\definecolumnsetspan[\s!default]
-\def\setupcolumnsetspan
+\unexpanded\def\setupcolumnsetspan
{\dodoubleempty\dosetupcolumnsetspan}
\def\dosetupcolumnsetspan[#1][#2]%
@@ -2689,7 +2455,7 @@
\setupcolumnsetspan[\s!default][#1]%
\fi}
-\def\startcolumnsetspan
+\unexpanded\def\startcolumnsetspan
{\dotripleempty\dostartcolumnsetspan}
%%%%%%%%%%%%%%%% TODO
@@ -2730,7 +2496,7 @@
\ifnum\columnsetlevel>\zerocount
\framedtextparameter{cs:#1}\c!before
\fi
- \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}}
+ \unexpanded\def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}}
\def\dostopcolumnsetspan#1%
{\par
@@ -2797,206 +2563,6 @@
% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
% \stopcolumnset
-% We need to set the \dimen globally since we are in the
-% OTR. Unfortunately this interferes with local settings,
-% although we may assume that they will not cross page
-% boundaries.
-
-\def\OTRSETcheckcontent
- {\bgroup
- \donefalse
- \def\OTRSETcheckcontent##1%
- {\setbox\scratchbox##1\recurselevel
- \setbox\scratchbox\vbox{\unvbox\scratchbox}%
- \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}%
- \dorecurse{\nofcolumns}
- {\OTRSETcheckcontent\columngettextbox
- \OTRSETcheckcontent\columngetfootbox
- \OTRSETcheckcontent\columngettopbox
- \OTRSETcheckcontent\columngetbotbox}%
- \ifdone\egroup\donefalse\else\egroup\donetrue\fi}
-
-\def\OTRSETgetcolumntextheight#1% max - boven - top
- {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1%
- \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen -\ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen -\ht\columnbotbox#1} % not used
-
-\def\OTRSETgetcolumnnaturalheight#1% max - boven - top
- {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}%
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen \ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen \ht\columnbotbox#1} % not used
-
-\def\OTRSETdobalance% splitten in met en zonder footnotes
- {\bgroup
- \maxdeadcycles=1000
- % collect content and notes
- \bgroup
- \OTRSEToutput
- {\global\setbox1\vbox{\unvbox\normalpagebox}%
- \global\setbox3\vbox{\unvbox\footins}}%
- \verticalstrut\vskip-\struttotal % makes footnotes flush
- \eject
- \global\collectingcontentfalse
- % check for footnotes only
- \ifdim\ht1<\topskip % real dirty
- \global\setbox1=\vbox{}
- % fix height of first line
- \ifdim\ht3>\!!zeropoint
- \global\setbox3\vbox
- {\setfootnotebodyfont
- \kern-\strutht
- \kern\topskip
- \unvbox3}
- \fi
- % prepare trial box
- \global\setbox5\vbox
- {\ifdim\ht1>\zeropoint
- \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi
- \fi
- \ifdim\ht3>\zeropoint \unvcopy3 \fi}
- \egroup
- % erase old stuff
- \columnerasetextboxes
- \columnerasefootboxes
- % prepare floats
- \OTRSETdotopinsertions
- \OTRSETdobotinsertions % not used can be removed
- % calculate available space
- \!!heighta\zeropoint % available total height
- \dorecurse{\nofcolumns}
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \advance\!!heighta \scratchdimen}
- % quick check
- \ifdim\ht5>\!!heighta
- % use normal routine
- \columnerasetextboxes
- \columnerasefootboxes
- % TEMP, TODO, FORCE NEXT PASS !
- \unvbox1
- \unvbox3
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \donefalse
- %\writestatus\m!columns{no balancing, text overflows height}%
- \else\ifdim\ht5>\zeropoint \relax
- % some text and/or notes
- \donetrue
- \else
- \donefalse
- \dorecurse\nofcolumns
- {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}%
- \ifdone
- % no text and notes, but figures
- \else
- % no text, no notes, no figures
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \writestatus\m!columns{no balancing, nothing to be placed}%
- \fi
- \fi\fi
- \ifdone
- \ifdim\ht5>\zeropoint \relax
- % balancing text and notes
- %\writestatus\m!columns{text may fit, balancing}%
- \newcounter\loopcounter
- \newcounter\balancinglines
- \doloop
- {\increment\loopcounter\relax
- % initialize
- \columnerasetextboxes
- \columnerasefootboxes
- \setbox0=\copy5
- \splittopskip\topskip
- % pre-split loop and quality calculation
- %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines}
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc}
- % just one method
- \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen
- \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen
- %\writestatus\m!columns{first column: \the\dimen4}%
- %\writestatus\m!columns{last column: \the\dimen6}%
- \ifdim\dimen4=\dimen6
- \donetrue % perfect balance
- \else\ifdim\dimen4>\dimen6
- \donefalse % not yet good enough
- \increment\balancinglines % try again
- \edef\balancingcount{\the\!!counta}
- \else
- \donetrue % worse balance
- \ifnum\balancinglines>0 % take previous
- \decrement\balancinglines
- \fi
- \fi\fi
- % extra check
- % \ifdim\ht0>\zeropoint\relax \donefalse \fi
- % another check
- \ifdone
- %\writestatus\m!columns{balancing finished in pass \loopcounter}%
- \else \ifnum\loopcounter>100 \donetrue
- %\writestatus\m!columns{balancing aborted after pass \loopcounter}%
- \else
- %\writestatus\m!columns{balancing continued after pass \loopcounter}%
- \fi \fi
- % final balancing pass
- \ifdone
- \setbox0\copy1
- \setbox2\copy3
- \columnerasetextboxes
- \columnerasefootboxes
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- % split off text
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc
- \setbox4\vbox{\unvcopy\columntextbox\recurselevel}
- \advance\!!heightc -\ht4
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\box4
- \advance\!!heightc \skip\footins
- \fi
- \fi
- % split off footnotes
- \ifdim\ht0>\zeropoint\relax \else
- \ifdim\ht2>\zeropoint\relax
- \setbox4\vsplit2 to \!!heightc
- \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick
- \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax
- \columnsettextbox\recurselevel\hbox
- {\raise\strutdp\hbox % ugly but needed
- {\setfootnotebodyfont % both these moves
- \lower\strutdp\hbox{\placebottomnotes}}}
- \else
- \columnsetfootbox\recurselevel\hbox{\placebottomnotes}
- \fi
- \fi
- \fi}
- \exitloop
- \fi}
- \else
- % no reason to balance floats
- \fi
- \fi
- \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist
- \OTRSETdoflush
- \fi
- \egroup}
-
\protect \endinput
% extreme examples (1)
diff --git a/Master/texmf-dist/tex/context/base/page-sid.mkiv b/Master/texmf-dist/tex/context/base/page-sid.mkiv
index ecfa195e688..c30204a4e68 100644
--- a/Master/texmf-dist/tex/context/base/page-sid.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-sid.mkiv
@@ -150,39 +150,6 @@
\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
@@ -395,7 +362,7 @@
\ifdim\sidefloatwidth>\zeropoint % new, see prikkels
\noindent
\ifinner\else\vadjust{\penalty\minusone}\fi
- \hskip\sidefloatwidth
+ \hskip\sidefloatwidth\relax
%\else
% we have a margin or edge float
\fi
@@ -467,6 +434,30 @@
%
% keep this ^
+\def\repositionsidefloat#1%
+ {\global\setbox\floatbox\hbox % no \hskip, but \kern here
+ {\ifnum\sidefloattype=\plusfour
+ \hskip\sidefloatleftshift
+ \else\ifnum\sidefloattype=\plusone
+ \hskip\sidefloatleftshift
+ \fi\fi
+ \ifnum\sidefloattype>\plusfour
+ \hskip-\sidefloatextrashift
+ \else
+ \hskip\sidefloatshift
+ \fi
+ \vbox{#1\ifnum\sidefloatalign=\plusfour \removedepth\fi}%
+ \ifnum\sidefloattype>\plusfour
+ \kern\sidefloatshift
+ \else
+ \kern-\sidefloatextrashift
+ \fi
+ \ifnum\sidefloattype=8
+ \kern\sidefloatrightshift
+ \else\ifnum\sidefloattype=\plusfive
+ \kern\sidefloatrightshift
+ \fi\fi}}
+
\def\putsidefloat#1% grid (4) is rather experimental
{\par
\whitespace
@@ -490,28 +481,7 @@
\fi
\previoussidefloat
\stallsidefloat
- \global\setbox\floatbox\hbox % no \hskip, but \kern here
- {\ifnum\sidefloattype=\plusfour
- \hskip\sidefloatleftshift
- \else\ifnum\sidefloattype=\plusone
- \hskip\sidefloatleftshift
- \fi\fi
- \ifnum\sidefloattype>\plusfour
- \hskip-\sidefloatextrashift
- \else
- \hskip\sidefloatshift
- \fi
- \vbox{#1\ifnum\sidefloatalign=\plusfour \removedepth\fi}%
- \ifnum\sidefloattype>\plusfour
- \kern\sidefloatshift
- \else
- \kern-\sidefloatextrashift
- \fi
- \ifnum\sidefloattype=8
- \kern\sidefloatrightshift
- \else\ifnum\sidefloattype=\plusfive
- \kern\sidefloatrightshift
- \fi\fi}%
+ \repositionsidefloat{#1}%
\ifnum\sidefloatalign=\plusfour
\getnoflines{\ht\floatbox}%
\scratchdimen\noflines\lineheight
@@ -576,17 +546,6 @@
\fi
\setsidefloat}
-% \def\progresssidefloat
-% {\sidefloatprogress\sidefloatvsize
-% \iffloatflag
-% \advance\sidefloatprogress -\sidefloatpagetotal
-% \global\floatflagfalse
-% \else
-% \advance\sidefloatprogress -\pagetotal
-% \fi}
-%
-% more compact:
-
\def\progresssidefloat
{\sidefloatprogress\sidefloatvsize
\advance\sidefloatprogress-\iffloatflag\sidefloatpagetotal\global\floatflagfalse\else\pagetotal\fi}
@@ -676,6 +635,10 @@
\fi
\egroup
\par
+\ifgridsnapping
+ \getrawnoflines\sidefloatheight
+ \sidefloatheight=\noflines\lineheight
+\fi
\kern-\sidefloatheight
\penalty10001 % oeps, this will change
\normalbaselines
@@ -784,7 +747,7 @@
\def\doadjustsidefloatdisplaylines
{\par
- \vskip-\parskip
+ % not in mkiv: \vskip-\parskip
\noindent
\ignorespaces}
diff --git a/Master/texmf-dist/tex/context/base/page-spr.mkiv b/Master/texmf-dist/tex/context/base/page-spr.mkiv
index 4436ddcc2c4..75b91dff773 100644
--- a/Master/texmf-dist/tex/context/base/page-spr.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-spr.mkiv
@@ -59,14 +59,14 @@
\null \page
\fi \fi }
-\def\startspread
+\unexpanded\def\startspread
{\bgroup
\ifdoublesided
\page[\v!left]%
%\setsystemmode{spread}%
\inspreadtrue
\expanded{\setuplayout[\c!textwidth=\the\dimexpr2\textwidth+2\backspace\relax]}%
- \def\startspread{\bgroup\let\stopspread\egroup}%
+ \unexpanded\def\startspread{\bgroup\let\stopspread\egroup}%
\let\stopspread\dostopspread
\else
\let\stopspread\egroup
diff --git a/Master/texmf-dist/tex/context/base/page-str.lua b/Master/texmf-dist/tex/context/base/page-str.lua
new file mode 100644
index 00000000000..c4d1957c3e8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/page-str.lua
@@ -0,0 +1,221 @@
+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"
+}
+
+-- work in progresss .. unfinished
+
+local concat = table.concat
+
+local find_tail, write_node, free_node, copy_nodelist = node.slide, node.write, node.free, node.copy_list
+local vpack_nodelist, hpack_nodelist = node.vpack, node.hpack
+local texdimen, texbox = tex.dimen, tex.box
+
+local new_kern = nodes.kern
+local new_glyph = nodes.glyph
+
+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)
+
+streams = streams or { }
+
+local data, name, stack = { }, nil, { }
+
+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)
+ table.insert(stack,name)
+ name = newname
+end
+
+function streams.stop(newname)
+ name = table.remove(stack)
+end
+
+function streams.collect(head,where)
+ if name and head and name ~= "default" then
+ local tail = node.slide(head)
+ local dana = data[name]
+ if not dana then
+ dana = { }
+ data[name] = dana
+ end
+ local last = dana[#dana]
+ if last then
+ local tail = find_tail(last)
+ tail.next, head.prev = head, tail
+ elseif last == false then
+ dana[#dana] = head
+ else
+ dana[1] = head
+ end
+ if trace_collecting then
+ logs.report("streams","appending snippet '%s' to slot %s",name,#dana)
+ end
+ return nil, true
+ else
+ return head, false
+ 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
+ logs.report("streams","pushing snippet '%s'",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
+ logs.report("streams","flushing copies of %s slots of '%s'",dn,name)
+ end
+ for i=1,dn do
+ local di = dana[i]
+ if di then
+ write_node(copy_nodelist(di.list)) -- list, will be option
+ end
+ end
+ if copy then
+ data[name] = nil
+ end
+ else
+ if trace_flushing then
+ logs.report("streams","flushing %s slots of '%s'",dn,name)
+ end
+ for i=1,dn do
+ local di = dana[i]
+ if di then
+ write_node(di.list) -- list, will be option
+ di.list = nil
+ free_node(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 = aux.settings_to_array(list)
+ local max = 0
+ if trace_flushing then
+ logs.report("streams","synchronizing list: %s",concat(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
+ logs.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]
+ local slot = dana[m]
+ if slot then
+ local vbox = vpack_nodelist(slot)
+ local ht, dp = vbox.height, vbox.depth
+ if ht > height then
+ height = ht
+ end
+ if dp > depth then
+ depth = dp
+ end
+ dana[m] = vbox
+ if trace_flushing then
+ logs.report("streams","slot %s of '%s' is packed to height %s and depth %s",m,name,ht,dp)
+ end
+ end
+ end
+ if trace_flushing then
+ logs.report("streams","slot %s has max height %s and max depth %s",m,height,depth)
+ end
+ local strutht, strutdp = texdimen.globalbodyfontstrutheight, texdimen.globalbodyfontstrutdepth
+ local struthtdp = strutht + strutdp
+ for i=1,#list do
+ local name = list[i]
+ local dana = data[name]
+ local vbox = dana[m]
+ if vbox then
+ local delta_height = height - vbox.height
+ local delta_depth = depth - vbox.depth
+ if delta_height > 0 or delta_depth > 0 then
+ if false then
+ -- actually we need to add glue and repack
+ vbox.height, vbox.depth = height, depth
+ if trace_flushing then
+ logs.report("streams","slot %s of '%s' with delta (%s,%s) 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 tail = vbox.list and find_tail(vbox.list)
+ local n, delta = 0, delta_height -- for tracing
+ while delta > 0 do
+ -- we need to add some interline penalties
+ local line = copy_nodelist(tex.box.strutbox)
+ line.height, line.depth = strutht, strutdp
+ if tail then
+ tail.next, line.prev = line, tail
+ end
+ tail = line
+ n, delta = n +1, delta - struthtdp
+ end
+ dana[m] = vpack_nodelist(vbox.list)
+ vbox.list = nil
+ free_node(vbox)
+ if trace_flushing then
+ logs.report("streams","slot %s:%s with delta (%s,%s) is compensated by %s lines",m,i,delta_height,delta_depth,n)
+ end
+ end
+ end
+ else
+ -- make dummy
+ end
+ end
+ end
+end
+
+tasks.appendaction("mvlbuilders", "normalizers", "streams.collect")
+
+tasks.disableaction("mvlbuilders", "streams.collect")
+
+function streams.initialize()
+ tasks.enableaction ("mvlbuilders", "streams.collect")
+end
+
+-- todo: remove empty last { }'s
diff --git a/Master/texmf-dist/tex/context/base/page-str.mkiv b/Master/texmf-dist/tex/context/base/page-str.mkiv
index e4fd3979434..d73643cbe67 100644
--- a/Master/texmf-dist/tex/context/base/page-str.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-str.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=page-str,
-%D version=2006.03.21,
+%D version=2010.03.13, % 2006.03.21,
%D title=\CONTEXT\ Page Macros,
%D subtitle=Page Streams,
%D author=Hans Hagen,
@@ -22,359 +22,123 @@
%D
%D These macros were written while listening to and watching the DVD
%D \quotation {Rush In Rio}.
+%D
+%D The reimplementation (or rather experimenting with the complete
+%D rewrite) was done while looping over \quotation {Wende Snijders
+%D No.9}.
+%D
+%D Remark: marknotes are gone, at least for a while.
-% not yet ok in mkiv ... marknotes .. will be completely redone
-
-\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
+\writestatus{loading}{ConTeXt Page Macros / Page Streams}
-\ifx\multicolumnseject\undefined \else
- \let\normalmulticolumnseject\multicolumnseject
- \def\multicolumnseject{\ifinoutputstream\else\normalmulticolumnseject\fi}
-\fi
+\registerctxluafile{page-str}{1.001}
-\newif\ifinoutputstream
+\unprotect
+\let \currentoutputstream \empty
+\newif \ifinoutputstream
\newtoks \everyenableoutputstream
\appendtoks
- \flushsidefloats
+ \flushsidefloats
\to \everyenableoutputstream
+\def\initializeoutputstreams
+ {\ctxlua{streams.initialize()}%
+ \glet\initializeoutputstreams\relax}
+
\def\enableoutputstream[#1]%
- {\the\everyenableoutputstream
- \finishoutputstream
- \writestatus{otr}{switching to output stream #1}%
+ {\initializeoutputstreams
+ \the\everyenableoutputstream
\inoutputstreamtrue
- \xdef\currentoutputstream{#1}}
+ \xdef\currentoutputstream{#1}%
+ \ctxlua{streams.enable("#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
- {\ifx\currentoutputstream\s!default % already expanded
- \ifnum\outputpenalty=\streampenalty
- \ifvoid\normalpagebox \else
- \unvbox\normalpagebox
- \fi
- \else
- \the\defaultstreamoutput
- \fi
- \else
- \the\normalstreamoutput
- \fi}
-
-\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.
+ {\inoutputstreamfalse
+ \global\let\currentoutputstream\s!default
+ \ctxlua{streams.disable()}}
-% not mkiv ready yet
-
-\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
+\unexpanded\def\startoutputstream[#1]%
{\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}
+ \initializeoutputstreams
+ \the\everyenableoutputstream
+ \inoutputstreamtrue
+ \xdef\currentoutputstream{#1}%
+ \ctxlua{streams.start("#1")}}
-\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}%
+\unexpanded\def\stopoutputstream
+ {\ctxlua{streams.stop()}%
\endgroup}
-%D The next section implements synchronization of (currently
-%D two) output streams. In due time we will implement both a
-%D vertical and horizontal system, as well as alternative
-%D splitters (firstpagevsize, succesivevsize etc).
-
-\def\synchronizeoutputstreams[#1]% [one,two] [left,right]
- {\bgroup
- \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
- \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
- \forgeteverypar
- \def\roundingeps{50sp}%
- \getboxheight\dimen0\of\box\outputstreamtag\firstoutputstream
- \getboxheight\dimen2\of\box\outputstreamtag\secondoutputstream
- \scratchdimen\dimexpr\dimen0-\dimen2\relax
- \ifdim\scratchdimen<-\roundingeps\relax
- \scratchdimen-\scratchdimen
- \writestatus{sync}{compensating first stream: \the\scratchdimen/\number\scratchdimen}%
- \getroundednoflines\scratchdimen
- \global\setbox\outputstreamtag\firstoutputstream\vbox
- {\presetoutputstream
- \unvbox\outputstreamtag\firstoutputstream\dorecurse\noflines\crlf}%
- \else\ifdim\scratchdimen>\roundingeps\relax
- \writestatus{sync}{compensating second stream: \the\scratchdimen/\number\scratchdimen}%
- \getroundednoflines\scratchdimen
- \global\setbox\outputstreamtag\secondoutputstream\vbox
- {\presetoutputstream
- \unvbox\outputstreamtag\secondoutputstream\dorecurse\noflines\crlf}%
- \else
- \writestatus{sync}{no need to compensate streams: \the\scratchdimen/\number\scratchdimen}%
- \fi\fi
- \egroup}
-
-\def\nofoutputstreamsplitlines {\v!auto} % {40}
-\def\outputstreamsplittolerance {-5}
-
-\def\flushoutputstreampages[#1]%
- {\bgroup
- \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
- \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
- \doloop
- {\flushoutputstreams[#1]%
- \ifvoid\outputstreamtag\firstoutputstream
- \ifvoid\outputstreamtag\secondoutputstream
- \exitloop
- \else
- \global\setbox\outputstreamtag\firstoutputstream\vbox{\strut}%
- \fi
- \else
- \ifvoid\outputstreamtag\secondoutputstream
- \global\setbox\outputstreamtag\secondoutputstream\vbox{\strut}%
- \else
- % okay
- \fi
- \fi}%
- \egroup}
-
-\def\flushoutputstreams[#1]%
- {\bgroup
- \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
- \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
- \doif\nofoutputstreamsplitlines\v!auto
- {\getrawnoflines\textheight
- \edef\nofoutputstreamsplitlines{\the\noflines}}%
- \splittopskip\strutheight
- \scratchdimen\nofoutputstreamsplitlines\lineheight\relax
- \unless\iffalse
- \dimen0\scratchdimen
- \doloop
- {\setbox4\copy\outputstreamtag\firstoutputstream
- \setbox0\vsplit4 to \dimen0
- \setbox0\vbox
- {\directsetup{stream:\firstoutputstream:top}%
- \unvbox0
- \directsetup{stream:\firstoutputstream:bottom}}%
- \ifdim\ht0>\scratchdimen
- \advance\dimen0-\lineheight
- \else
- \exitloop
- \fi}%
- \scratchdimen\dimen0
- \dimen2\scratchdimen
- \doloop
- {\setbox6\copy\outputstreamtag\secondoutputstream
- \setbox2\vsplit6 to \dimen2
- \setbox2\vbox
- {\directsetup{stream:\secondoutputstream:top}%
- \unvbox0
- \directsetup{stream:\secondoutputstream:bottom}}%
- \ifdim\ht2>\scratchdimen
- \advance\dimen2-\lineheight
- \else
- \exitloop
- \fi}%
- \scratchdimen\dimen2
- \fi
- \setbox4\copy\outputstreamtag\firstoutputstream
- \setbox6\copy\outputstreamtag\secondoutputstream
- \scratchcounter\zerocount
- \doloop
- {\setbox0\vsplit4 to \scratchdimen
- \setbox0\vbox{\unvbox0}%
- \setbox2\vsplit6 to \scratchdimen
- \setbox2\vbox{\unvbox2}%
- \ifvoid4
- \exitloop
- \else\ifvoid6
- \exitloop
- \else
- \dimen8=\dimexpr\ht4-\ht6\relax
- \ifdim\dimen8<\zeropoint\dimen8=-\dimen8\relax\fi
- \advance\scratchcounter\plusone
- \ifdim\dimen8<.5\lineheight
- \exitloop
- \else\ifnum\outputstreamsplittolerance>\zeropoint
- \ifnum\scratchcounter>\outputstreamsplittolerance\relax
- \exitloop
- \else
- \advance\scratchdimen\lineheight
- \fi
- \else\ifnum\outputstreamsplittolerance<\zeropoint
- \ifnum-\scratchcounter<\outputstreamsplittolerance\relax
- \exitloop
- \else
- \advance\scratchdimen-\lineheight
- \fi
- \else\ifnum\outputstreamsplittolerance=\zeropoint
- \exitloop
- \fi\fi\fi\fi
- \fi\fi}%
- \setbox0\vsplit\outputstreamtag\firstoutputstream to \scratchdimen
- \setbox0\vbox to \textheight
- {\presetoutputstream
- \directsetup{stream:\firstoutputstream:top}%
- \unvbox0
- \vfill
- \directsetup{stream:\firstoutputstream:bottom}}%
- \setbox2\vsplit\outputstreamtag\secondoutputstream to \scratchdimen
- \setbox2\vbox to \textheight
- {\presetoutputstream
- \directsetup{stream:\secondoutputstream:top}%
- \unvbox2
- \vfill
- \directsetup{stream:\secondoutputstream:bottom}}%
- \directsetup{stream:\firstoutputstream:reset}%
- \directsetup{stream:\secondoutputstream:reset}%
- \page[even]
- \box0\vfill\page
- \box2\vfill\page
- \egroup}
-
- %D Although one can put floats in a stream, it sometimes makes sense
- %D to keep them apart and this is what local floats do.
-
- \def\setuplocalfloats
- {\getparameters[\??lf]}
-
- \setuplocalfloats
- [%before=\blank,
- %after=\blank,
- inbetween=\blank]
-
- \installfloathandler \v!local \somelocalfloat
-
- \initializeboxstack{localfloats}
-
- \newcounter\noflocalfloats
-
- \def\resetlocalfloats
- {\doglobal\newcounter\noflocalfloats
- \initializeboxstack{localfloats}}
-
- \def\somelocalfloat[#1]%
- {\doglobal\increment\noflocalfloats
- \savebox{localfloats}{\noflocalfloats}{\box\floatbox}}
-
- \def\getlocalfloats
- {\dorecurse\noflocalfloats
- {\ifnum\recurselevel=\plusone % 1\relax
- \getvalue{\??lf\c!before}%
- \else
- \getvalue{\??lf\c!inbetween}%
- \fi
- \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}%
- \ifnum\recurselevel=\noflocalfloats\relax
- \getvalue{\??lf\c!after}%
- \fi}}
-
- \def\flushlocalfloats
- {\getlocalfloats
- \resetlocalfloats}
-
- \def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}}
-
- \def\forcelocalfloats{\let\forcedfloatmethod\v!local}
-
-%D Because many arrangements are possible, we will implement
-%D some examples in a runtime loadable module \type {m-streams}.
+\def\flushoutputstream [#1]{\ctxlua{streams.flush("#1")}}
+\def\outputstreamcopy [#1]{\vbox{\ctxlua{streams.flush("#1",true)}}}
+\def\outputstreambox [#1]{\vbox{\ctxlua{streams.flush("#1")}}}
+\def\outputstreamunvcopy[#1]{\ctxlua{streams.flush("#1",true)}}
+\def\outputstreamunvbox [#1]{\ctxlua{streams.flush("#1")}}
+\def\synchronizestreams [#1]{\ctxlua{streams.synchronize("#1")}}
+\def\dopushoutputstream [#1]{\ctxlua{streams.push("#1")}}
+
+\def\pushoutputstream {\dosingleempty\dopushoutputstream}
+
+% \unexpanded\def\defineoutputstream[#1]%
+% {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}}
+%
+% \def\useoutputstream[#1]%
+% {\writestatus{otr}{using output stream #1}%
+% \xdef\currentoutputstream{#1}}
+%
+% \directsetup{stream:\firstoutputstream:set}
+% \directsetup{stream:\firstoutputstream:top}
+% \directsetup{stream:\firstoutputstream:bottom}
+% \directsetup{stream:\firstoutputstream:reset}
+
+%D Obsolete in \MKIV:
+
+\unexpanded\def\definemarknote {\dodoubleempty\dodefinemarknote}
+\def\dodefinemarknote[#1][#2]{}
+\def\setmarknote [#1]{\gobbleoneargument}
+\def\flushmarknotes [#1]{}
+\def\erasemarknotes [#1]{}
\protect \endinput
+
+% \enabletrackers[streams.flushing]
+%
+% \setuplayout[grid=yes] \showgrid
+%
+% \starttext
+%
+% \input tufte
+%
+% \startoutputstream[nl]
+%
+% Wat doen we hier?
+%
+% \enableoutputstream[en]
+%
+% Are you sleeping, brother John?\footnote{xxx}
+%
+% \dorecurse{4}{x \footnote{note \recurselevel}\input tufte \par \pushoutputstream}
+%
+% \enableoutputstream[de]
+%
+% Bruder Jakob, schläfst du noch?\footnote{yyy}
+%
+% \dorecurse{4}{x \footnote{note \recurselevel}\input ward \par \pushoutputstream}
+%
+% \disableoutputstream
+%
+% \stopoutputstream
+%
+% Vader Jacob, slaap je nog?\footnote{zzz}
+%
+% \input tufte
+%
+% \synchronizestreams[en,de,nl]
+%
+% \page \flushoutputstream[en] \input knuth
+% \page \flushoutputstream[de] \input knuth
+% \page \flushoutputstream[nl] \input knuth
+%
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/page-txt.mkiv b/Master/texmf-dist/tex/context/base/page-txt.mkiv
index f4e2d76f94c..bdc7c1bb6cd 100644
--- a/Master/texmf-dist/tex/context/base/page-txt.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-txt.mkiv
@@ -64,7 +64,7 @@
%D \showsetup{setupfooter}
%D \showsetup{setupbottom}
-\def\setuplayouttext
+\unexpanded\def\setuplayouttext
{\dotripleempty\dosetuplayouttext}
\def\dosetuplayouttext[#1][#2][#3]% beware, non global
@@ -86,11 +86,11 @@
\fi
\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]}
+\unexpanded\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]}
+\unexpanded\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]}
+\unexpanded\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]}
+\unexpanded\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]}
+\unexpanded\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]}
%D \macros
%D {noheaderandfooterlines,notopandbottomlines}
@@ -125,11 +125,11 @@
%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 ]}
+\unexpanded\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]}
+\unexpanded\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]}
+\unexpanded\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]}
+\unexpanded\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]}
+\unexpanded\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]}
%D The left, right and center variables can also be set
%D directly using the previously discussed macros.
@@ -192,12 +192,12 @@
%D The next macro will be cleaned up and made less messy and
%D dependent.
-\def\placetextlinestrut#1%
+\unexpanded\def\placetextlinestrut#1%
{\doifvalue{#1\c!strut}\v!yes{\setstrut\strut}}
\def\dosingletexts#1#2#3#4#5#6%
{\bgroup
- \defconvertedargument\ascii{#6}% no longer \defconvertedargument
+ \defconvertedargument\ascii{#6}% no longer \defconvertedargument, this also does not permit \v!pagenumber (i.e. v!)
\ifx\ascii\empty\else
\dostartattributes{\??tk#1#2}#3#4\empty
\placetextlinestrut{\??tk#1}% here !
@@ -236,13 +236,26 @@
%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\settextlinestatus#1%
- {\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}}
+ {\ifcase0\csname\??tk#1\c!n\endcsname\relax
+ \edef\textlinestatus{\csname\??tk#1\c!state\endcsname}%
+ \else
+ \setxvalue{\??tk#1\c!n}{\the\numexpr\csname\??tk#1\c!n\endcsname-1}%
+ \let\textlinestatus\v!stop
+ \fi}
+
+\appendtoks
+ \doifinset\v!header\floatspecification{\setxvalue{\??tk\v!header\c!n}{1}}%
+ \doifinset\v!footer\floatspecification{\setxvalue{\??tk\v!footer\c!n}{1}}%
+\to \everybeforeflushedpagefloat
\def\resettextlinestatus#1% postpone
{\expandafter\gdef\csname\??tk#1\s!reset\endcsname{\global\expandafter\let\csname\??tk#1\c!state\endcsname\v!normal}}
-\def\placelayouttextline#1% #2
+\unexpanded\def\placelayouttextline#1% #2
{\settextlinestatus#1%
\csname\??tk::\ifcsname\??tk::\textlinestatus\endcsname\textlinestatus\else\s!unknown\fi\endcsname#1} % {#2}
@@ -468,39 +481,6 @@
\hss}%
\dp#1\zeropoint}
-\definepalet
- [layout]
- [grid=red,
- page=green]
-
-\def\addtextgridlayer#1% to be checked for color and layer
- {\ifcase\showgridstate\else % 1=bottom 2=top
- \startcolor[layout:grid]%
- \setgridbox\scratchbox\makeupwidth\textheight % todo: check color
- \setbox#1\hbox
- {\ifcase\showgridstate\or\or\box#1\hskip-\makeupwidth\fi
- \bgroup % color
- \ifcase\layoutcolumns\else
- \gray
- \setlayoutcomponentattribute\v!grid\v!columns
- \hbox \layoutcomponentboxattribute to \makeupwidth
- {\dorecurse\layoutcolumns
- {\hskip\layoutcolumnwidth
- \ifnum\recurselevel<\layoutcolumns
- \vrule
- \!!height\ht\scratchbox
- \!!depth\dp\scratchbox
- \!!width\layoutcolumndistance
- \fi}}%
- \hskip-\makeupwidth
- \fi
- \setlayoutcomponentattribute\v!grid\v!lines
- \hbox \layoutcomponentboxattribute{\box\scratchbox}%
- \egroup
- \ifcase\showgridstate\or\hskip-\makeupwidth\box#1\fi}%
- \stopcolor
- \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.
@@ -624,7 +604,7 @@
\fi
\ifdim\rightedgewidth>\zeropoint
\hskip\rightedgedistance
- \dododoplacelayouttextline\rightedgewidth\currentlayouttextline\v!edge{\thelayoutrightedgeline#1}%
+ \dododoplacelayouttextline\rightedgewidth\currentlayouttextline\v!edge{\thelayoutrightedgeline#3}%
\fi}}
\def\thelayoutleftedgeline#1%
@@ -722,20 +702,15 @@
%D This code will move to \type {page-flt.tex}.
-\appendtoks
- \plaatsrechtermargeblok \hskip-\rightmarginwidth
-\to \rightmargintextcontent
-
-\appendtoks
- \plaatslinkermargeblok \hskip-\leftmarginwidth
-\to \leftmargintextcontent
+\appendtoks \placerightmarginblock \hskip-\rightmarginwidth \to \rightmargintextcontent
+\appendtoks \placeleftmarginblock \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}
+ \unexpanded\def\placepositionanchors{\vskip\textheight}
\fi
%D \macros
@@ -759,7 +734,7 @@
%D \chapter{tweede} \dorecurse{20}{\input tufte \relax}
%D \stoptyping
-\def\definetext
+\unexpanded\def\definetext
{\doseventupleempty\dodefinetext}
\def\dodefinetext[#1][#2][#3][#4][#5][#6][#7]%
@@ -778,25 +753,25 @@
%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!text] [] []
\setupheadertexts [\v!margin] [] []
-\setupheadertexts [\v!edge] [] []
+\setupheadertexts [\v!edge] [] []
-\setupfootertexts [\v!text] [] []
+\setupfootertexts [\v!text] [] []
\setupfootertexts [\v!margin] [] []
-\setupfootertexts [\v!edge] [] []
+\setupfootertexts [\v!edge] [] []
-\setuptexttexts [\v!text] [] []
+\setuptexttexts [\v!text] [] []
\setuptexttexts [\v!margin] [] []
-\setuptexttexts [\v!edge] [] []
+\setuptexttexts [\v!edge] [] []
-\setupbottomtexts [\v!text] [] []
+\setupbottomtexts [\v!text] [] []
\setupbottomtexts [\v!margin] [] []
-\setupbottomtexts [\v!edge] [] []
+\setupbottomtexts [\v!edge] [] []
-\setuptoptexts [\v!text] [] []
+\setuptoptexts [\v!text] [] []
\setuptoptexts [\v!margin] [] []
-\setuptoptexts [\v!edge] [] []
+\setuptoptexts [\v!edge] [] []
% alternative
%
@@ -860,11 +835,11 @@
%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!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
+\setupheader[\c!state=\v!normal,\c!n=0,\c!before=, \c!after=\vss,\c!strut=\v!yes]
+\setuptext [\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
+\setupfooter[\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=, \c!strut=\v!yes]
+\setupbottom[\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=]
\setuptop [\c!style=,\c!color=]
\setupheader[\c!style=,\c!color=]
diff --git a/Master/texmf-dist/tex/context/base/ppchtex.mkii b/Master/texmf-dist/tex/context/base/ppchtex.mkii
index 285b0004ecd..045e9808b6b 100644
--- a/Master/texmf-dist/tex/context/base/ppchtex.mkii
+++ b/Master/texmf-dist/tex/context/base/ppchtex.mkii
@@ -1477,7 +1477,6 @@
\getvalue{\s!chemicallinesegment#22}%
\undochemicaloffset}
-
\def\getprivatechemicallinesegment[#1][#2]%
{\chemicalrotate[#1]%
\getvalue{\s!chemicallinesegment#2#1}}
@@ -1531,8 +1530,104 @@
\def\processchemicalunrotatedlinesegment#1%
{\doprocesschemicallinesegment3{#1}\getchemicallinesegment}
-\def\processchemicaldashedlinesegment%
+\def\processchemicaldashedlinesegment
{\doprocesschemicallinesegment4c\getchemicallinesegment}
+
+\def\plotchemicaldasheddeltaline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ z20 = z2 rotatedaround(z1,+5) ;
+ z21 = z2 rotatedaround(z1,-5) ;
+ draw (z1 rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ save n ; n := 5 ;
+ for i=1 upto n :
+ draw ((((z20--z21) shifted -z2) shifted (i/n)[z2,z1])
+ rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ endfor
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\plotchemicalwavyline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ save d ; pair d ;
+ d := z2 rotatedaround(z1,+5) shifted -z2 ;
+ save n ; n := 4 ;
+ draw ((for i=0 upto n-1 :
+ ((i)/n)[z1,z2] ..
+ ((i+.25)/n)[z1,z2] shifted d ..
+ ((i+.50)/n)[z1,z2] ..
+ ((i+.75)/n)[z1,z2] shifted -d ..
+ endfor
+ z2) rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\processchemicaldasheddeltalinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicaldasheddeltaline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
+
+\def\processchemicalwavylinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicalwavyline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
\def\processchemicalopenend#1#2%
{\doprocesschemicallinesegment0c\doprocesschemicalopenend{#1}{#2}}
@@ -2395,6 +2490,8 @@
DB##3##4##5=>\processchemicallinesegment{DB}{##3##4##5},
SB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5},
BB##3##4##5=>\processchemicaldeltalinesegment{SB}{##3##4##5},
+ BD##3##4##5=>\processchemicaldasheddeltalinesegment{SB}{##3##4##5},
+ BW##3##4##5=>\processchemicalwavylinesegment{SB}{##3##4##5},
SD##3##4##5=>\processchemicaldashedlinesegment{SB}{##3##4##5},
TB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5}%
\processchemicallinesegment{DB}{##3##4##5},
diff --git a/Master/texmf-dist/tex/context/base/ppchtex.mkiv b/Master/texmf-dist/tex/context/base/ppchtex.mkiv
index f0fc54bcc47..e81551eeab2 100644
--- a/Master/texmf-dist/tex/context/base/ppchtex.mkiv
+++ b/Master/texmf-dist/tex/context/base/ppchtex.mkiv
@@ -414,7 +414,7 @@
\let\@@localchemicalstyle\empty
-\def\setupchemicalformat[#1]%
+\unexpanded\def\setupchemicalformat[#1]%
{\processaction
[\getvalue{#1\c!size}]
[ \v!small=>\def\@@localchemicalformat{\scriptscriptstyle},
@@ -449,7 +449,7 @@
\setupchemicalformat[\??chemical\s!chemical]%
\ignorespaces}
-\def\setupchemical
+\unexpanded\def\setupchemical
{\dosingleargument\dosetupchemical}
\def\@@dochemicalstyle% % default mapping
@@ -729,11 +729,11 @@
\def\@@chemicalpostponed{}%
\complexorsimpleempty\startchemical}
-\def\startchemical
+\unexpanded\def\startchemical
{\bgroup % t.b.v. ungrouped floats
\dostartchemical}
-\def\stopchemical
+\unexpanded\def\stopchemical
{\checkchemicalpicture
\@@endchemicalpicture
\egroup
@@ -1455,8 +1455,104 @@
\def\processchemicalunrotatedlinesegment#1%
{\doprocesschemicallinesegment3{#1}\getchemicallinesegment}
-\def\processchemicaldashedlinesegment%
+\def\processchemicaldashedlinesegment
{\doprocesschemicallinesegment4c\getchemicallinesegment}
+
+\def\plotchemicaldasheddeltaline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ z20 = z2 rotatedaround(z1,+5) ;
+ z21 = z2 rotatedaround(z1,-5) ;
+ draw (z1 rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ save n ; n := 5 ;
+ for i=1 upto n :
+ draw ((((z20--z21) shifted -z2) shifted (i/n)[z2,z1])
+ rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ endfor
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\plotchemicalwavyline#1#2#3#4%
+ {\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
+ \ifnum\chemicaldrawingmode=2
+ \global\MPdrawingdonetrue
+ \setchemicalattributes
+ \startMPdrawing
+ x0 := \MPdivten[\chemicalxoffset]u ;
+ y0 := \MPdivten[\chemicalyoffset]u ;
+ x1 := \MPdivten[\the\!!counta]u ;
+ y1 := \MPdivten[\the\!!countb]u ;
+ x2 := \MPdivten[\the\!!countc]u ;
+ y2 := \MPdivten[\the\!!countd]u ;
+ save d ; pair d ;
+ d := z2 rotatedaround(z1,+5) shifted -z2 ;
+ save n ; n := 4 ;
+ draw ((for i=0 upto n-1 :
+ ((i)/n)[z1,z2] ..
+ ((i+.25)/n)[z1,z2] shifted d ..
+ ((i+.50)/n)[z1,z2] ..
+ ((i+.75)/n)[z1,z2] shifted -d ..
+ endfor
+ z2) rotatedaround(origin,-\chemicalangle)) shifted z0 ;
+ \stopMPdrawing
+ \account{#1}{#2}%
+ \account{#3}{#4}%
+ \else
+ \doplotchemicalline
+ \advance\!!countc by 16 \advance\!!countd by -21
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -8 \advance\!!countd by 14
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \advance\!!countc by -4 \advance\!!countd by 7
+ \doplotchemicalline
+ \fi}
+
+\def\processchemicaldasheddeltalinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicaldasheddeltaline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
+
+\def\processchemicalwavylinesegment#1#2%
+ {\bgroup
+ \def\plotchemicalline{\plotchemicalwavyline}%
+ \doprocesschemicallinesegment0c\getchemicallinesegment{#1}{#2}%
+ \egroup}
\def\processchemicalopenend#1#2%
{\doprocesschemicallinesegment0c\doprocesschemicalopenend{#1}{#2}}
@@ -2177,7 +2273,7 @@
{\writestatus{ppchtex}{chemical definition #1 is redefined}}%
\setvalue{\??chemical#1}{#2}}
-\def\definechemical%
+\unexpanded\def\definechemical%
{\dosingleargument\dodefinechemical}
\def\getpredefinedchemical#1%
@@ -2227,6 +2323,9 @@
% afstand dubbele radikalen : 260
% afstand substituenten : +125
+
+
+
\def\executechemicalONE[#1]%
{\setchemicalname ONE
%
@@ -2312,6 +2411,8 @@
DB##3##4##5=>\processchemicallinesegment{DB}{##3##4##5},
SB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5},
BB##3##4##5=>\processchemicaldeltalinesegment{SB}{##3##4##5},
+ BD##3##4##5=>\processchemicaldasheddeltalinesegment{SB}{##3##4##5},
+ BW##3##4##5=>\processchemicalwavylinesegment{SB}{##3##4##5},
SD##3##4##5=>\processchemicaldashedlinesegment{SB}{##3##4##5},
TB##3##4##5=>\processchemicallinesegment{SB}{##3##4##5}%
\processchemicallinesegment{DB}{##3##4##5},
diff --git a/Master/texmf-dist/tex/context/base/pret-lua.lua b/Master/texmf-dist/tex/context/base/pret-lua.lua
index 3faf8108142..8803971f3eb 100644
--- a/Master/texmf-dist/tex/context/base/pret-lua.lua
+++ b/Master/texmf-dist/tex/context/base/pret-lua.lua
@@ -1,11 +1,14 @@
if not modules then modules = { } end modules ['pret-lua'] = {
version = 1.001,
- comment = "companion to buff-ver.tex",
+ comment = "companion to buff-ver.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
+-- this is not a real parser as we also want to typeset wrong output
+-- and a real parser would choke on that
+
local utf = unicode.utf8
local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
@@ -19,6 +22,12 @@ local visualizer = buffers.newvisualizer("lua")
visualizer.identifiers = { }
-- borrowed from scite
+--
+-- depricated:
+--
+-- gcinfo unpack getfenv setfenv loadlib
+-- table.maxn table.getn table.setn
+-- math.log10 math.mod math.modf math.fmod
visualizer.identifiers.core = {
"and", "break", "do", "else", "elseif", "end", "false", "for", "function",
@@ -27,15 +36,15 @@ visualizer.identifiers.core = {
}
visualizer.identifiers.base = {
- "assert", "collectgarbage", "dofile", "error", "gcinfo", "loadfile",
+ "assert", "collectgarbage", "dofile", "error", "loadfile",
"loadstring", "print", "rawget", "rawset", "require", "tonumber",
- "tostring", "type", "unpack",
+ "tostring", "type",
}
visualizer.identifiers.five = {
- "_G", "getfenv", "getmetatable", "ipairs", "loadlib", "next", "pairs",
- "pcall", "rawequal", "setfenv", "setmetatable", "xpcall", "string", "table",
- "math", "coroutine", "io", "os", "debug", "load", "module", "select"
+ "_G", "getmetatable", "ipairs", "next", "pairs",
+ "pcall", "rawequal", "setmetatable", "xpcall", "string", "table",
+ "math", "coroutine", "io", "os", "debug", "load", "module", "select",
}
visualizer.identifiers.libs = {
@@ -43,7 +52,7 @@ visualizer.identifiers.libs = {
"coroutine.create", "coroutine.resume", "coroutine.status", "coroutine.wrap",
"coroutine.yield", "coroutine.running",
-- package
- "package.cpath", "package.loaded", "package.loadlib", "package.path",
+ "package.cpath", "package.loaded", "package.loadlib", "package.path", "package.config",
-- io
"io.close", "io.flush", "io.input", "io.lines", "io.open", "io.output",
"io.read", "io.tmpfile", "io.type", "io.write", "io.stdin", "io.stdout",
@@ -51,28 +60,31 @@ visualizer.identifiers.libs = {
-- math
"math.abs", "math.acos", "math.asin", "math.atan", "math.atan2", "math.ceil",
"math.cos", "math.deg", "math.exp", "math.floor math.", "math.ldexp",
- "math.log", "math.log10", "math.max", "math.min math.mod math.pi", "math.pow",
+ "math.log", "math.max", "math.min", "math.pi", "math.pow",
"math.rad", "math.random", "math.randomseed", "math.sin", "math.sqrt",
- "math.tan", "math.cosh", "math.fmod", "math.modf", "math.sinh", "math.tanh",
+ "math.tan", "math.cosh", "math.sinh", "math.tanh",
"math.huge",
-- string
"string.byte", "string.char", "string.dump", "string.find", "string.len",
"string.lower", "string.rep", "string.sub", "string.upper", "string.format",
"string.gfind", "string.gsub", "string.gmatch", "string.match", "string.reverse",
-- table
- "table.maxn", "table.concat", "table.foreach", "table.foreachi", "table.getn",
- "table.sort", "table.insert", "table.remove", "table.setn",
+ "table.concat", "table.foreach", "table.foreachi",
+ "table.sort", "table.insert", "table.remove",
+ "table.pack", "table.unpack",
-- os
"os.clock", "os.date", "os.difftime", "os.execute", "os.exit", "os.getenv",
"os.remove", "os.rename", "os.setlocale", "os.time", "os.tmpname",
-- package
- "package.preload", "package.seeall"
+ "package.preload", "package.seeall",
+ -- bit
+ -- ... todo ...
}
local known_words = { }
-for k,v in pairs(visualizer.identifiers) do
- for _,w in pairs(v) do
+for k,v in next, visualizer.identifiers do
+ for _,w in next, v do
known_words[w] = k
end
end
@@ -131,6 +143,22 @@ end
-- we will also provide a proper parser based pretty printer although normaly
-- a pretty printer should handle faulty code too (educational purposes)
+local function written(state,c,i)
+ if c == " " then
+ state = finish_state(state)
+ texsprint(ctxcatcodes,"\\obs")
+ elseif c == "\t" then
+ state = finish_state(state)
+ texsprint(ctxcatcodes,"\\obs")
+ if buffers.visualizers.enabletab then
+ texsprint(ctxcatcodes,rep("\\obs ",i%buffers.visualizers.tablength))
+ end
+ else
+ texwrite(c)
+ end
+ return state, 0
+end
+
function visualizer.flush_line(str, nested)
local state, instr, inesc, word = 0, false, false, nil
buffers.currentcolors = colors
@@ -162,9 +190,38 @@ function visualizer.flush_line(str, nested)
if pre then
code = pre
end
- local p, s = nil, nil
+ local p, s, i = nil, nil, 0
for c in utfcharacters(code) do
- if c == "[" then
+ i = i + 1
+ if instr then
+ if p then
+ texwrite(p)
+ p = nil
+ end
+ if c == s then
+ if inesc then
+ texwrite(c)
+ inesc = false
+ else
+ state = change_state(states[c],state)
+ instr = false
+ texwrite(c)
+ state = finish_state(state)
+ end
+ s = nil
+ else
+ if c == "\\" then
+ inesc = not inesc
+ else
+ inesc = false
+ end
+ state, i = written(state,c,i)
+ end
+ elseif c == "[" then
+ if word then
+ texwrite(word)
+ word = nil
+ end
if p == "[" then
inlongstring = true
state = change_state(states["[["],state)
@@ -172,9 +229,16 @@ function visualizer.flush_line(str, nested)
state = finish_state(state)
p = nil
else
+ if p then
+ state, i = written(state,p,i)
+ end
p = c
end
elseif c == "]" then
+ if word then
+ texwrite(word)
+ word = nil
+ end
if p == "]" then
inlongstring = false
state = change_state(states["]]"],state)
@@ -182,47 +246,34 @@ function visualizer.flush_line(str, nested)
state = finish_state(state)
p = nil
else
+ if p then
+ state, i = written(state,p,i)
+ end
p = c
end
else
if p then
- state = change_state(states[c],state)
- texwrite(p,c)
+ state = change_state(states[p],state)
+ texwrite(p)
state = finish_state(state)
p = nil
end
- if c == " " then
+ if c == " " or c == "\t" then
if word then
state = flush_lua_word(state,word)
word = nil
end
- texsprint(ctxcatcodes,"\\obs")
+ state, i = written(state,c,i)
elseif inlongstring then
- texwrite(c)
- elseif instr then
- if c == s then
- if inesc then
- texwrite(c)
- inesc = false
- else
- state = change_state(states[c],state)
- instr = false
- texwrite(c)
- state = finish_state(state)
- end
- s = nil
- else
- if c == "\\" then
- inesc = not inesc
- else
- inesc = false
- end
- texwrite(c)
- end
+ state, i = written(state,c,i)
elseif c == '"' or c == "'" then
+if word then
+ state = flush_lua_word(state,word)
+ word = nil
+end
instr = true
state = change_state(states[c],state)
- texwrite(c)
+ state, i = written(state,c,i)
state = finish_state(state)
s = c
elseif find(c,"^[%a]$") then
@@ -239,13 +290,18 @@ function visualizer.flush_line(str, nested)
end
end
end
+ if p then
+ texwrite(p)
+ -- state, i = written(state,p,i)
+ p = nil
+ end
state = flush_lua_word(state,word)
if post then
state = change_state(states['--'], state)
texwrite("--")
state = finish_state(state)
for c in utfcharacters(post) do
- if c == " " then texsprint(ctxcatcodes,"\\obs") else texwrite(c) end
+ state, i = written(state,c,i)
end
end
end
@@ -254,7 +310,10 @@ function visualizer.flush_line(str, nested)
state = change_state(states['--'], state)
texwrite("[[")
state = finish_state(state)
- texwrite(comment)
+ -- texwrite(comment) -- maybe also split and
+ for c in utfcharacters(comment) do
+ state, i = written(state,c,i)
+ end
end
state = finish_state(state)
end
diff --git a/Master/texmf-dist/tex/context/base/pret-mp.lua b/Master/texmf-dist/tex/context/base/pret-mp.lua
index 939065230a2..782adf5f5a2 100644
--- a/Master/texmf-dist/tex/context/base/pret-mp.lua
+++ b/Master/texmf-dist/tex/context/base/pret-mp.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['pret-mp'] = {
version = 1.001,
- comment = "companion to buff-ver.tex",
+ comment = "companion to buff-ver.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -135,8 +135,8 @@ local states = {
local known_words = { }
-for k,v in pairs(visualizer.identifiers) do
- for _,w in pairs(v) do
+for k,v in next, visualizer.identifiers do
+ for _,w in next, v do
known_words[w] = k
end
end
diff --git a/Master/texmf-dist/tex/context/base/pret-tex.lua b/Master/texmf-dist/tex/context/base/pret-tex.lua
index 080075eb81a..5d128fa3b90 100644
--- a/Master/texmf-dist/tex/context/base/pret-tex.lua
+++ b/Master/texmf-dist/tex/context/base/pret-tex.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['pret-tex'] = {
version = 1.001,
- comment = "companion to buff-ver.tex",
+ comment = "companion to buff-ver.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -37,9 +37,10 @@ local chardata = characters.data
local is_letter = characters.is_letter
function visualizer.flush_line(str,nested)
- local state, first = 0, false
+ local state, first, i = 0, false, 0
buffers.currentcolors = colors
for c in utfcharacters(str) do
+ i = i + 1
if c == " " then
state = finish_state(state)
texsprint(ctxcatcodes,"\\obs")
@@ -49,6 +50,7 @@ function visualizer.flush_line(str,nested)
texsprint(ctxcatcodes,"\\obs")
if buffers.visualizers.enabletab then
texsprint(ctxcatcodes,rep("\\obs ",i%buffers.visualizers.tablength))
+ i = 0
end
first = false
elseif first then
diff --git a/Master/texmf-dist/tex/context/base/pret-xml.lua b/Master/texmf-dist/tex/context/base/pret-xml.lua
new file mode 100644
index 00000000000..b11dccb99c3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/pret-xml.lua
@@ -0,0 +1,136 @@
+if not modules then modules = { } end modules ['pret-xml'] = {
+ version = 1.001,
+ comment = "companion to buff-ver.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- line by line, no check because can be snippet (educational) and
+-- a somewhat simplified view on xml; we forget about dtd's and
+-- cdata (some day i'll make a visualizer for valid xml using the
+-- built in parser)
+
+local utf = unicode.utf8
+
+local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
+local utfbyte, utffind = utf.byte, utf.find
+local rep = string.rep
+local texsprint, texwrite = tex.sprint, tex.write
+local ctxcatcodes = tex.ctxcatcodes
+
+local visualizer = buffers.newvisualizer("xml")
+
+local colors = {
+ "prettytwo",
+ "prettyone",
+ "prettythree",
+ "prettyfour"
+}
+
+local states = {
+ ['"']=2, ["'"]=2,
+ ["-"]=1, ["?"]=1, ["!"]=1, [":"]=1, ["_"]=1, ["/"]=1,
+}
+
+local change_state, finish_state = buffers.change_state, buffers.finish_state
+
+local state, intag, dotag, inentity, inquote
+
+function visualizer.reset()
+ state, intag, dotag, inentity, inquote = 0, false, false, false, false
+end
+
+function visualizer.flush_line(str,nested)
+ buffers.currentcolors = colors
+ for c in utfcharacters(str) do
+ if c == "&" then
+ inentity = true -- no further checking
+ state = change_state(3, state)
+ texwrite(c)
+ elseif c == ";" then
+ if inentity then
+ inentity = false
+ state = change_state(3, state)
+ texwrite(c)
+ state = finish_state(state)
+ else
+ texwrite(c)
+ end
+ elseif inentity then
+ state = change_state(3, state)
+ texwrite(c)
+ elseif c == " " then
+ state = finish_state(state)
+ texsprint(ctxcatcodes,"\\obs")
+ intag = false
+ elseif c == "\t" then
+ state = finish_state(state)
+ texsprint(ctxcatcodes,"\\obs")
+ if buffers.visualizers.enabletab then
+ texsprint(ctxcatcodes,rep("\\obs ",i%buffers.visualizers.tablength))
+ end
+ intag = false
+ elseif c == "<" then
+ if intag then
+ state = finish_state(state)
+ -- error
+ else
+ intag = 1
+ dotag = true
+ state = change_state(1, state)
+ end
+ texwrite(c)
+ elseif c == ">" then
+ if intag then
+ texwrite(c)
+ state = finish_state(state)
+ intag, dotag = false, false
+ elseif dotag then
+ state = change_state(1, state)
+ texwrite(c)
+ state = finish_state(state)
+ intag, dotag = false, false
+ else
+ state = finish_state(state)
+ texwrite(c)
+ end
+ elseif intag then
+ if utffind(c,"^[%S]$") then
+ state = change_state(1, state)
+ texwrite(c)
+ intag = intag + 1
+ else
+ intag = false
+ state = finish_state(state)
+ texwrite(c)
+ end
+ elseif dotag then
+ if c == "'" or c == '"' then
+ if inquote then
+ if c == inquote then
+ state = change_state(states[c], state) -- 2
+ texwrite(c)
+ state = finish_state(state)
+ inquote = false
+ else
+ texwrite(c)
+ end
+ else
+ inquote = c
+ state = change_state(states[c], state)
+ texwrite(c)
+ state = finish_state(state)
+ end
+ elseif inquote then
+ texwrite(c)
+ else
+ state = change_state(states[c], state)
+ texwrite(c)
+ end
+ else
+ texwrite(c)
+ end
+ end
+ state = finish_state(state)
+end
diff --git a/Master/texmf-dist/tex/context/base/prop-ini.mkiv b/Master/texmf-dist/tex/context/base/prop-ini.mkiv
index c5df391a76c..97d72582e3f 100644
--- a/Master/texmf-dist/tex/context/base/prop-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/prop-ini.mkiv
@@ -70,7 +70,7 @@
\global\advance\previouspropertylevel\minusone
\global\advance\propertylevel\minusone}
-\def\defineproperty
+\unexpanded\def\defineproperty
{\dotripleempty\dodefineproperty}
\def\dodefineproperty[#1]%
@@ -98,22 +98,22 @@
\letgvalue{\??py\s!check#1}\docheckproperty
\doifelsevalue{\??py#1\c!method}\v!command
{\doifelsevalue{\??py#1\c!global}\v!yes
- {\unexpanded\setgvalue{\e!start#1}{\dostartproperty{#1}}%
- \unexpanded\setgvalue{\e!stop #1}{\dostopproperty}}%
- {\unexpanded\setgvalue{\e!start#1}{\dostartgproperty{#1}}%
- \unexpanded\setgvalue{\e!stop #1}{\dostopgproperty}}}%
+ {\setugvalue{\e!start#1}{\dostartproperty{#1}}%
+ \setugvalue{\e!stop #1}{\dostopproperty}}%
+ {\setugvalue{\e!start#1}{\dostartgproperty{#1}}%
+ \setugvalue{\e!stop #1}{\dostopgproperty}}}%
{\doifelsevalue{\??py#1\c!global}\v!yes
- {\unexpanded\setgvalue{\e!start#2}[##1]{\dostartproperty{##1}}%
- \unexpanded\setgvalue{\e!stop #2}{\dostopproperty}}%
- {\unexpanded\setgvalue{\e!start#2}[##1]{\dostartgproperty{##1}}%
- \unexpanded\setgvalue{\e!stop #2}{\dostopgproperty}}}}
+ {\setugvalue{\e!start#2}[##1]{\dostartproperty{##1}}%
+ \setugvalue{\e!stop #2}{\dostopproperty}}%
+ {\setugvalue{\e!start#2}[##1]{\dostartgproperty{##1}}%
+ \setugvalue{\e!stop #2}{\dostopgproperty}}}}
\def\nododefineproperty[#1][#2][#3]%
{}
\def\doifelseproperty#1{\doifdefinedelse{\??py#1\c!global}}
-\def\setupproperty
+\unexpanded\def\setupproperty
{\dodoubleempty\dosetupproperty}
\def\dosetupproperty[#1][#2]% local
@@ -144,7 +144,7 @@
\def\checkedpropertyparameter#1% only self
{\ifcsname\??py\currentproperty#1\endcsname\csname\??py\currentproperty#1\endcsname\fi}
-\def\definepropertyhandler#1{\setvalue{\??py*#1}}
+\unexpanded\def\definepropertyhandler#1{\setvalue{\??py*#1}}
\def\propertyhandler #1{\getvalue{\??py*#1}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/prop-lay.mkiv b/Master/texmf-dist/tex/context/base/prop-lay.mkiv
index 67e103ffb04..7711dae529a 100644
--- a/Master/texmf-dist/tex/context/base/prop-lay.mkiv
+++ b/Master/texmf-dist/tex/context/base/prop-lay.mkiv
@@ -33,12 +33,12 @@
\let\currentviewerlayer\empty
\to \everypagebody
-\def\startlayerproperty
+\unexpanded\def\startlayerproperty
{\pushmacro\currentviewerlayer % grouped (used in interaction)
\let\currentlayerproperty\currentproperty % can be cross group
\dotriggerviewerlayer\currentlayerproperty}
-\def\stoplayerproperty
+\unexpanded\def\stoplayerproperty
{\popmacro\currentviewerlayer % grouped (used in interaction)
\let\currentlayerproperty\previousproperty % can be cross group
\dotriggerviewerlayer\currentlayerproperty}
@@ -120,7 +120,7 @@
\let\layoutcomponentboxattribute \empty
\def\showlayoutcomponents
- {\ctxlua{viewerlayers.enabled=true}%
+ {\ctxlua{viewerlayers.enable()}%
\let\setlayoutcomponentattribute \dosetlayoutcomponentattribute
\let\resetlayoutcomponentattribute\doresetlayoutcomponentattribute}
diff --git a/Master/texmf-dist/tex/context/base/prop-mis.mkiv b/Master/texmf-dist/tex/context/base/prop-mis.mkiv
index 623b10f13bf..37c1d797396 100644
--- a/Master/texmf-dist/tex/context/base/prop-mis.mkiv
+++ b/Master/texmf-dist/tex/context/base/prop-mis.mkiv
@@ -21,16 +21,28 @@
\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.
+% D Overprint cum suis.
+%
+% \defineproperty[\v!overprint][\s!overprint] [\c!method=\v!command]
+% \defineproperty[\v!knockout] [\s!overprint] [\c!method=\v!command]
+%
+% \definepropertyhandler \v!overprint {\dotriggeroverprint\v!overprint}
+% \definepropertyhandler \v!knockout {\dotriggeroverprint\v!knockout }
+%
+% \unexpanded\def\startoverprintproperty{\dotriggeroverprint\v!overprint}
+% \unexpanded\def\stopoverprintproperty {\dotriggeroverprint\v!knockout }
+
+%D Negative cum suis.
\defineproperty [\v!negative] [\s!negative] [\c!method=\v!command]
\defineproperty [\v!positive] [\s!negative] [\c!method=\v!command]
+\definepropertyhandler \v!negative {\dotriggernegative\v!negative}
+\definepropertyhandler \v!positive {\dotriggernegative\v!positive}
+
+\unexpanded\def\startnegativeproperty{\dotriggernegative\v!negative}
+\unexpanded\def\stopnegativeproperty {\dotriggernegative\v!positive}
+
%D Special font effects.
\setupproperty
@@ -46,24 +58,6 @@
\defineproperty [\v!stretch] [\s!effect] [\c!stretch=1]
-%D Overprint cum suis.
-
-\definepropertyhandler \v!overprint {\dotriggeroverprint\v!overprint}
-\definepropertyhandler \v!knockout {\dotriggeroverprint\v!knockout }
-
-\def\startoverprintproperty{\dotriggeroverprint\v!overprint}
-\def\stopoverprintproperty {\dotriggeroverprint\v!knockout }
-
-%D Negative cum suis.\def\dotriggeroverprint#1{\csname(os:#1)\endcsname}
-
-\definepropertyhandler \v!negative {\dotriggernegative\v!negative}
-\definepropertyhandler \v!positive {\dotriggernegative\v!positive}
-
-\def\startnegativeproperty{\dotriggernegative\v!negative}
-\def\stopnegativeproperty {\dotriggernegative\v!positive}
-
-%D Effects.
-
\def\mktriggereffect#1%
{\dotriggereffect{#1}{\propertyparameter{#1}\c!stretch}{\propertyparameter{#1}\c!rulethickness}}
@@ -74,7 +68,7 @@
\definepropertyhandler \v!hidden {\mktriggereffect\v!hidden}
\definepropertyhandler \v!stretch{\mktriggereffect\v!normal}
-\def\starteffectproperty{\mktriggereffect\currentproperty}
-\def\stopeffectproperty {\mktriggereffect\v!normal }
+\unexpanded\def\starteffectproperty{\mktriggereffect\currentproperty}
+\unexpanded\def\stopeffectproperty {\mktriggereffect\v!normal }
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-1.lua b/Master/texmf-dist/tex/context/base/regi-8859-1.lua
index affc65762b4..b8f0a857311 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-1.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-1.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-1.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-1'] = {
+ 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"
+}
-regimes.data["8859-1"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-1"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-10.lua b/Master/texmf-dist/tex/context/base/regi-8859-10.lua
index 2b1d2d4ab74..574d4ac50cc 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-10.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-10.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-10.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-10'] = {
+ 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"
+}
-regimes.data["8859-10"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A,
- 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B,
- 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-10"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A,
+ 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B,
+ 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF,
+ 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
+ 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-11.lua b/Master/texmf-dist/tex/context/base/regi-8859-11.lua
index f6ff34b6950..1910bbb5d0a 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-11.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-11.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-11.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-11'] = {
+ 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"
+}
-regimes.data["8859-11"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
+regimes.data["8859-11"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
+ 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
+ 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
+ 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
+ 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-13.lua b/Master/texmf-dist/tex/context/base/regi-8859-13.lua
index 13b631e9bcb..a6f71cb7865 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-13.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-13.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-13.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-13'] = {
+ 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"
+}
-regimes.data["8859-13"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
+regimes.data["8859-13"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
+ 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
+ 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
+ 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-14.lua b/Master/texmf-dist/tex/context/base/regi-8859-14.lua
index ae349ed3619..0c34748659b 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-14.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-14.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-14.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-14'] = {
+ 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"
+}
-regimes.data["8859-14"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178,
- 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-14"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178,
+ 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-15.lua b/Master/texmf-dist/tex/context/base/regi-8859-15.lua
index 14891c7ffe3..a5626d6537b 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-15.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-15.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-15.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-15'] = {
+ 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"
+}
-regimes.data["8859-15"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-15"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-16.lua b/Master/texmf-dist/tex/context/base/regi-8859-16.lua
index 426c43773bd..817b41db2f1 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-16.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-16.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-16.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-16'] = {
+ 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"
+}
-regimes.data["8859-16"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x0105, 0x0141, 0x20AC, 0x201E, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x0218, 0x00AB, 0x0179, 0x00AD, 0x017A, 0x017B,
- 0x00B0, 0x00B1, 0x010C, 0x0142, 0x017D, 0x201D, 0x00B6, 0x00B7, 0x017E, 0x010D, 0x0219, 0x00BB, 0x0152, 0x0153, 0x0178, 0x017C,
- 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0106, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x0110, 0x0143, 0x00D2, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x015A, 0x0170, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0118, 0x021A, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-16"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0104, 0x0105, 0x0141, 0x20AC, 0x201E, 0x0160, 0x00A7, 0x0161, 0x00A9, 0x0218, 0x00AB, 0x0179, 0x00AD, 0x017A, 0x017B,
+ 0x00B0, 0x00B1, 0x010C, 0x0142, 0x017D, 0x201D, 0x00B6, 0x00B7, 0x017E, 0x010D, 0x0219, 0x00BB, 0x0152, 0x0153, 0x0178, 0x017C,
+ 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0106, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x0110, 0x0143, 0x00D2, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x015A, 0x0170, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0118, 0x021A, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x0107, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0111, 0x0144, 0x00F2, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x015B, 0x0171, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0119, 0x021B, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-2.lua b/Master/texmf-dist/tex/context/base/regi-8859-2.lua
index 98988cd8e07..7ae59d0fa22 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-2.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-2.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-2.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-2'] = {
+ 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"
+}
-regimes.data["8859-2"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B,
- 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
+regimes.data["8859-2"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B,
+ 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C,
+ 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
+ 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
+ 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-3.lua b/Master/texmf-dist/tex/context/base/regi-8859-3.lua
index ab94e5a772d..a83d63bac72 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-3.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-3.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-3.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-3'] = {
+ 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"
+}
-regimes.data["8859-3"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B,
- 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C,
- 0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-3"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B,
+ 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C,
+ 0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0000, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-4.lua b/Master/texmf-dist/tex/context/base/regi-8859-4.lua
index 07928559060..939d55026f9 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-4.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-4.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-4.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-4'] = {
+ 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"
+}
-regimes.data["8859-4"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF,
- 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B,
- 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A,
- 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF,
- 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B,
+regimes.data["8859-4"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF,
+ 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B,
+ 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A,
+ 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF,
+ 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B,
0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-5.lua b/Master/texmf-dist/tex/context/base/regi-8859-5.lua
index 5f6df9242e0..ab093d139a8 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-5.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-5.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-5.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-5'] = {
+ 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"
+}
-regimes.data["8859-5"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
+regimes.data["8859-5"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F,
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-6.lua b/Master/texmf-dist/tex/context/base/regi-8859-6.lua
index 86ed0b262e3..e094129f271 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-6.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-6.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-6.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-6'] = {
+ 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"
+}
-regimes.data["8859-6"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0000, 0x0000, 0x0000, 0x00A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x060C, 0x00AD, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x061B, 0x0000, 0x0000, 0x0000, 0x061F,
- 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F,
+regimes.data["8859-6"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0000, 0x0000, 0x0000, 0x00A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x060C, 0x00AD, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x061B, 0x0000, 0x0000, 0x0000, 0x061F,
+ 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
+ 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F,
0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-7.lua b/Master/texmf-dist/tex/context/base/regi-8859-7.lua
index bb110fbfa42..cee253582f4 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-7.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-7.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-7.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-7'] = {
+ 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"
+}
-regimes.data["8859-7"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+regimes.data["8859-7"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x2018, 0x2019, 0x00A3, 0x20AC, 0x20AF, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x037A, 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
+ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
+ 0x03B0, 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, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-8.lua b/Master/texmf-dist/tex/context/base/regi-8859-8.lua
index a6821499add..062b080adf1 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-8.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-8.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-8.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-8'] = {
+ 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"
+}
-regimes.data["8859-8"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
+regimes.data["8859-8"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
+ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-8859-9.lua b/Master/texmf-dist/tex/context/base/regi-8859-9.lua
index 44a3a18abd4..2af118a8c87 100644
--- a/Master/texmf-dist/tex/context/base/regi-8859-9.lua
+++ b/Master/texmf-dist/tex/context/base/regi-8859-9.lua
@@ -1,26 +1,26 @@
--- filename : regi-8859-9.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-8859-9'] = {
+ 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"
+}
-regimes.data["8859-9"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["8859-9"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1250.lua b/Master/texmf-dist/tex/context/base/regi-cp1250.lua
index aa374193aed..a37ca46b4fe 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1250.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1250.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1250.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1250'] = {
+ 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"
+}
-regimes.data["cp1250"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
- 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
- 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
+regimes.data["cp1250"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
+ 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
+ 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
+ 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
+ 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
+ 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1251.lua b/Master/texmf-dist/tex/context/base/regi-cp1251.lua
index 88204df368c..42fe0b34092 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1251.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1251.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1251.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1251'] = {
+ 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"
+}
-regimes.data["cp1251"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
- 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
- 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
- 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
+regimes.data["cp1251"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
+ 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
+ 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
+ 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1252.lua b/Master/texmf-dist/tex/context/base/regi-cp1252.lua
index 910656edfa6..74b2f3761c8 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1252.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1252.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1252.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1252'] = {
+ 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"
+}
-regimes.data["cp1252"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["cp1252"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1253.lua b/Master/texmf-dist/tex/context/base/regi-cp1253.lua
index 6d854e96700..f14a186bb94 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1253.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1253.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1253.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1253'] = {
+ 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"
+}
-regimes.data["cp1253"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+regimes.data["cp1253"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
+ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
+ 0x03B0, 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, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1254.lua b/Master/texmf-dist/tex/context/base/regi-cp1254.lua
index 12f094b4640..76fbe9c49f2 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1254.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1254.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1254.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1254'] = {
+ 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"
+}
-regimes.data["cp1254"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["cp1254"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1255.lua b/Master/texmf-dist/tex/context/base/regi-cp1255.lua
index 77119da565f..9ea807fbdfb 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1255.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1255.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1255.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1255'] = {
+ 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"
+}
-regimes.data["cp1255"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
- 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
+regimes.data["cp1255"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
+ 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1256.lua b/Master/texmf-dist/tex/context/base/regi-cp1256.lua
index 9bd3dbd739b..e77525bcf83 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1256.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1256.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1256.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1256'] = {
+ 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"
+}
-regimes.data["cp1256"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
- 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
- 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
- 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
- 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
+regimes.data["cp1256"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
+ 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
+ 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
+ 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
+ 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
+ 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7, 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1257.lua b/Master/texmf-dist/tex/context/base/regi-cp1257.lua
index d043b256f30..1b5d5337989 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1257.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1257.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1257.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1257'] = {
+ 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"
+}
-regimes.data["cp1257"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
- 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
+regimes.data["cp1257"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
+ 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7, 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
+ 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
+ 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
+ 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9
}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1258.lua b/Master/texmf-dist/tex/context/base/regi-cp1258.lua
index 45fa7eca081..271db30096e 100644
--- a/Master/texmf-dist/tex/context/base/regi-cp1258.lua
+++ b/Master/texmf-dist/tex/context/base/regi-cp1258.lua
@@ -1,26 +1,26 @@
--- filename : regi-cp1258.lua
--- comment : companion to char-reg.tex (in ConTeXt)
--- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
--- copyright: PRAGMA ADE / ConTeXt Development Team
--- license : see context related readme files
-
--- remark : compact version
+if not modules then modules = { } end modules ['regi-cp1258'] = {
+ 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"
+}
-regimes.data["cp1258"] = { [0] =
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0000, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0000, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
- 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
+regimes.data["cp1258"] = { [0] =
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F,
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0000, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0000, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
+ 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF
}
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.lua b/Master/texmf-dist/tex/context/base/regi-ini.lua
index 04b93db35b0..83739760758 100644
--- a/Master/texmf-dist/tex/context/base/regi-ini.lua
+++ b/Master/texmf-dist/tex/context/base/regi-ini.lua
@@ -1,13 +1,13 @@
if not modules then modules = { } end modules ['regi-ini'] = {
version = 1.001,
- comment = "companion to regi-ini.tex",
+ 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"
}
local utf = unicode.utf8
-local char, utfchar = string.char, utf.char
+local char, utfchar, gsub = string.char, utf.char, string.gsub
local texsprint = tex.sprint
local ctxcatcodes = tex.ctxcatcodes
@@ -51,7 +51,7 @@ function regimes.load(regime)
environment.loadluafile("regi-"..regime, 1.001)
if regimes.data[regime] then
regimes.utf[regime] = { }
- for k,v in pairs(regimes.data[regime]) do
+ for k,v in next, regimes.data[regime] do
regimes.utf[regime][char(k)] = utfchar(v)
end
end
@@ -63,7 +63,7 @@ function regimes.translate(line,regime)
if regime and line then
local rur = regimes.utf[regime]
if rur then
- return line:gsub("(.)", rur) -- () redundant
+ return (gsub(line,"(.)",rur)) -- () redundant
end
end
return line
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.mkiv b/Master/texmf-dist/tex/context/base/regi-ini.mkiv
index 5a3be77a2c6..db7a224ac9a 100644
--- a/Master/texmf-dist/tex/context/base/regi-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/regi-ini.mkiv
@@ -25,7 +25,7 @@
%D \macros
%D {defineregimesynonym,trueregimename}
-\def\defineregimesynonym
+\unexpanded\def\defineregimesynonym
{\dodoubleargument\dodefineregimesynonym}
\def\dodefineregimesynonym[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/regi-utf.mkii b/Master/texmf-dist/tex/context/base/regi-utf.mkii
index 01556ab2d04..b3423b15af5 100644
--- a/Master/texmf-dist/tex/context/base/regi-utf.mkii
+++ b/Master/texmf-dist/tex/context/base/regi-utf.mkii
@@ -32,6 +32,7 @@
% ÙÚÛÜùúû
% Ýýÿ
% ß
+% Ţţ
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/s-abr-01.tex b/Master/texmf-dist/tex/context/base/s-abr-01.tex
index 45bca44f235..a55eb95f18d 100644
--- a/Master/texmf-dist/tex/context/base/s-abr-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-abr-01.tex
@@ -315,13 +315,10 @@
\def\NEWPAGE {\SystemSpecialB{newpage}}
\def\NEWLINE {\SystemSpecialB{newline}}
-
\doifmodeelse {mkiv} {
- \def\THANH{Han The Thanh} % todo
+ \unexpanded\def\THANH{H\agrave n Th\ecircumflexacute\ Th\agrave nh}
} {
- \def\THANH{H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh}
+ \unexpanded\def\THANH{H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh}
}
-%def\THANH {H\`an Th\ecircumflexacute\ Th\`anh}
-
\endinput
diff --git a/Master/texmf-dist/tex/context/base/s-chi-00.tex b/Master/texmf-dist/tex/context/base/s-chi-00.tex
index add0b333b00..bec86f6d2f0 100644
--- a/Master/texmf-dist/tex/context/base/s-chi-00.tex
+++ b/Master/texmf-dist/tex/context/base/s-chi-00.tex
@@ -12,7 +12,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\input font-chi.tex % faster than \setupbodyfont[chi]
+\input font-chi.mkii % faster than \setupbodyfont[chi]
\mainlanguage [cn]
diff --git a/Master/texmf-dist/tex/context/base/s-fnt-10.tex b/Master/texmf-dist/tex/context/base/s-fnt-10.tex
index 95e9282b8b2..216d9d2326e 100644
--- a/Master/texmf-dist/tex/context/base/s-fnt-10.tex
+++ b/Master/texmf-dist/tex/context/base/s-fnt-10.tex
@@ -45,6 +45,7 @@ function fonts.show_all()
sprint(tex.ctxcatcodes,format("\\stoptabulatehead"))
sprint(tex.ctxcatcodes,format("\\starttabulate[|l|c|l|p|p|p|]"))
for k, unicode in ipairs(table.sortedkeys(chars)) do
+-- for unicode, _ in table.sortedpairs(chars) do
if unicode >= 0 then
local chr, des, dat = chars[unicode], descs[unicode], data[unicode]
local index = chr.index or 0
diff --git a/Master/texmf-dist/tex/context/base/s-fnt-25.tex b/Master/texmf-dist/tex/context/base/s-fnt-25.tex
index 83a3ee58669..a8b398716c7 100644
--- a/Master/texmf-dist/tex/context/base/s-fnt-25.tex
+++ b/Master/texmf-dist/tex/context/base/s-fnt-25.tex
@@ -11,11 +11,15 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\def\enableshowmathfontvirtual
+ {\ctxlua{fonts.tfm.auto_cleanup=false}}
+
\def\showmathfontcharacters
{\dodoubleempty\doshowmathfontcharacters}
\def\doshowmathfontcharacters[#1][#2]%
{\begingroup
+ \dontcomplain
\doifelsenothing{#1}
{\definedfont[MathRoman*math-text]}
{\definedfont[#1]}%
@@ -40,12 +44,15 @@
\blank}
\def\mathfontlistentryhexdectit#1#2#3%
- {#1: \ruledhbox{\char#2}\enspace#3\par
+ {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par
\advance\leftskip 1em\relax}
\def\mathfontlistentrywdhtdpic#1#2#3#4%
{width: #1, height: #2, depth: #3, italic: #4\par}
+\def\mathfontlistentryresource#1%
+ {virtual: #1\par}
+
\def\mathfontlistentrynext#1#2%
{#1~\ruledhbox{\char#2}}
@@ -76,6 +83,15 @@ function document.showmathfont(id,slot)
local function report(...)
tex.sprint(tex.ctxcatcodes,string.format(...))
end
+ local virtual, names = tfmdata.type == "virtual", { }
+ if virtual then
+ for k, v in ipairs(tfmdata.fonts) do
+ local name = fonts.ids[v.id].name
+ names[k] = (name and file.basename(name)) or v.id
+ end
+ end
+ local round = math.round
+-- print(table.serialize(names))
for _, s in next, sorted do
local char = characters[s]
if char then
@@ -83,7 +99,23 @@ function document.showmathfont(id,slot)
local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants
report("\\startmathfontlistentry")
report("\\mathfontlistentryhexdectit{U+%05X}{%s}{%s}",s,s,string.lower(info.description or "no description, private to font"))
- report("\\mathfontlistentrywdhtdpic{%s}{%s}{%s}{%s}",char.width or 0,char.height or 0,char.depth or 0,char.italic or 0)
+ report("\\mathfontlistentrywdhtdpic{%s}{%s}{%s}{%s}",round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0))
+ if virtual then
+ local commands = char.commands
+ if commands then
+ local t = { }
+ for i=1,#commands do
+ local ci = commands[i]
+ if ci[1] == "slot" then
+ local fnt, idx = ci[2], ci[3]
+ t[#t+1] = string.format("%s/%0X",names[fnt] or fnt,idx)
+ end
+ end
+ if #t > 0 then
+ report("\\mathfontlistentryresource{%s}",table.concat(t,", "))
+ end
+ end
+ end
if info.mathclass then
report("\\mathfontlistentryclassname{%s}{%s}",info.mathclass,info.mathname or "no name")
end
@@ -124,7 +156,7 @@ function document.showmathfont(id,slot)
if choriz_variants then
local t = { }
for k, v in next, choriz_variants do
- t[#t+1] = string.format("\\fontlistentryvariants{%s}",v.glyph)
+ t[#t+1] = string.format("\\fontlistentryvariants{U+%05X}{%s}",v.glyph,v.glyph)
end
choriz_variants = t
end
@@ -147,7 +179,7 @@ end
\endinput
-\startbuffer mathtest
+\startbuffer[mathtest]
\begingroup\mm\mr\showmathfontcharacters\endgroup
\stopbuffer
diff --git a/Master/texmf-dist/tex/context/base/s-fnt-26.tex b/Master/texmf-dist/tex/context/base/s-fnt-26.tex
new file mode 100644
index 00000000000..026abf29be3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-fnt-26.tex
@@ -0,0 +1,73 @@
+%D \module
+%D [ file=s-fnt-26,
+%D version=2009.10.26,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Goodies Tables,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startluacode
+
+ function document.show_goodies_stylistics(name)
+ local goodies = fonts.goodies.get(name)
+ local stylistics = goodies and goodies.stylistics
+ if stylistics then
+ local col, row, type = context.NC, context.NR, context.type
+ context.starttabulate { "|l|pl|" }
+ col() context("feature") col() context("meaning") col() row()
+ for feature, meaning in table.sortedpairs(stylistics) do
+ col() type(feature) col() type(meaning) col() row()
+ end
+ context.stoptabulate()
+ end
+ end
+
+ function document.show_goodies_featuresets(name)
+ local goodies = fonts.goodies.get(name)
+ local featuresets = goodies and goodies.featuresets
+ if featuresets then
+ local col, row, type = context.NC, context.NR, context.type
+ context.starttabulate { "|l|pl|" }
+ col() context("featureset") col() context("definitions") col() row()
+ for featureset, definitions in table.sortedpairs(featuresets) do
+ col() type(featureset) col()
+ for k, v in table.sortedpairs(definitions) do
+ type(string.format("%s=%s",k,tostring(v)))
+ context.quad()
+ end
+ col() row()
+ end
+ context.stoptabulate()
+ end
+ end
+
+ function document.show_goodies_colorschemes(name)
+ local goodies = fonts.goodies.get(name)
+ local colorschemes = goodies and goodies.colorschemes
+ if colorschemes then
+ local col, row, type = context.NC, context.NR, context.type
+ context.starttabulate { "|l|pl|" }
+ col() context("colorscheme") col() context("numbers") col() row()
+ for colorscheme, numbers in table.sortedpairs(colorschemes) do
+ col() type(colorscheme) col()
+ for i=1,#numbers do
+ type(i)
+ context.quad()
+ end
+ col() row()
+ end
+ context.stoptabulate()
+ end
+
+\stopluacode
+
+\def\showgoodiesstylistics #1{\ctxlua{document.show_goodies_stylistics ("#1")}}
+\def\showgoodiesfeaturesets #1{\ctxlua{document.show_goodies_featuresets ("#1")}}
+\def\showgoodiescolorschemes#1{\ctxlua{document.show_goodies_colorschemes("#1")}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/s-inf-01.tex b/Master/texmf-dist/tex/context/base/s-inf-01.tex
new file mode 100644
index 00000000000..a2a693ae214
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-inf-01.tex
@@ -0,0 +1,203 @@
+%D \module
+%D [ file=s-inf-01,
+%D version=2009.07.09,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Information 1 (\MKII/\MKIV\ usage),
+%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 Some day I will generalize this table mechanism.
+
+\startluacode
+ local format, gsub, find, match = string.format, string.gsub, string.find, string.match
+ local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+
+ local list, size, comp, used, nope = { }, { }, { }, { mkii = { }, mkiv = { } }, { 0, 0, 0, 0 }
+
+ local omit = {
+ "char%-def%.lua",
+ "mult%-def%.lua", "mult%-..%.tex", "mult%-m..%.tex",
+ }
+ local skip = {
+ "prag%-.*%.tex", "docs%-.*.tex", "list%-.*%.tex", "test%-.*%.tex", "demo%-.*%.tex",
+ "opti%-.*%.tex", "chrt%-.*%.tex",
+ }
+ local types = {
+ "tex", "mkii", "mkiv", "lua"
+ }
+
+ local function collect(list,suffix,n)
+ local path = file.dirname(resolvers.find_file("context.tex"),".")
+ local pattern = path .. "/*." .. suffix
+ local texfiles = dir.glob(pattern)
+ for _, name in ipairs(texfiles) do
+ local base = file.basename(name)
+ local category = match(base,"^([a-z][a-z][a-z][a-z])%-[a-z0-9]+%.[a-z]+")
+ if category and lfs.isfile(name) then
+ local okay = true
+ for s=1,#skip do
+ if find(base,skip[s]) then
+ okay = false
+ break
+ end
+ end
+ if okay then
+ local lm, sm, cm = list[category], size[category], comp[category]
+ if not lm then
+ lm, sm, cm = { 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+ list[category], size[category], comp[category] = lm, sm, cm
+ end
+ lm[n] = lm[n] + 1
+ local done = true
+ for o=1,#omit do
+ if find(base,omit[o]) then
+ done = false
+ break
+ end
+ end
+ local data = io.loaddata(name)
+ if suffix == "lua" then
+ data = gsub(data,"%-%-%[%[.-%]%]%-%-","")
+ data = gsub(data,"%-%-.-[\n\r]","")
+ else
+ data = gsub(data,"%%.-[\n\r]","")
+ end
+ data = gsub(data,"%s","")
+ sm[n+4] = sm[n+4] + #data
+ if done then
+ sm[n] = sm[n] + #data
+ else
+ cm[n] = cm[n] + 1
+ end
+ end
+ end
+ end
+ end
+
+ local function prepare(what)
+ if next(list) then
+ -- already loaded
+ else
+ for k, v in ipairs(types) do
+ collect(list,v,k)
+ end
+ for category, _ in pairs(list) do
+ pattern ="{"..category.."%-"
+ for suffix, t in pairs(used) do
+ local data = io.loaddata(resolvers.find_file("context."..suffix))
+ if find(data,pattern) then
+ t[category] = true
+ end
+ end
+ end
+ end
+ local max, what = 0, (what == "size" and size) or list
+ for k, v in table.sortedpairs(what) do
+ for i=1,4 do if v[i] > max then max = v[i] end end
+ end
+ return max, what, function(n) return n/max end
+ end
+
+ function document.context_state_1(what)
+ local max, what, norm = prepare(what)
+ texsprint(ctxcatcodes,"\\starttabulate[|Tc|T|T|T|T|]")
+ texsprint(ctxcatcodes,"\\NC category\\NC")
+ for i, t in ipairs(types) do
+ local n, m = 0, 0
+ for k, v in pairs(list) do
+ local nn, mm = what[k][i], what[k][i+4]
+ n = n + nn
+ m = m + (mm or nn)
+ end
+ texsprint(ctxcatcodes,format("\\Top{%s}{%s}{%s}{%s}\\NC",t,norm(max),n,m))
+ end
+ texsprint(ctxcatcodes,"\\NC\\NR\\HL")
+ for k, v in table.sortedpairs(what) do
+ local c = (what == size and comp[k]) or nope
+ local cat = format("%s~%s~~%s",(used.mkii[k] and "ii") or "~~",(used.mkiv[k] and "iv") or "~~",k)
+ texsprint(ctxcatcodes,"\\NC",cat,"\\NC")
+ for i, t in ipairs(types) do
+ texsprint(ctxcatcodes,format("\\Bar{%s}{%s}{%s}{%s}\\NC",t,v[i],c[i],norm(v[i])))
+ end
+ texsprint(ctxcatcodes,"\\NR")
+ end
+ texsprint(ctxcatcodes,"\\stoptabulate")
+ end
+
+ function document.context_state_2(what)
+ local max, what, norm = prepare(what)
+ for k, v in table.sortedpairs(what) do
+ local c = (what == size and comp[k]) or nope
+ texsprint(ctxcatcodes,format("\\StartUp{%s}",k))
+ for i, t in ipairs(types) do
+ texsprint(ctxcatcodes,format("\\Up{%s}{%s}",t,norm(v[i])))
+ end
+ texsprint(ctxcatcodes,"\\StopUp")
+ end
+ end
+
+\stopluacode
+
+\definecolor[bar:tex] [middlegreen]
+\definecolor[bar:mkii][middleblue]
+\definecolor[bar:mkiv][middlered]
+\definecolor[bar:lua] [middlegray]
+
+\def\Top#1#2#3#4%
+ {\hbox to 5em{\hss#3}%
+ \enspace
+ \hbox to #2\dimexpr 20em\relax{#1\ifnum#3=#4\else~#4\rlap{~+}\fi\hss}}
+
+\def\Bar#1#2#3#4%
+ {\ifcase#2\else
+ \hbox to 5em{\hss\ifcase#3\else\llap{-~}\fi#2}%
+ \enspace
+ \blackrule[color=bar:#1,width=#4\dimexpr 20em\relax,height=.8\strutht]%
+ \fi}
+
+\newcount\UpCounter
+
+\def\StartUp#1%
+ {\dontleavehmode\framed[frame=off,align={middle,low},height=18em]\bgroup
+ \def\StopUp
+ {\par\nointerlineskip\blackrule[height=1pt,width=4em,depth=0pt,color=darkgray]%
+ \par\tttf\strut#1\par
+ \egroup
+ \ifnum\UpCounter=17 \par \UpCounter\zerocount\else \kern1em \advance\UpCounter\plusone \fi}}
+
+\def\Up#1#2%
+ {\scratchdimen#2\dimexpr 16em\relax
+ \ifdim\scratchdimen=\zeropoint
+ \kern1em
+ \else
+ \ifdim\scratchdimen<\onepoint \scratchdimen\onepoint \fi
+ \blackrule[color=bar:#1,height=\scratchdimen,width=1em]%
+ \fi}
+
+\def\Show#1#2#3%
+ {\startTEXpage[offset=1em,width=fit]
+ \hbox{\tttf\strut\currentdate~-~#1}
+ \ctxlua{document.context_state_\number#2("#3")}
+ \stopTEXpage}
+
+% \doifnotmode{demo}{\endinput}
+
+\starttext
+ \Show
+ {The number of files used in ConTeXt (modules and styles are excluded).}
+ {1}{number}
+ \Show
+ {The size of (core) files used in ConTeXt (- indicates exclusion of large data files; + indicates inclusion of large data files; comment and spaces removed.)}
+ {1}{size}
+ \Show
+ {The relative number of files used in ConTeXt (tex, mkii, mkiv, lua).}
+ {2}{number}
+ \Show
+ {The relative size of files used in ConTeXt (tex, mkii, mkiv, lua).}
+ {2}{size}
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-inf-02.tex b/Master/texmf-dist/tex/context/base/s-inf-02.tex
new file mode 100644
index 00000000000..77a3f650c51
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-inf-02.tex
@@ -0,0 +1,27 @@
+%D \module
+%D [ file=s-inf-02,
+%D version=2009.11.25,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Information 2 (filenames),
+%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.
+
+\starttext
+
+\starttabulate [|T|T|]
+ \NC \type{\jobname} \NC \jobname \NC \NR
+ \NC \type{\jobfilename} \NC \jobfilename \NC \NR
+ \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC \NR
+ \NC \type{\inputfilename} \NC \inputfilename \NC \NR
+ \NC \type{\inputfilebarename} \NC \inputfilebarename \NC \NR
+ \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC \NR
+ \NC \type{\outputfilename} \NC \outputfilename \NC \NR
+ \NC \type{\operatingsystem} \NC \operatingsystem \NC \NR
+\stoptabulate
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-map-10.tex b/Master/texmf-dist/tex/context/base/s-map-10.tex
index 807ae42efbd..865132f9743 100644
--- a/Master/texmf-dist/tex/context/base/s-map-10.tex
+++ b/Master/texmf-dist/tex/context/base/s-map-10.tex
@@ -102,11 +102,12 @@
\definetypeface[map][tt][mono] [modern] [default][encoding=\typescripttwo]
\definetypeface[map][mm][math] [euler] [default][encoding=\typescripttwo]
- \usemathcollection[eul]
+% \usemathcollection[eul]
\stoptypescript
% activate protruding
+
\setupinterlinespace[line=11pt]
\setupfontsynonym[handling=pure]
diff --git a/Master/texmf-dist/tex/context/base/s-mod-00.tex b/Master/texmf-dist/tex/context/base/s-mod-00.tex
index d16688de553..270f7a9b4c7 100644
--- a/Master/texmf-dist/tex/context/base/s-mod-00.tex
+++ b/Master/texmf-dist/tex/context/base/s-mod-00.tex
@@ -22,7 +22,10 @@
\usemodule[units]
-\enableactivediscretionaries \newprettytrue
+\doifnotmode{mkiv}{
+ \enableactivediscretionaries
+ \newprettytrue
+}
\unprotect
@@ -57,7 +60,8 @@
\getrawparameters[Module][type=tex,#1]}
\def\startmodule
- {\dosingleempty\dostartmodule}
+ {\starttext
+ \dosingleempty\dostartmodule}
\def\complexmodule[#1]%
{\startglobal % i.v.m. \bgroup in \startdocumentation
@@ -71,7 +75,8 @@
[\v!index]
[\c!balance=\v!yes,
\c!indicator=\v!no,
- \c!criterium=\v!text]}
+ \c!criterium=\v!text]
+ \stoptext}
\def\simplemodule#1%
{\type{#1}}
diff --git a/Master/texmf-dist/tex/context/base/s-mod-01.tex b/Master/texmf-dist/tex/context/base/s-mod-01.tex
index dc695a44d72..4454986ce6d 100644
--- a/Master/texmf-dist/tex/context/base/s-mod-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-mod-01.tex
@@ -16,10 +16,19 @@
\usemodule[mod-00,abr-01]
+\dontcomplain
+
\unprotect
\setupbodyfont
- [10pt,ams]
+ [10pt]
+
+\definetypeface
+ [narrowtt] [tt]
+ [mono] [modern-cond] [default] [encoding=\defaultencoding]
+
+\setuptyping[\v!typing][\c!style=\narrowtt]
+\setuptype [\v!type] [\c!style=\narrowtt]
\mainlanguage
[en]
@@ -44,7 +53,7 @@
\c!topspace=2cm,
\c!header=1.25cm,
\c!footer=1.25cm,
- \c!height=25cm,
+ \c!height=middle,
\c!style=\ss]
\setupsetup
@@ -60,9 +69,9 @@
\setuppagenumbering
[\c!location=]
-\setupfootertexts
+\expanded{\setupfootertexts
[\v!edge]
- [][\v!pagenumber]
+ [][\v!pagenumber]}
\startmode[single]
diff --git a/Master/texmf-dist/tex/context/base/s-mod.ctx b/Master/texmf-dist/tex/context/base/s-mod.ctx
new file mode 100644
index 00000000000..a85c991a57b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-mod.ctx
@@ -0,0 +1,24 @@
+<?xml version='1.0' standalone='yes'?>
+
+<ctx:job>
+ <ctx:message>TeX Documentation Generator</ctx:message>
+ <ctx:preprocess>
+ <ctx:processors>
+ <ctx:processor name='ted'>mtxrun --script modules --convert --prep <ctx:value name='old'/></ctx:processor>
+ </ctx:processors>
+ <ctx:files>
+ <ctx:file processor='ted'><ctx:value name='old'/></ctx:file>
+ </ctx:files>
+ </ctx:preprocess>
+ <ctx:flags>
+ <!-- ctx:flag>purge</ctx:flag -->
+ <ctx:flag>global</ctx:flag>
+ <ctx:flag>prep</ctx:flag>
+ </ctx:flags>
+ <ctx:process>
+ <ctx:resources>
+ <ctx:module>mod-01</ctx:module>
+ </ctx:resources>
+ </ctx:process>
+</ctx:job>
+
diff --git a/Master/texmf-dist/tex/context/base/s-pre-60.tex b/Master/texmf-dist/tex/context/base/s-pre-60.tex
index 89ddbbba403..f12b98b0633 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-60.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-60.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\startmode[paper]
+\startmode[paper,print]
\let\StartSteps\relax
\let\StopSteps \relax
\let\FlushStep \relax
diff --git a/Master/texmf-dist/tex/context/base/s-pre-64.tex b/Master/texmf-dist/tex/context/base/s-pre-64.tex
index bdc17e18ce2..b9dc10002c8 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-64.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-64.tex
@@ -131,7 +131,7 @@
\def\StartItem
{\blank[line]
\begingroup
- \EveryPar {\AdaptShape}} % beware: \ABBREV aan gegin gaat fout
+ \EveryPar {\AdaptShape}} % beware: \ABBREV aan begin gaat fout
\def\StopItem
{\endgraf
diff --git a/Master/texmf-dist/tex/context/base/s-ptj-01.tex b/Master/texmf-dist/tex/context/base/s-ptj-01.tex
index 188af73bd7e..9990bf00615 100644
--- a/Master/texmf-dist/tex/context/base/s-ptj-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-ptj-01.tex
@@ -1,29 +1,29 @@
%D \module
%D [ file=s-ptj-01,
-%D version=2006.11.28,
+%D version=2009.12.18,
%D title=\CONTEXT\ Style File,
%D subtitle=PracTeX Journal Style,
%D author=Aditya Mahajan,
%D email=adityam at umich dot edu,
%D date=\currentdate,
-%D copyright=2006 Aditya Mahajan]
+%D copyright=2009 Aditya Mahajan]
%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 % These macros are needed to compile the documentation.
-%M \def\PracTeX{Prac\kern-0.07em\TeX}
-%M \def\PRACTEX{\PracTeX}
-%M \def\TPJ {The \PRACTEX\ Journal}
-%M \useurl[TPJ][http://www.tug.org/pracjourn/][][\TPJ]
-%M \useurl[texgyre][http://www.gust.org.pl/projects/e-foundry/tex-gyre/]
+%M \def\PracTeX {Prac\kern-0.07em\TeX}
+%M \def\PRACTEX {\PracTeX}
+%M \def\pracjourn {The \PRACTEX\ Journal}
+%M \useurl[pracjourn][http://www.tug.org/pracjourn/][][\pracjourn]
+%M \useurl[texgyre] [http://www.gust.org.pl/projects/e-foundry/tex-gyre/]
\writestatus {loading} {Context Module for the PracTeX Journal}
-%D This module is for producing acticles for \from[TPJ]. It merely copies the
+%D This module is for producing acticles for \from[pracjourn]. It merely copies the
%D layout of the the \LATEX\ class \filename{pracjourn.cls} available from
-%D \TPJ\ website (\url[TPJ]). This module has a filename synonym
+%D \pracjourn\ website (\url[pracjourn]). This module has a filename synonym
%D \filename{pracjourn}. So to use this module, you can write:
%D \starttyping
%D \usemodule[pracjourn]
@@ -42,8 +42,8 @@
\unprotect
-%D First let's setup the paper size and layout for \TPJ. I am actually not
-%D sure about the \quote{official} layout requirement for \TPJ\ and have
+%D First let's setup the paper size and layout for \pracjourn. I am actually not
+%D sure about the \quote{official} layout requirement for \pracjourn\ and have
%D reverse engineered the layout from the typeset \LATEX\ examples. If you
%D feel that anything is wrong here, please let me know.
@@ -68,32 +68,16 @@
footerdistance=.25in,
]
-%D Next we do the font setup. \TPJ\ uses mathpazo for roman and math faces and
+%D Next we do the font setup. \pracjourn\ uses mathpazo for roman and math faces and
%D uses latin modern for sans serif and monotype. For the main face, 12pt is
%D used with a 15.5pt baseline skip. Font protrusion is enabled, but font
-%D expansion is not. We follow these conventions, but use Pagella fonts from
-%D \TEX{gyre} project, and scale latin modern fonts by 1.1 for better
-%D matching. Right now, the \TEX{gyre} fonts are not distributed with
-%D \CONTEXT. They can be downloaded from \url[texgyre]. Most of the numbers
-%D (page numbers, figure numbers, section numbers) are set in oldstyle.
+%D expansion is not. We follow these conventions. \CONTEXT\ uses Pagella fonts
+%D from \TEX{gyre} project, so we use them instead.
\usetypescript [serif,sans,mono] [hanging] [pure]
\setupalign [hanging]
-
-\usetypescriptfile
- [type-gyr]
-
-\definetypeface
- [mainface] [rm] [serif] [palatino] [default] [encoding=texnansi]
-\definetypeface
- [mainface] [ss] [sans] [modern] [default] [encoding=texnansi, rscale=1.1]
-\definetypeface
- [mainface] [tt] [mono] [modern] [default] [encoding=texnansi, rscale=1.1]
-\definetypeface
- [mainface] [mm] [math] [palatino] [default] [encoding=texnansi]
-
-\setupbodyfont
- [mainface,12pt]
+\usetypescript [palatino][encoding=texnansi]
+\setupbodyfont [palatino,12pt]
\definefont [titlefont] [Regular at 20pt]
\definefont [authorfont] [Regular at 14pt]
@@ -164,11 +148,10 @@
after={\blank[big]}]
%D Next we define internal frames to take care of the layout of the extra
-%D material in the title. These start with \type|do...| to prevent clash with
-%D user macros. (I do not like writing @ in macro names).
+%D material in the title.
\defineframed
- [doinfotitle]
+ [pracjourninfotitle]
[ frame=off,
strut=yes,
width=0.1\textwidth,
@@ -178,7 +161,7 @@
]
\defineframed
- [doinfodetails]
+ [pracjourninfodetails]
[ frame=off,
strut=yes,
width=0.85\textwidth,
@@ -187,27 +170,27 @@
location=hanging,
]
-\newif\iftitleskipdone
+\newif\ifpracjourntitleskipdone
-\def\doadditionalinfo#1#2
- {\titleskipdonetrue
+\def\pracjourninfo#1#2%
+ {\pracjourntitleskipdonetrue
\hbox to \textwidth
\bgroup
- \hfill \doinfotitle{#1}
- \hfill \doinfodetails{#2}
+ \hfill \pracjourninfotitle{#1}
+ \hfill \pracjourninfodetails{#2}
\egroup\endgraf}
%D Now we take care of the actual layout of the title. Most of this is
%D heuristic, as I was trying to get the same visual effect as the
%D \filename{pracjourn.cls} class. If something does not match, please let me
-%D know. The additional information is typeset as
+%D know. The information is typeset as
%D \starttyping
%D \hfill <box of .1\textwidth> \hfill <box of .85\textwidth>
%D \stoptyping
%D at 11pt size. We also add the title and author information in the \PDF\
%D metadata.
-\startrawsetups [title]
+\startsetups [title]
% Place the tile and the author
\title{\getvariable{pracjourn}{title}}
\blank[medium]
@@ -217,36 +200,42 @@
% Place the additional information
\bgroup\switchtobodyfont[11pt]
\setupindenting[no]
- \doifdefined{\v!file:::email}
- {\doadditionalinfo{Email}{\tttf\from[email]\relax}}
- \doifdefined{\v!file:::website}
- {\doadditionalinfo{Website}{\from[website]\relax}}
+ \doifurldefinedelse{email}
+ {\pracjourninfo{Email}{\tttf\from[email]\relax}}
+ \empty
+ \doifurldefinedelse{website}
+ {\pracjourninfo{Website}{\from[website]\relax}}
+ \empty
\doifsomething{\getvariable{pracjourn}{address}}
- {\doadditionalinfo{Address}{\getvariable{pracjourn}{address}}}
- \iftitleskipdone \blank[big] \fi
- \doadditionalinfo{Abstract}%
- {\setupindenting[yes]%
- \setupinterlinespace%
+ {\pracjourninfo{Address}{\getvariable{pracjourn}{address}}}
+ \ifpracjourntitleskipdone \blank[big] \fi
+ \pracjourninfo{Abstract}
+ {\setupindenting[yes]
+ \setupinterlinespace
\getbuffer[abstract]
\endgraf}
\egroup
\blank[big]
+ \setups{pracjourndate}
+ % Add information to pdfmetadata
+ \setupinteraction
+ [title={\getvariable{pracjourn}{title}},
+ author={\getvariable{pracjourn}{author}},
+ subtitle={The PracTeX Journal Article}]
+\stopsetups
+
% If revision number is present, write it to \filename{_rev.tex}
% FIXME: Do we need to ensure that the dates and month are two digits?
+\startrawsetups [pracjourndate]
\doifsomething{\getvariable{pracjourn}{revision}}
{\expanded{\setvariables[pracjourn:date][y=,m=,d=,\getvariable{pracjourn}{revision}]}
\immediate\openout \scratchwrite _rev.tex
\immediate\write \scratchwrite
{\getvariable{pracjourn:date}{y}/\getvariable{pracjourn:date}{m}/\getvariable{pracjourn:date}{d}}
\immediate\closeout\scratchwrite}
-% Add information to pdfmetadata
- \setupinteraction
- [title={\getvariable{pracjourn}{title}},
- author={\getvariable{pracjourn}{author}},
- subtitle={The PracTeX Journal Article}]
\stoprawsetups
-%D Next we setup the header and footer for the first page. \TPJ\ formats the
+%D Next we setup the header and footer for the first page. \pracjourn\ formats the
%D header as
%D \startlines
%D The PracTeX Journal, year, No. number
@@ -255,32 +244,38 @@
%D If a copyright notice is present, it is printed right aligned on the bottom
%D of first page. Otherwise the footer on the first page is empty.
-\startlocalsetups [titleheader]
+\startsetups [pracjourntitleheader]
\framed[frame=off,width=\textwidth,align=normal,location=low]
{\small\setupinterlinespace
- \doifelsenothing{\TPJissue}{For submission to \TPJ}{\TPJissue}\endgraf
+ \doifelsenothing{\pracjournissue}
+ {For submission to \pracjourn}
+ {\pracjournissue}
+ \endgraf
\doifelsenothing{\getvariable{pracjourn}{revision}}
- {Draft of \currentdate[year,/,mm,/,dd]}
- {Article revision\space
- \expanded{\date[\getvariable{pracjourn}{revision}][year,/,mm,/,dd]}}
- \endgraf}
-\stoplocalsetups
+ {Draft of \currentdate[year,/,mm,/,dd]}
+ {Article revision\space
+ \expanded{\date[\getvariable{pracjourn}{revision}][year,/,mm,/,dd]}}
+ \endgraf}
+\stopsetups
-\startlocalsetups [titlefooter]
+\startsetups [pracjourntitlefooter]
\framed[frame=off,width=\textwidth,align=flushright,location=low]
- {\small\setupinterlinespace
- \getvariable{pracjourn}{copyright}\endgraf}
-\stoplocalsetups
+ {\small\setupinterlinespace \getvariable{pracjourn}{copyright}\endgraf}
+\stopsetups
-\definetext [titleheader] [header] [\setups{titleheader}][]
-\definetext [titlefooter] [footer] [\setups{titlefooter}]
-\setuphead [title] [header=titleheader,footer=titlefooter]
+\definetext [pracjourntitleheader] [header] [\setups{pracjourntitleheader}][]
+\definetext [pracjourntitlefooter] [footer] [\setups{pracjourntitlefooter}]
+
+\setuphead
+ [title]
+ [header=pracjourntitleheader,
+ footer=pracjourntitlefooter]
%D For rest of the pages, page number is printed on the middle of the footer.
\setuppagenumbering [location={footer,middle}, style=mediaeval]
-%D Next we setup the formating for the sections. \TPJ\ wants font sizes of
+%D Next we setup the formating for the sections. \pracjourn\ wants font sizes of
%D 17pt, 14pt, and 12pt respectively for section, subsection, and
%D subsubsection. By default, \tex{tfa} is 1.2, \tex{tfb} is 1.4, so the sizes
%D come out close to what is required. The section number is typset in
@@ -329,7 +324,7 @@
\def\pracjournfootnote#1{\hbox to 1.5em{#1.}}
-%D \TPJ\ uses dash as the first level of itemize and text period as the second
+%D \pracjourn\ uses dash as the first level of itemize and text period as the second
%D level. The third level is left unspecified.
\definesymbol [1] [{\symbol[dash]}]
@@ -338,13 +333,6 @@
\setupitemize [each] [packed]
\setupitemize [1] [packed,autointro] [margin=1em]
-%D We change \type|\type| so that the argument inside \type|\type| is pretty
-%D printed using \TEX's patterns. Another command \type|\normaltype| can be
-%D used if you do not want the original \type|\type|.
-
-\setuptype [option=TEX]
-\definetype [normaltype] [option=none]
-
%D We enable colors, interaction and bookmarks.
\setupinteraction [state=start,color=darkred,style=normal]
@@ -358,13 +346,13 @@
\setupwhitespace [medium]
\setupblank [medium]
-%D We define logos for \PRACTEX\ and \TPJ. These definitions are copied from
+%D We define logos for \PRACTEX\ and \pracjourn. These definitions are copied from
%D \filename{pracjourn.cls} and can be accessed by \type|\PracTeX|,
-%D \type|\PRACTEX| and \type|\TPJ|.
+%D \type|\PRACTEX| and \type|\pracjourn|.
\def\PracTeX{Prac\kern-0.07em\TeX}
\def\PRACTEX{\PracTeX}
-\def\TPJ {The \PRACTEX\ Journal}
+\def\pracjourn {The \PRACTEX\ Journal}
%D \filename{pracjourn.cls} provides two macros \type|\ctanfile| and
%D \type|\ctanloc|. I am not sure what is the advantage of these macors. If
@@ -372,22 +360,22 @@
%D \CONTEXT. For example
%D \starttyping
%D \useURL[pracjourn][http://ctan.org/get?fn=/macros/contrib/latex/pracjourn][][\mono{CTAN:macros/contrib/latex/pracjourn}]
-%D The \LATEX\ style files for \TPJ\ is localed at \from[pracjourn]
+%D The \LATEX\ style files for \pracjourn\ is localed at \from[pracjourn]
%D \stoptyping
%D For the final version of the paper, the string \quotation{The PracTeX
%D Journal year, No x} is written on the header. This only happens when the
%D current directory contains a file \filename{_iss.tex} which contains string
-%D like \quotation{TPJ 2006 No 04, 2006-11-15}. This step is usually taken in
+%D like \quotation{pracjourn 2006 No 04, 2006-11-15}. This step is usually taken in
%D the final production of the article. If this file is absent, \quotation{For
%D submission to the PracTeX Journal} is written instead. The next macros are
%D used to parse this file.
-\let\TPJissue\empty
+\let\pracjournissue\empty
-\def\parse@iss TPJ #1 No #2, #3-#4-#5\@nil%
+\def\parse@iss pracjourn #1 No #2, #3-#4-#5\@nil%
{\!!counta#2\relax
- \edef\TPJissue{\TPJ, #1, No.\,\the\!!counta}}
+ \edef\pracjournissue{\pracjourn, #1, No.\,\the\!!counta}}
%D Read the \filename{_iss.tex} file, if present to determine the current
%D issue.
diff --git a/Master/texmf-dist/tex/context/base/scrn-bar.mkiv b/Master/texmf-dist/tex/context/base/scrn-bar.mkiv
index fd274419dd9..dbeaf6d7f5a 100644
--- a/Master/texmf-dist/tex/context/base/scrn-bar.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-bar.mkiv
@@ -61,8 +61,8 @@
\def\dointeractionbarparentparameter #1#2{\ifx#1\relax\s!empty\else\dointeractionbarparameter #1#2\fi}
\def\dointeractionbarparentparameterhash#1#2{\ifx#1\relax \else\dointeractionbarparameterhash#1#2\fi}
-\def\defineinteractionbar{\dodoubleargument\dodefineinteractionbar}
-\def\setupinteractionbar {\dodoubleempty \dosetupinteractionbar}
+\unexpanded\def\defineinteractionbar{\dodoubleargument\dodefineinteractionbar}
+\unexpanded\def\setupinteractionbar {\dodoubleempty \dosetupinteractionbar}
\def\interactionbar {\dodoubleempty \dointeractionbar}
\def\dosetupinteractionbar[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/scrn-but.mkiv b/Master/texmf-dist/tex/context/base/scrn-but.mkiv
index 6beaee75746..9a72a756bd9 100644
--- a/Master/texmf-dist/tex/context/base/scrn-but.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-but.mkiv
@@ -39,7 +39,7 @@
%D
%D \showsetup{setupbuttons}
-\def\setupbuttons
+\unexpanded\def\setupbuttons
{\dodoubleargument\getparameters[\??bt]}
\definecomplexorsimpleempty\button
@@ -121,6 +121,7 @@
\c!color=\@@iacolor,
\c!contrastcolor=\@@iacontrastcolor,
\c!samepage=\v!yes,
- \c!unknownreference=\v!yes]
+ \c!unknownreference=\v!yes,
+ \c!distance=\zeropoint] % for menubuttons
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/scrn-fld.mkii b/Master/texmf-dist/tex/context/base/scrn-fld.mkii
index 85e4aa738be..4e1b34fa974 100644
--- a/Master/texmf-dist/tex/context/base/scrn-fld.mkii
+++ b/Master/texmf-dist/tex/context/base/scrn-fld.mkii
@@ -340,6 +340,8 @@
%D \field[XXXX]
%D \fitfield[XXXX]
%D \stoptyping
+%D
+%D Beware, in \MKII\ we don't support autocloning for radiofields.
\newif\ifdefinemainfield \definemainfieldfalse
diff --git a/Master/texmf-dist/tex/context/base/scrn-fld.mkiv b/Master/texmf-dist/tex/context/base/scrn-fld.mkiv
index 4bcc0eabd55..f895089e884 100644
--- a/Master/texmf-dist/tex/context/base/scrn-fld.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-fld.mkiv
@@ -67,9 +67,9 @@
{\def\dopresetfieldsymbols##1{\processcommalist[##1]\dopresetfieldsymbol}%
\@EA\processcommalist\@EA[#1]\dopresetfieldsymbols}
-\def\definedefaultsymbols
- {\definesymbol[defaultyes][$\times$]%
- \definesymbol[defaultno][$\cdot$]}
+\unexpanded\def\definedefaultsymbols
+ {\definesymbol[defaultyes][\mathematics{\times}]%
+ \definesymbol[defaultno ][\mathematics{\cdot }]}
\def\resetfieldsymbol[#1]% for experimental usage only
{\resetobject{SYM}{#1}}
@@ -77,30 +77,36 @@
%D The interface to the specials. DEFAULT NOG ANDERS
\def\typesetfield
- {\ctxlua{backends.codeinjections.typesetfield("\currentfieldname", {
- title = "\currentfieldname",
- width = \number\dimexpr\@@fdwidth\relax,
- height = \number\dimexpr\@@fdheight\relax,
- align = "\@@fdalign",
- length = tonumber("\@@fdn") or 0,
- style = "\@@fdstyle",
- color = "\@@fdcolor",
- backgroundcolor = "\@@fdfieldbackgroundcolor",
- framecolor = "\@@fdfieldframecolor",
- layer = "\@@fdfieldlayer",
- options = "\@@fdoption",
- align = "\@@fdalign",
- clickin = "\@@fdclickin",
- clickout = "\@@fdclickout",
- regionin = "\@@fdregionin",
- regionout = "\@@fdregionout",
- afterkey = "\@@fdafterkey",
- format = "\@@fdformat",
- validate = "\@@fdvalidate",
- calculate = "\@@fdcalculate",
- focusin = "\@@fdfocusin",
- focusout = "\@@fdfocusout",
- }) }}
+ {\bgroup
+ \dosetfontattribute\??fd\c!style
+ \ctxlua{backends.codeinjections.typesetfield("\currentfieldname", {
+ title = "\currentfieldname",
+ width = \number\dimexpr\@@fdwidth\relax,
+ height = \number\dimexpr\@@fdheight\relax,
+ align = "\@@fdalign",
+ length = tonumber("\@@fdn") or 0,
+ style = "\@@fdstyle",
+ fontstyle = "\fontstyle",
+ fontalternative = "\fontalternative",
+ fontsize = "\currentfontbodysize",
+ color = "\@@fdcolor",
+ backgroundcolor = "\@@fdfieldbackgroundcolor",
+ framecolor = "\@@fdfieldframecolor",
+ layer = "\@@fdfieldlayer",
+ options = "\@@fdoption",
+ align = "\@@fdalign",
+ clickin = "\@@fdclickin",
+ clickout = "\@@fdclickout",
+ regionin = "\@@fdregionin",
+ regionout = "\@@fdregionout",
+ afterkey = "\@@fdafterkey",
+ format = "\@@fdformat",
+ validate = "\@@fdvalidate",
+ calculate = "\@@fdcalculate",
+ focusin = "\@@fdfocusin",
+ focusout = "\@@fdfocusout",
+ }) }%
+ \egroup}
\unexpanded\def\definefieldset {\dodoubleargument\dodefinefieldset}
\unexpanded\def\definefield {\doquintupleempty\dodefinefield}
@@ -115,7 +121,7 @@
% misc
-\appendtoks\ctxlua{backends.codeinjections.finishfields()}\to\everylastshipout
+% \appendtoks\ctxlua{backends.codeinjections.finishfields()}\to\everylastshipout
% testing
@@ -124,7 +130,7 @@
% definition
-\def\dodefinefield[#1][#2][#3][#4][#5]% [name] [kind] [group] [values] [default]
+\def\dodefinefield[#1][#2][#3][#4][#5]% [name] [kind] [group] [values] [default] | [name] [kind] [group] [default]
{\ctxlua{backends.codeinjections.definefield{ variant="normal", name="#1", kind="#2", group="#3", values=\!!bs#4\!!es, default=\!!bs#5\!!es }}}
\def\dodefinesubfield[#1][#2][#3]% [name] [group] [values]
@@ -150,29 +156,6 @@
\def\donormalfield{\doprocessfield\dohandlefield}
\def\dofitfield {\doprocessfield\dohandlefitfield}
-% \def\doprocessfield#1[#2][#3]% \method [name] [label]
-% {\dontleavehmode
-% \begingroup
-% \loadfieldscripts
-% \edef\currentfieldname {#2}%
-% \edef\currentfieldlabel{#3}%
-% \edef\currentfieldgroup{\ctxlua{backends.codeinjections.getfieldgroup("#2")}}%
-% \ifx\currentfieldlabel\empty
-% \let\currentfieldlabel\currentfieldname
-% \fi
-% \ifx\currentfieldgroup\empty
-% #1[#2][\v!label,\v!frame,\v!horizontal][][][]%
-% \else
-% \getvalue{\??fd::\currentfieldgroup}%
-% #1[#2][][][][]% todo: pass setups
-% \fi
-% \endgroup}
-
-% \def\dosetupfieldindeed#1#2[#3][#4][#5][#6][#7]%
-% {#1[#2][#4][#5][#6][#7]}
-%
-% equals:
-
\def\dosetupfieldindeed#1#2[#3]% [#4][#5][#6][#7]%
{#1[#2]} % [#4][#5][#6][#7]}
@@ -310,7 +293,7 @@
\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!fieldoffset=-\framedoffset,\c!fieldbackgroundcolor=,
\c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5]%
\scratchdimen\framedwidth \edef\@@fdwidth {\the\scratchdimen}%
\scratchdimen\framedheight\edef\@@fdheight{\the\scratchdimen}%
@@ -469,11 +452,11 @@
%D And one more:
-\def\definefieldstack
+\unexpanded\def\definefieldstack
{\dotripleargument\dodefinefieldstack}
\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
- {\ifcsname fieldstack:#1\endcsname
+ {\ifcsname fieldstack:#1\endcsname \else
\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}%
\fi}
@@ -493,15 +476,15 @@
\begingroup
\getparameters[\??fd][\c!start=1,#3]%
\setupfields[\v!reset]%
- \definesymbol[\v!empty][]%
+ % \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]%
+ \definefield[#1:\stackedfieldnumber][check][#1][##1,\empty][##1]% \v!empty fails
\else
- \definefield[#1:\stackedfieldnumber][check][#1][##1,\v!empty][\v!empty]%
+ \definefield[#1:\stackedfieldnumber][check][#1][##1,\empty][\empty]% \v!empty fails
\fi}%
\processcommalist[#2]\dododofieldstack
\setupfield[#1][\v!reset]% added
@@ -522,7 +505,7 @@
\newtoks\everysetupforms
-\def\setupforms{\dosingleempty\dosetupforms}
+\unexpanded\def\setupforms{\dosingleempty\dosetupforms}
\def\dosetupforms[#1]
{\getparameters[\??fr][#1]%
@@ -537,7 +520,7 @@
%D Goodie: (unchecked in \MKIV)
-\def\definepushbutton % name optional setup
+\unexpanded\def\definepushbutton % name optional setup
{\dodoubleempty\dodefinepushbutton}
\def\dodefinepushbutton[#1][#2]% name setup
@@ -550,7 +533,7 @@
{\doifsymboldefinedelse{psym:#1:#2}%
\donothing{\definesymbol[psym:#1:#2][{#3}]}}
-\def\definepushsymbol
+\unexpanded\def\definepushsymbol
{\dotripleargument\dodefinepushsymbol}
\def\dodefinepushsymbol[#1][#2]% [#3]
diff --git a/Master/texmf-dist/tex/context/base/scrn-hlp.mkiv b/Master/texmf-dist/tex/context/base/scrn-hlp.mkiv
index c9fcbd29ac0..4eaa340ca26 100644
--- a/Master/texmf-dist/tex/context/base/scrn-hlp.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-hlp.mkiv
@@ -38,6 +38,9 @@
\newcounter \nofhelpdataentries
\newconditional \somehelpdatadefined
+\let\getpagehelpdata \relax
+\let\synchronizepagehelpdata\relax
+
\appendtoks \getpagehelpdata \to \beforeeverypage
\appendtoks \synchronizepagehelpdata \to \aftereverypage
@@ -46,43 +49,48 @@
\let\pagehelpdata\empty
\def\dontresetpagedata
- {\let\synchronizepagehelpdata\relax}
+ {\let\synchronizepagehelpdataindeed\relax}
\def\resetpagehelpdata
{\iflocation
- \let\synchronizepagehelpdata\resetpagehelpdata
+ \let\synchronizepagehelpdataindeed\resetpagehelpdata
\global\let\pagehelpdata\empty
\resetreference[HideHelp]%
\fi}
-\let\synchronizepagehelpdata\resetpagehelpdata
+\let\synchronizepagehelpdataindeed\resetpagehelpdata
\resetreference[HideHelp]
-\def\getpagehelpdata
+\def\getpagehelpdataindeed
{\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
+ \dogetpagehelpdataindeed
\fi\fi}
+\def\dogetpagehelpdataindeed
+ {\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}
+
\def\setpagehelpdata[#1]%
{\iflocation\expanded{\dosetpagehelpdata{#1}}\fi}
\def\dosetpagehelpdata#1%
{\doglobal\increment\nofhelpdataentries
+ \global\let\getpagehelpdata\getpagehelpdataindeed
+ \global\let\synchronizepagehelpdata\synchronizepagehelpdataindeed
\savetwopassdata{hlp:\realfolio}{\nofhelpdataentries}{#1}}
\setvalue{\e!start\v!helptext}[#1]%
diff --git a/Master/texmf-dist/tex/context/base/scrn-int.lua b/Master/texmf-dist/tex/context/base/scrn-int.lua
index 7e90ed069f1..7036bbf6a8d 100644
--- a/Master/texmf-dist/tex/context/base/scrn-int.lua
+++ b/Master/texmf-dist/tex/context/base/scrn-int.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['scrn-int'] = {
version = 1.001,
- comment = "companion to scrn-int.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/scrn-int.mkii b/Master/texmf-dist/tex/context/base/scrn-int.mkii
index 9f1be68e193..cf55f864af6 100644
--- a/Master/texmf-dist/tex/context/base/scrn-int.mkii
+++ b/Master/texmf-dist/tex/context/base/scrn-int.mkii
@@ -269,18 +269,30 @@
\else
\let\openbookmarklist\empty
\fi
- \global\let\bookmarklevellist\empty
- \def\bookmarklevelcount{0}%
- \doprocessbookmarks[#1]\dogetbookmarkelement
- \dolistelement{}{}{}{}{}{}% needed to finish the first pass
- \doprocessbookmarks[#1]\doputbookmarkelement
- \flushbookmark
+ \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
diff --git a/Master/texmf-dist/tex/context/base/scrn-int.mkiv b/Master/texmf-dist/tex/context/base/scrn-int.mkiv
index a68c374dd8f..11734e0d7e4 100644
--- a/Master/texmf-dist/tex/context/base/scrn-int.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-int.mkiv
@@ -13,6 +13,8 @@
\writestatus{loading}{ConTeXt Screen Macros / Interaction}
+\registerctxluafile{scrn-int}{1.001}
+
\unprotect
%D This is an update of \MKII\ code. In the process profiles and versions
@@ -23,7 +25,7 @@
\newtoks\everysetupinteractionscreen
-\def\setupinteractionscreen
+\unexpanded\def\setupinteractionscreen
{\dosingleempty\dosetupinteractionscreen}
\def\dosetupinteractionscreen[#1]%
@@ -90,7 +92,9 @@
\fi\fi
\ctxlua{backends.codeinjections.setupcanvas {
mode = "\@@scoption",
- doublesided = \ifsinglesided false\else\ifdoublesided true\else false\fi\fi,
+ % doublesided = \ifsinglesided false\else\ifdoublesided true\else false\fi\fi,
+ singlesided = \ifsinglesided true\else false\fi,
+ doublesided = \ifdoublesided true\else false\fi,
leftoffset = \number\dimexpr\backoffset\relax,
topoffset = \number\dimexpr\topoffset \relax,
width = \number\dimexpr\!!widtha \relax,
@@ -128,9 +132,9 @@
\def\dolinkedlistparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dolinkedlistparentparameter\csname#1\s!parent\endcsname#2\fi}
\def\dolinkedlistparentparameter#1#2{\ifx#1\relax\s!empty\else\dolinkedlistparameter#1#2\fi}
-\def\definelinkedlist{\dodoubleargument\dodefinelinkedlist}
-\def\setuplinkedlist {\dodoubleargument\dosetuplinkedlist }
-\def\setuplinkedlists{\dosingleargument\dosetuplinkedlists}
+\unexpanded\def\definelinkedlist{\dodoubleargument\dodefinelinkedlist}
+\unexpanded\def\setuplinkedlist {\dodoubleargument\dosetuplinkedlist }
+\unexpanded\def\setuplinkedlists{\dosingleargument\dosetuplinkedlists}
\def\dodefinelinkedlist[#1][#2]%
{\ctxlua{interactions.definelinkedlist("#1")}%
@@ -196,7 +200,7 @@
\let\askedpagetransitions\empty
-\def\setuppagetransitions
+\unexpanded\def\setuppagetransitions
{\dosingleempty\dosetuppagetransitions}
\def\dosetuppagetransitions[#1]%
@@ -236,10 +240,10 @@
\def\dodoflushcommentanchors
{\executeifdefined{\??cc:\c!location:\@@cclocation}\hbox{\box\commentbox}}
-\def\setupcomment
+\unexpanded\def\setupcomment
{\dodoubleargument\getparameters[\??cc]}
-\def\placecomments{\box\commentcollection} % when option=buffer
+\unexpanded\def\placecomments{\box\commentcollection} % when option=buffer
\def\doinsertcomment#1%
{\begingroup
@@ -273,7 +277,7 @@
\setcurrentbuffer{\v!comment\v!buffer}%
\dostartbuffer[\v!comment\v!buffer][\v!comment\v!buffer][\e!start\v!comment][\e!stop\v!comment]}
-\def\stopcomment
+\unexpanded\def\stopcomment
{\doif\@@ccstate\v!start
{\global\let\flushcommentanchors\doflushcommentanchors
\global\setbox\commentbox\frozenhbox
@@ -426,30 +430,41 @@
{\bgroup
\setupattachments[#2]%
\ctxlua{backends.codeinjections.presetsymbollist("\@@atsymbol")}%
- \getvalue{\??at:\@@atalternative}{\ctxlua{backends.codeinjections.attachfile{
- label = "#1",
- width = \number\dimexpr\@@atwidth \relax,
- height = \number\dimexpr\@@atheight\relax,
- depth = \number\dimexpr\@@atdepth \relax,
- color = "\@@atcolor",
- symbol = "\@@atsymbol",
- layer = "\@@attextlayer",
- }}}%
+ % we cannot yet ask for the wd/ht/dp of an xform else we could use those
+ \setbox\scratchbox\hbox{\symbol[\lastpredefinedsymbol]}%
+ \doif\@@atwidth \v!fit{\edef\@@atwidth {\the\wd\scratchbox}}%
+ \doif\@@atheight\v!fit{\edef\@@atheight{\the\ht\scratchbox}}%
+ \doif\@@atdepth \v!fit{\edef\@@atdepth {\the\dp\scratchbox}}%
+ %
+ \setbox\scratchbox\hbox
+ {\getvalue{\??at:\@@atalternative}{\ctxlua{backends.codeinjections.attachfile{
+ label = "#1",
+ width = \number\dimexpr\@@atwidth \relax,
+ height = \number\dimexpr\@@atheight\relax,
+ depth = \number\dimexpr\@@atdepth \relax,
+ color = "\@@atcolor",
+ symbol = "\@@atsymbol",
+ layer = "\@@attextlayer",
+ }}}}%
+ \wd\scratchbox\@@atwidth
+ \ht\scratchbox\@@atheight
+ \dp\scratchbox\@@atdepth
+ \box\scratchbox
\egroup}%
\fi}
\setvalue{\??at:\v!high}#1{\struttedbox{\tbox{#1}}}
-\def\setupattachments
+\unexpanded\def\setupattachments
{\dodoubleempty\getparameters[\??at]}
\setupattachments
[\c!state=\v!start,
\c!color=\@@iacolor,
\c!textlayer=,
- \c!width=1em,
- \c!height=\strutheight,
- \c!depth=\strutdepth,
+ \c!width=\v!fit,
+ \c!height=\v!fit,
+ \c!depth=\v!fit,
\c!alternative=\v!high,
\c!symbol=]
@@ -478,7 +493,7 @@
}}%
\fi}
-\def\setupexternalsoundtracks
+\unexpanded\def\setupexternalsoundtracks
{\dodoubleargument\getparameters[\??sd]}
\setupexternalsoundtracks
@@ -530,7 +545,7 @@
\def\renderingwidth {8cm}
\def\renderingheight {6cm}
-\def\definerenderingwindow
+\unexpanded\def\definerenderingwindow
{\dodoubleempty\dodefinerenderingwindow}
\def\dodefinerenderingwindow[#1][#2]%
@@ -541,13 +556,13 @@
\c!width=\renderingwidth,\c!height=\renderingheight,%
#2]}
-\def\setuprenderingwindow
+\unexpanded\def\setuprenderingwindow
{\dodoubleargument\dosetuprenderingwindow}
\def\dosetuprenderingwindow[#1]%
{\getparameters[\??rw#1]}
-\def\placerenderingwindow
+\unexpanded\def\placerenderingwindow
{\dodoubleempty\doplacerenderingwindow}
\def\doplacerenderingwindow[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/scrn-men.mkiv b/Master/texmf-dist/tex/context/base/scrn-men.mkiv
index ae95a5c044f..246d31bfddd 100644
--- a/Master/texmf-dist/tex/context/base/scrn-men.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-men.mkiv
@@ -87,7 +87,7 @@
\def\domenuparentparameter #1#2{\ifx#1\relax\s!empty\else\domenuparameter #1#2\fi}
\def\domenuparentparameterhash#1#2{\ifx#1\relax \else\domenuparameterhash#1#2\fi}
-\def\defineinteractionmenu
+\unexpanded\def\defineinteractionmenu
{\dotripleempty\dodefineinteractionmenu}
\def\dodefineinteractionmenu[#1][#2][#3]% [name] [location] [settings]
@@ -117,14 +117,14 @@
%D Setup menus:
-\def\setupinteractionmenu
+\unexpanded\def\setupinteractionmenu
{\dodoubleargument\dosetupinteractionmenu}
\def\dosetupinteractionmenu[#1][#2]%
{\def\docommand##1{\getparameters[\??am##1][#2]}%
\processcommalist[#1]\docommand}
-\def\setupinteractionmenus[#1]%
+\unexpanded\def\setupinteractionmenus[#1]%
{\getparameters[\??am][#1]}
%D Fill menus:
@@ -157,7 +157,7 @@
\csname\??am:\c!menu:#1\endcsname
\fi}
-% \def\defineinteractionmenuclass
+% \unexpanded\def\defineinteractionmenuclass
% {\dodoubleargument\dodefineinteractionmenuclass}
%
% \def\dodefineinteractionmenuclass[#1][#2]% tag hori|veri
@@ -546,6 +546,7 @@
\c!state=\v!start,
\c!samepage=\v!yes,
\c!unknownreference=\v!empty,
+ \c!distance=\bodyfontsize, % 12pt
\c!topoffset=\zeropoint,
\c!bottomoffset=\zeropoint,
\c!leftoffset=\zeropoint,
@@ -556,7 +557,6 @@
[\c!before=,
\c!after=\vfil,
\c!inbetween=\blank,
- \c!distance=\bodyfontsize, % 12pt
\c!left=\hss,
\c!right=\hss,
\c!height=\v!broad]
@@ -566,7 +566,6 @@
[\c!before=\vss,
\c!after=\vss,
\c!middle=\hfil,
- \c!distance=\bodyfontsize, % 12pt
\c!width=\v!fit,
\c!height=\v!broad]
@@ -575,13 +574,13 @@
% \setupinteractionmenu[\v!top ] [\c!height=\topheight ]
% \setupinteractionmenu[\v!bottom] [\c!height=\bottomheight ]
-\def\placeleftedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings)
+\unexpanded\def\placeleftedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings)
{\hbox to \leftedgewidth{\hsize\leftedgewidth\hss\interactionmenus[\v!left]}}
-\def\placerightedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings)
+\unexpanded\def\placerightedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings)
{\hbox to \rightedgewidth{\hsize\rightedgewidth\interactionmenus[\v!right]\hss}}
-\def\placetoptextblock
+\unexpanded\def\placetoptextblock
{\vbox to \topheight
{\vsize\topheight
\csname\??tk\v!top\c!before\endcsname
@@ -589,7 +588,7 @@
\csname\??tk\v!top\c!after\endcsname
\kern\zeropoint}}
-\def\placebottomtextblock
+\unexpanded\def\placebottomtextblock
{\vbox to \bottomheight
{\vsize\bottomheight
\csname\??tk\v!bottom\c!before\endcsname
diff --git a/Master/texmf-dist/tex/context/base/scrn-nav.mkiv b/Master/texmf-dist/tex/context/base/scrn-nav.mkiv
index 6b21a9e950f..264e3ded2e9 100644
--- a/Master/texmf-dist/tex/context/base/scrn-nav.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrn-nav.mkiv
@@ -44,7 +44,7 @@
\newtoks\everysetupinteraction
-\def\setupinteraction
+\unexpanded\def\setupinteraction
{\dosingleargument\dodosetupinteraction}
\def\dodosetupinteraction[#1]% % \dosetupinteraction == special
@@ -79,7 +79,7 @@
\def\synchronizebackendidentity
{\ctxlua{backends.codeinjections.setupidentity{
title = \!!bs\@@iatitle\!!es,
- subtitle = \!!bs\@@iasubtitle\!!es,
+ subject = \!!bs\@@iasubtitle\!!es,
author = \!!bs\@@iaauthor\!!es,
creator = \!!bs ConTeXt - \contextversion\!!es,
date = \!!bs\@@iadate\!!es,
@@ -193,6 +193,18 @@
\doactivatecolor{#1\c!color}%
\fi}
+%D delayed ...
+
+\def\enableinteractivereferences
+ {\ifproductionrun
+ \ctxlua{jobreferences.enable_interaction()}%
+ \globallet\enableinteractivereferences\relax
+ \fi}
+
+\appendtoks
+ \enableinteractivereferences
+\to \everysetupinteraction
+
%D More tokens are spend when we want both typeface and color
%D highlighting.
@@ -229,4 +241,16 @@
\c!keyword=,
\c!date=\@@iatimestamp]
+%D XMP support:
+
+\setupinteraction
+ [xmpfile=]
+
+\appendtoks
+ % this will move as it is a backend issue
+ \doifsomething\@@iaxmpfile
+ {\ctxlua{if lpdf then lpdf.setxmpfile("\@@iaxmpfile") end}%
+ \globallet\@@iaxmpfile\empty}%
+\to \everysetupinteraction
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/scrp-cjk.lua b/Master/texmf-dist/tex/context/base/scrp-cjk.lua
index a452673fa9f..997baaa962b 100644
--- a/Master/texmf-dist/tex/context/base/scrp-cjk.lua
+++ b/Master/texmf-dist/tex/context/base/scrp-cjk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['scrp-cjk'] = {
version = 1.001,
- comment = "companion to scrp-ini.tex",
+ 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"
@@ -26,7 +26,9 @@ local kind_to_number = scripts.kind_to_number
local number_to_kind = scripts.number_to_kind
local hash = scripts.hash
local cjk = scripts.cjk
-local fontdata = fonts.ids
+
+local fontdata = fonts.identifiers
+local quaddata = fonts.quads
-- 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
@@ -38,8 +40,7 @@ local inter_char_hangul_penalty = 0
local function set_parameters(font,data)
-- beware: parameters can be nil in e.g. punk variants
- local parameters = fontdata[font].parameters
- local quad = (parameters and parameters.quad or parameters[6]) or 0
+ local quad = quaddata[font]
inter_char_half_shrink = data.inter_char_half_shrink_factor * quad
inter_char_stretch = data.inter_char_stretch_factor * quad
inter_char_hangul_penalty = data.inter_char_hangul_penalty
@@ -486,7 +487,7 @@ local injectors = { -- [previous] [current]
full_width_close = {
jami_initial = nobreak_shrink_break_stretch,
korean = nobreak_shrink_break_stretch,
- chinese = nobreak_shrink_break_stretch,
+ chinese = stretch_break, -- nobreak_shrink_break_stretch,
half_width_open = nobreak_shrink_break_stretch_nobreak_autoshrink,
half_width_close = nobreak_shrink_nobreak_stretch,
full_width_open = nobreak_shrink_break_stretch_nobreak_shrink,
@@ -498,7 +499,7 @@ local injectors = { -- [previous] [current]
half_width_close = {
jami_initial = nobreak_shrink_break_stretch,
korean = nobreak_autoshrink_break_stretch,
- chinese = nobreak_autoshrink_break_stretch,
+ chinese = stretch_break, -- nobreak_autoshrink_break_stretch,
half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink,
half_width_close = nobreak_autoshrink_nobreak_stretch,
full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink,
diff --git a/Master/texmf-dist/tex/context/base/scrp-ini.lua b/Master/texmf-dist/tex/context/base/scrp-ini.lua
index a555732842d..b28c297d0bd 100644
--- a/Master/texmf-dist/tex/context/base/scrp-ini.lua
+++ b/Master/texmf-dist/tex/context/base/scrp-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['scrp-ini'] = {
version = 1.001,
- comment = "companion to scrp-ini.tex",
+ 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"
@@ -265,6 +265,8 @@ end
-- eventually we might end up with more extensive parsing
-- todo: pass t[start..stop] == original
+--
+-- one of the time consuming functiions:
function scripts.preprocess(head)
local start = first_character(head)
diff --git a/Master/texmf-dist/tex/context/base/scrp-ini.mkiv b/Master/texmf-dist/tex/context/base/scrp-ini.mkiv
index 3382ef4b64d..6e6b1061032 100644
--- a/Master/texmf-dist/tex/context/base/scrp-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/scrp-ini.mkiv
@@ -16,8 +16,8 @@
\registerctxluafile{scrp-ini}{1.001}
\registerctxluafile{scrp-cjk}{1.001}
-\definesystemattribute[preproc]
-\definesystemattribute[prestat]
+\definesystemattribute[preproc] \chardef\preprocattribute \dogetattributeid{preproc}
+\definesystemattribute[prestat] \chardef\prestatattribute \dogetattributeid{prestat}
%D Since scripts need specific \LUA\ code we use hard coded attribute
%D values, but we might have more tricks at some time, so we use a
@@ -50,7 +50,7 @@
% when #2 == string, then only synonym, no settings
-\def\definescript
+\unexpanded\def\definescript
{\dodoubleargument\dodefinescript}
\def\dodefinescript[#1][#2]%
@@ -62,7 +62,7 @@
{\getparameters[\??ls#1][\s!parent=#2]}%
\setvalue{#1}{\dosetscript{#1}}}
-\def\setupscript
+\unexpanded\def\setupscript
{\dodoubleargument\dosetupscript}
\def\dosetupscript[#1][#2]%
@@ -73,14 +73,14 @@
\edef\currentscriptattribute{\scriptparameter\s!attribute}%
\ifx\currentscriptattribute\empty
\let\currentscript\empty
- \doresetattribute{preproc}%
+ \attribute\preprocattribute\attributeunsetvalue
\else
- \dosetattribute{preproc}\currentscriptattribute % we can speed this up by storing the attribute in ??ls:a:#1
+ \attribute\preprocattribute\currentscriptattribute\relax % we can speed this up by storing the attribute in ??ls:a:#1
\fi}
\def\setscript [#1]{\dosetscript{#1}}
-\def\startscript[#1]{\begingroup\dosetscript{#1}}
-\def\stopscript {\endgroup}
+\unexpanded\def\startscript[#1]{\begingroup\dosetscript{#1}}
+\unexpanded\def\stopscript {\endgroup}
% \setscript[hangul] \hangul \startscript[hangul]
diff --git a/Master/texmf-dist/tex/context/base/sort-ini.lua b/Master/texmf-dist/tex/context/base/sort-ini.lua
index 5f045938f1a..b745c9aa5db 100644
--- a/Master/texmf-dist/tex/context/base/sort-ini.lua
+++ b/Master/texmf-dist/tex/context/base/sort-ini.lua
@@ -1,21 +1,24 @@
if not modules then modules = { } end modules ['sort-ini'] = {
version = 1.001,
- comment = "companion to sort-ini.tex",
+ comment = "companion to sort-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- todo:
---
--- out of range
--- uppercase
--- texutil compatible
--- always expand to utf
+-- It took a while to get there, but with Fleetwood Mac's "Don't Stop"
+-- playing in the background we sort of got it done.
+
+-- todo: cleanup splits (in other modules)
local utf = unicode.utf8
-local gsub, rep = string.gsub, string.rep
+local gsub, rep, sort, concat = string.gsub, string.rep, table.sort, table.concat
+local utfbyte, utfchar = utf.byte, utf.char
local utfcharacters, utfvalues, strcharacters = string.utfcharacters, string.utfvalues, string.characters
+local chardata = characters.data
+local next, type, tonumber = next, type, tonumber
+
+local trace_tests = false trackers.register("sorters.tests", function(v) trace_tests = v end)
sorters = { }
sorters.comparers = { }
@@ -23,30 +26,49 @@ sorters.splitters = { }
sorters.entries = { }
sorters.mappings = { }
sorters.replacements = { }
-sorters.language = 'en'
-function sorters.comparers.basic(sort_a,sort_b)
- -- sm assignment is slow, will become sorters.initialize
- local sm = sorters.mappings[sorters.language or sorters.defaultlanguage] or sorters.mappings.en
- if #sort_a > #sort_b then
+sorters.ignored_offset = 0x10000
+sorters.replacement_offset = 0x10000
+sorters.digits_offset = 0x20000
+sorters.digits_maximum = 0xFFFFF
+
+local ignored_offset = sorters.ignored_offset
+local digits_offset = sorters.digits_offset
+local digits_maximum = sorters.digits_maximum
+
+local mappings = sorters.mappings
+local entries = sorters.entries
+local replacements = sorters.replacements
+
+local language, defaultlanguage, dummy = 'en', 'en', { }
+
+local currentreplacements, currentmappings, currententries
+
+function sorters.setlanguage(lang)
+ language = lang or language or defaultlanguage
+ currentreplacements = replacements[language] or replacements[defaultlanguage] or dummy
+ currentmappings = mappings [language] or mappings [defaultlanguage] or dummy
+ currententries = entries [language] or entries [defaultlanguage] or dummy
+ return currentreplacements, currentmappings, currententries
+end
+
+sorters.setlanguage()
+
+-- maybe inline code if it's too slow
+
+local function basicsort(sort_a,sort_b)
+ if not sort_a or not sort_b then
+ return 0
+ elseif #sort_a > #sort_b then
if #sort_b == 0 then
return 1
else
for i=1,#sort_b do
local ai, bi = sort_a[i], sort_b[i]
- local am, bm = sm[ai], sm[bi]
- if am and bm then
- if am > bm then
- return 1
- elseif am < bm then
- return -1
- end
- else
- if ai > bi then
- return 1
- elseif ai < bi then
- return -1
- end
+ if ai > bi then
+ return 1
+ elseif ai < bi then
+ return -1
end
end
return 1
@@ -57,19 +79,10 @@ function sorters.comparers.basic(sort_a,sort_b)
else
for i=1,#sort_a do
local ai, bi = sort_a[i], sort_b[i]
- local am, bm = sm[ai], sm[bi]
- if am and bm then
- if am > bm then
- return 1
- elseif am < bm then
- return -1
- end
- else
- if ai > bi then
- return 1
- elseif ai < bi then
- return -1
- end
+ if ai > bi then
+ return 1
+ elseif ai < bi then
+ return -1
end
end
return -1
@@ -79,71 +92,226 @@ function sorters.comparers.basic(sort_a,sort_b)
else
for i=1,#sort_a do
local ai, bi = sort_a[i], sort_b[i]
- local am, bm = sm[ai], sm[bi]
- if am and bm then
- if am > bm then
- return 1
- elseif am < bm then
- return -1
- end
- else
- if ai > bi then
- return 1
- elseif ai < bi then
- return -1
- end
+ if ai > bi then
+ return 1
+ elseif ai < bi then
+ return -1
end
end
return 0
end
end
-local function padd(s) return rep(" ",10-#s) .. s end -- or format with padd
+function sorters.comparers.basic(a,b)
+ local ea, eb = a.split, b.split
+ local na, nb = #ea, #eb
+ if na == 0 and nb == 0 then
+ -- simple variant (single word)
+ local result = basicsort(ea.e,eb.e)
+ return result == 0 and result or basicsort(ea.m,eb.m)
+ else
+ -- complex variant, used in register (multiple words)
+ local result = 0
+ for i=1,nb < na and nb or na do
+ local eai, ebi = ea[i], eb[i]
+ result = basicsort(eai.e,ebi.e)
+ if result == 0 then
+ result = basicsort(eai.m,ebi.m) -- only needed it there are m's
+ end
+ if result ~= 0 then
+ break
+ end
+ end
+ if result ~= 0 then
+ return result
+ elseif na > nb then
+ return 1
+ elseif nb > na then
+ return -1
+ else
+ return 0
+ end
+ end
+end
+
+local function numify(s)
+ return rep(" ",10-#s) .. s -- or format with padd
+end
+
+local function numify(s)
+ s = digits_offset + tonumber(s)
+ if s > digits_maximum then
+ s = digits_maximum
+ end
+ return utfchar(s)
+end
function sorters.strip(str) -- todo: only letters and such utf.gsub("([^%w%d])","")
if str then
str = gsub(str,"\\%S*","")
str = gsub(str,"[%s%[%](){}%$\"\']*","")
- str = gsub(str,"(%d+)",padd) -- sort numbers properly
+ str = gsub(str,"(%d+)",numify) -- sort numbers properly
return str
else
return ""
end
end
-function sorters.firstofsplit(split)
+local function firstofsplit(entry)
-- numbers are left padded by spaces
- local se = sorters.entries[sorters.language or sorters.defaultlanguage] -- slow, will become sorters.initialize
- local vs = split[1]
- local entry = (vs and vs[1]) or ""
- return entry, (se and se[entry]) or "\000"
+ local split = entry.split
+ if #split > 0 then
+ split = split[1].s
+ else
+ split = split.s
+ end
+ local entry = split and split[1] or ""
+ return entry, currententries[entry] or "\000"
end
-sorters.defaultlanguage = 'en'
+sorters.firstofsplit = firstofsplit
-- beware, numbers get spaces in front
-function sorters.splitters.utf(str) -- brrr, todo: language
- local r = sorters.replacements[sorters.language] or sorters.replacements[sorters.defaultlanguage] or { }
---~ local m = sorters.mappings [sorters.language] or sorters.mappings [sorters.defaultlanguage] or { }
- local u = characters.uncompose
- local b = utf.byte
- local t = { }
- for _,v in next, r do
- str = gsub(str,v[1],v[2])
+function sorters.splitters.utf(str)
+ if #currentreplacements > 0 then
+ for k=1,#currentreplacements do
+ local v = currentreplacements[k]
+ str = gsub(str,v[1],v[2])
+ end
end
- for c in utfcharacters(str) do -- maybe an lpeg
- if #c == 1 then
- t[#t+1] = c
- else
- for cc in strcharacters(c) do
- t[#t+1] = cc
+ local s, e, m, n = { }, { }, { }, 0
+ for sc in utfcharacters(str) do -- maybe an lpeg
+ local ec, mc = currententries[sc], currentmappings[sc] or utfbyte(sc)
+ n = n + 1
+ s[n] = sc
+ e[n] = currentmappings[ec] or mc
+ m[n] = mc
+ end
+ return { s = s, e = e, m = m }
+end
+
+-- we can use one array instead (sort of like in mkii)
+-- but for the moment we do it this way as it is more
+-- handy for tracing
+
+-- function sorters.splitters.utf(str)
+-- if #currentreplacements > 0 then
+-- for k=1,#currentreplacements do
+-- local v = currentreplacements[k]
+-- str = gsub(str,v[1],v[2])
+-- end
+-- end
+-- local s, e, m, n = { }, { }, { }, 0
+-- for sc in utfcharacters(str) do -- maybe an lpeg
+-- local ec, mc = currententries[sc], currentmappings[sc] or utfbyte(sc)
+-- n = n + 1
+-- ec = currentmappings[ec] or mc
+-- s[n] = sc
+-- e[n] = ec
+-- if ec ~= mc then
+-- n = n + 1
+-- e[n] = mc
+-- end
+-- end
+-- return { s = s, e = e }
+-- end
+
+function table.remap(t)
+ local tt = { }
+ for k,v in next, t do
+ tt[v] = k
+ end
+ return tt
+end
+
+local function pack(entry)
+ local t = { }
+ local split = entry.split
+ if #split > 0 then
+ for i=1,#split do
+ local tt, li = { }, split[i].s
+ for j=1,#li do
+ local lij = li[j]
+ tt[j] = utfbyte(lij) > ignored_offset and "[]" or lij
end
+ t[i] = concat(tt)
end
+ return concat(t," + ")
+ else
+ local t, li = { }, split.s
+ for j=1,#li do
+ local lij = li[j]
+ t[j] = utfbyte(lij) > ignored_offset and "[]" or lij
+ end
+ return concat(t)
end
- return t
end
function sorters.sort(entries,cmp)
- table.sort(entries,function(a,b) return cmp(a,b) == -1 end)
+ if trace_tests then
+ sort(entries,function(a,b)
+ local r = cmp(a,b)
+ logs.report("sorter","%s %s %s",pack(a),(not r and "?") or (r<0 and "<") or (r>0 and ">") or "=",pack(b))
+ return r == -1
+ end)
+ local s
+ for i=1,#entries do
+ local entry = entries[i]
+ local letter, first = firstofsplit(entry)
+ if first == s then
+ first = " "
+ else
+ s = first
+ logs.report("sorter",">> %s 0x%05X (%s 0x%05X)",first,utfbyte(first),letter,utfbyte(letter))
+ end
+ logs.report("sorter"," %s",pack(entry))
+ end
+ else
+ sort(entries,function(a,b)
+ return cmp(a,b) == -1
+ end)
+ end
+end
+
+-- some day we can have a characters.upper and characters.lower
+
+function sorters.add_uppercase_replacements(what)
+ local rep, new = replacements[what], { }
+ for i=1,#rep do
+ local r = rep[i]
+ local u = chardata[utfbyte(r[1])].uccode
+ if u then
+ new[utfchar(u)] = r[2]
+ end
+ end
+ for k, v in next, new do
+ rep[k] = v
+ end
+end
+
+function sorters.add_uppercase_entries(what)
+ local ent, new = entries[what], { }
+ for k, v in next, ent do
+ local u = chardata[utfbyte(k)].uccode
+ if u then
+ new[utfchar(u)] = v
+ end
+ end
+ for k, v in next, new do
+ ent[k] = v
+ end
+end
+
+function sorters.add_uppercase_mappings(what,offset)
+ local map, new, offset = mappings[what], { }, offset or 0
+ for k, v in next, map do
+ local u = chardata[utfbyte(k)].uccode
+ if u then
+ new[utfchar(u)] = v + offset
+ end
+ end
+ for k, v in next, new do
+ map[k] = v
+ end
end
diff --git a/Master/texmf-dist/tex/context/base/sort-lan.lua b/Master/texmf-dist/tex/context/base/sort-lan.lua
index 5d4ded78eab..ed7e8ba3550 100644
--- a/Master/texmf-dist/tex/context/base/sort-lan.lua
+++ b/Master/texmf-dist/tex/context/base/sort-lan.lua
@@ -1,22 +1,33 @@
if not modules then modules = { } end modules ['sort-lan'] = {
version = 1.001,
- comment = "companion to sort-lan.tex",
+ comment = "companion to sort-lan.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-local utf = unicode.utf8
-
-- this is a rather preliminary and incomplete file
-- maybe we should load this kind of stuff runtime
--- english
+-- replacements are indexed as they need to be applied in sequence
--- The next one can be more efficient when not indexed this way, but
--- other languages are sparse so for the moment we keep this one.
+local utf = unicode.utf8
+local uc = utf.char
+local ub = utf.byte
+
+local mappings = sorters.mappings
+local entries = sorters.entries
+local replacements = sorters.replacements
+
+local add_uppercase_replacements = sorters.add_uppercase_replacements
+local add_uppercase_entries = sorters.add_uppercase_entries
+local add_uppercase_mappings = sorters.add_uppercase_mappings
+
+local replacement_offset = sorters.replacement_offset
+
+-- english
-sorters.entries['en'] = {
+entries['en'] = {
["a"] = "a", ["b"] = "b", ["c"] = "c", ["d"] = "d", ["e"] = "e",
["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i", ["j"] = "j",
["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o",
@@ -31,269 +42,278 @@ sorters.entries['en'] = {
["Z"] = "z",
}
-sorters.mappings['en'] = {
+mappings['en'] = {
["a"] = 1, ["b"] = 3, ["c"] = 5, ["d"] = 7, ["e"] = 9,
["f"] = 11, ["g"] = 13, ["h"] = 15, ["i"] = 17, ["j"] = 19,
["k"] = 21, ["l"] = 23, ["m"] = 25, ["n"] = 27, ["o"] = 29,
["p"] = 31, ["q"] = 33, ["r"] = 35, ["s"] = 37, ["t"] = 39,
["u"] = 41, ["v"] = 43, ["w"] = 45, ["x"] = 47, ["y"] = 49,
["z"] = 51,
- ["A"] = 2, ["B"] = 4, ["C"] = 6, ["D"] = 8, ["E"] = 10,
- ["F"] = 12, ["G"] = 14, ["H"] = 16, ["I"] = 18, ["J"] = 20,
- ["K"] = 22, ["L"] = 24, ["M"] = 26, ["N"] = 28, ["O"] = 30,
- ["P"] = 32, ["Q"] = 34, ["R"] = 36, ["S"] = 38, ["T"] = 40,
- ["U"] = 42, ["V"] = 44, ["W"] = 46, ["X"] = 48, ["Y"] = 50,
- ["Z"] = 52,
+ ["A"] = 1, ["B"] = 3, ["C"] = 5, ["D"] = 7, ["E"] = 9,
+ ["F"] = 11, ["G"] = 13, ["H"] = 15, ["I"] = 17, ["J"] = 19,
+ ["K"] = 21, ["L"] = 23, ["M"] = 25, ["N"] = 27, ["O"] = 29,
+ ["P"] = 31, ["Q"] = 33, ["R"] = 35, ["S"] = 37, ["T"] = 39,
+ ["U"] = 41, ["V"] = 43, ["W"] = 45, ["X"] = 47, ["Y"] = 49,
+ ["Z"] = 51,
+ --
+ -- uppercase after lowercase
+ --
+ -- ["A"] = 2, ["B"] = 4, ["C"] = 6, ["D"] = 8, ["E"] = 10,
+ -- ["F"] = 12, ["G"] = 14, ["H"] = 16, ["I"] = 18, ["J"] = 20,
+ -- ["K"] = 22, ["L"] = 24, ["M"] = 26, ["N"] = 28, ["O"] = 30,
+ -- ["P"] = 32, ["Q"] = 34, ["R"] = 36, ["S"] = 38, ["T"] = 40,
+ -- ["U"] = 42, ["V"] = 44, ["W"] = 46, ["X"] = 48, ["Y"] = 50,
+ -- ["Z"] = 52,
}
-- dutch
-sorters.replacements['nl'] = { { "ij", 'y' }, { "IJ", 'Y' } }
-sorters.entries ['nl'] = sorters.entries ['en']
-sorters.mappings ['nl'] = sorters.mappings['en']
+replacements['nl'] = { { "ij", 'y' }, { "IJ", 'Y' } }
+entries ['nl'] = entries ['en']
+mappings ['nl'] = mappings['en']
-- czech
-local uc = utf.char
-local ub = utf.byte
+local cz_ch = uc(replacement_offset + 1)
+local cz_CH = uc(replacement_offset + 2)
-sorters.replacements['cz'] = {
- [1] = { "ch", uc(0xFF01) }
+replacements['cz'] = {
+ [1] = { "ch", cz_ch }
}
-sorters.entries['cz'] = {
- ['a'] = "a",
- [uc(0x00E1)] = "a",
- ['b'] = "b",
- ['c'] = "c",
+entries['cz'] = {
+ ['a'] = "a", -- a
+ [uc(0x00E1)] = "a", -- aacute
+ ['b'] = "b", -- b
+ ['c'] = "c", -- c
[uc(0x010D)] = uc(0x010D), -- ccaron
- ['d'] = "d",
- [uc(0x010F)] = uc(0x010F), -- dcaron
- ['e'] = "e",
- [uc(0x00E9)] = "e",
- [uc(0x011B)] = "e",
- ['f'] = "f",
- ['g'] = "g",
- ['h'] = "h",
- [uc(0xFF01)] = "ch",
- ['i'] = "i",
- [uc(0x00ED)] = "i",
- ['j'] = "j",
- ['k'] = "k",
- ['l'] = "l",
- ['m'] = "m",
- ['n'] = "n",
- [uc(0x0147)] = uc(0x0147), -- ncaron
- ['o'] = "o",
- ['p'] = "p",
- ['q'] = "q",
- ['s'] = "r",
- [uc(0x0147)] = uc(0x0147), -- rcaron
- ['s'] = "s",
+ ['d'] = "d", -- d
+ [uc(0x010F)] = "d", -- dcaron
+ ['e'] = "e", -- e
+ [uc(0x00E9)] = "e", -- eacute
+ [uc(0x011B)] = "e", -- ecaron
+ ['f'] = "f", -- f
+ ['g'] = "g", -- g
+ ['h'] = "h", -- h
+ [cz_ch] = "ch", -- ch
+ ['i'] = "i", -- i
+ [uc(0x00ED)] = "i", -- iacute
+ ['j'] = "j", -- j
+ ['k'] = "k", -- k
+ ['l'] = "l", -- l
+ ['m'] = "m", -- m
+ ['n'] = "n", -- n
+ ['ň'] = "n", -- ncaron
+ ['o'] = "o", -- o
+ ['p'] = "p", -- p
+ ['q'] = "q", -- q
+ ['r'] = "r", -- r
+ ['ř'] = "ř", -- rcaron
+ ['s'] = "s", -- s
[uc(0x0161)] = uc(0x0161), -- scaron
- ['t'] = "t",
- [uc(0x0165)] = uc(0x0165), -- tcaron
- ['u'] = "u",
- [uc(0x00FA)] = "u",
- [uc(0x01F6)] = "u",
- ['v'] = "v",
- ['w'] = "w",
- ['x'] = "x",
- ['y'] = "y",
- ['z'] = "z",
+ ['t'] = "t", -- t
+ [uc(0x0165)] = "t", -- tcaron
+ ['u'] = "u", -- u
+ [uc(0x00FA)] = "u", -- uacute
+ [uc(0x016F)] = "u", -- uring
+ ['v'] = "v", -- v
+ ['w'] = "w", -- w
+ ['x'] = "x", -- x
+ ['y'] = "y", -- y
+ [uc(0x00FD)] = "y", -- yacute
+ ['z'] = "z", -- z
[uc(0x017E)] = uc(0x017E), -- zcaron
}
-sorters.mappings['cz'] = {
+mappings['cz'] = {
['a'] = 1, -- a
- [uc(0x00E1)] = 2, -- aacute
- ['b'] = 3, -- b
- ['c'] = 4, -- c
- [uc(0x010D)] = 5, -- ccaron
- ['d'] = 6, -- d
- [uc(0x010F)] = 7, -- dcaron
- ['e'] = 8, -- e
- [uc(0x00E9)] = 9, -- eacute
- [uc(0x011B)] = 10, -- ecaron
- ['f'] = 11, -- f
- ['g'] = 12, -- g
- ['h'] = 13, -- h
- [uc(0xFF01)] = 14, -- ch
- ['i'] = 15, -- i
- [uc(0x00ED)] = 16, -- iacute
- ['j'] = 17, -- j
- ['k'] = 18, -- k
- ['l'] = 19, -- l
- ['m'] = 20, -- m
- ['n'] = 21, -- n
- [uc(0x0147)] = 22, -- ncaron
- ['o'] = 23, -- o
- ['p'] = 24, -- p
- ['q'] = 25, -- q
- ['s'] = 26, -- r
- [uc(0x0147)] = 27, -- rcaron
- ['s'] = 28, -- s
- [uc(0x0161)] = 29, -- scaron
- ['t'] = 30, -- t
- [uc(0x0165)] = 31, -- tcaron
- ['u'] = 32, -- u
- [uc(0x00FA)] = 33, -- uacute
- [uc(0x01F6)] = 34, -- uring
- ['v'] = 35, -- v
- ['w'] = 36, -- w
- ['x'] = 37, -- x
- ['y'] = 38, -- y
- ['z'] = 49, -- z
- [uc(0x017E)] = 40, -- zcaron
+ [uc(0x00E1)] = 3, -- aacute
+ ['b'] = 5, -- b
+ ['c'] = 7, -- c
+ [uc(0x010D)] = 9, -- ccaron
+ ['d'] = 11, -- d
+ [uc(0x010F)] = 13, -- dcaron
+ ['e'] = 15, -- e
+ [uc(0x00E9)] = 17, -- eacute
+ [uc(0x011B)] = 19, -- ecaron
+ ['f'] = 21, -- f
+ ['g'] = 23, -- g
+ ['h'] = 25, -- h
+ [cz_ch] = 27, -- ch
+ ['i'] = 29, -- i
+ [uc(0x00ED)] = 31, -- iacute
+ ['j'] = 33, -- j
+ ['k'] = 35, -- k
+ ['l'] = 37, -- l
+ ['m'] = 39, -- m
+ ['n'] = 41, -- n
+ ['ň'] = 43, -- ncaron
+ ['o'] = 45, -- o
+ ['p'] = 47, -- p
+ ['q'] = 49, -- q
+ ['r'] = 51, -- r
+ ['ř'] = 53, -- rcaron
+ ['s'] = 55, -- s
+ [uc(0x0161)] = 57, -- scaron
+ ['t'] = 59, -- t
+ [uc(0x0165)] = 61, -- tcaron
+ ['u'] = 63, -- u
+ [uc(0x00FA)] = 65, -- uacute
+ [uc(0x016F)] = 67, -- uring
+ ['v'] = 69, -- v
+ ['w'] = 71, -- w
+ ['x'] = 73, -- x
+ ['y'] = 75, -- y
+ [uc(0x00FD)] = 77, -- yacute
+ ['z'] = 79, -- z
+ [uc(0x017E)] = 81, -- zcaron
}
+add_uppercase_entries ("cz")
+add_uppercase_mappings("cz") -- 1 can be option (but then we need a runtime variant)
+
+entries ['cz'][cz_CH] = entries ['cz'][cz_ch]
+mappings['cz'][cz_CH] = mappings['cz'][cz_ch]
+
+replacements['cs'] = replacements['cz']
+entries ['cs'] = entries ['cz']
+mappings ['cs'] = mappings ['cz']
+
+--~ print(table.serialize(mappings.cs))
+
+-- French
+
+entries ['fr'] = entries ['en']
+mappings['fr'] = mappings['en']
+
-- German (by Wolfgang Schuster)
-- DIN 5007-1
-sorters.entries ['DIN 5007-1'] = sorters.entries ['en']
-sorters.mappings ['DIN 5007-1'] = sorters.mappings['en']
+entries ['DIN 5007-1'] = entries ['en']
+mappings ['DIN 5007-1'] = mappings['en']
-- DIN 5007-2
-sorters.replacements['DIN 5007-2'] = {
+replacements['DIN 5007-2'] = { -- todo: add_uppercase_replacements
{ "ä", 'ae' },
{ "ö", 'oe' },
{ "ü", 'ue' },
{ "Ä", 'Ae' },
{ "Ö", 'Oe' },
- { "Ü", 'Ue' }
+ { "Ü", 'Ue' },
}
-sorters.entries ['DIN 5007-2'] = sorters.entries ['en']
-sorters.mappings ['DIN 5007-2'] = sorters.mappings['en']
+--~ add_uppercase_replacements('DIN 5007-2')
+
+entries ['DIN 5007-2'] = entries ['en']
+mappings ['DIN 5007-2'] = mappings['en']
-- Duden
-sorters.replacements['Duden'] = { { "ß", 's' } }
-sorters.entries ['Duden'] = sorters.entries ['en']
-sorters.mappings ['Duden'] = sorters.mappings['en']
+replacements['Duden'] = { { "ß", 's' } }
+entries ['Duden'] = entries ['en']
+mappings ['Duden'] = mappings['en']
-- new german
-sorters.entries ['de'] = sorters.entries ['en']
-sorters.mappings ['de'] = sorters.mappings['en']
+entries ['de'] = entries ['en']
+mappings ['de'] = mappings['en']
-- old german
-sorters.entries ['deo'] = sorters.entries ['de']
-sorters.mappings ['deo'] = sorters.mappings['de']
+entries ['deo'] = entries ['de']
+mappings ['deo'] = mappings['de']
-- german - Germany
-sorters.entries ['de-DE'] = sorters.entries ['de']
-sorters.mappings ['de-DE'] = sorters.mappings['de']
+entries ['de-DE'] = entries ['de']
+mappings ['de-DE'] = mappings['de']
-- german - Swiss
-sorters.entries ['de-CH'] = sorters.entries ['de']
-sorters.mappings ['de-CH'] = sorters.mappings['de']
+entries ['de-CH'] = entries ['de']
+mappings ['de-CH'] = mappings['de']
-- german - Austria
-sorters.entries['de-AT'] = {
+entries['de-AT'] = {
["a"] = "a", ["ä"] = "ä", ["b"] = "b", ["c"] = "c", ["d"] = "d",
["e"] = "e", ["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i",
["j"] = "j", ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n",
["o"] = "o", ["ö"] = "ö", ["p"] = "p", ["q"] = "q", ["r"] = "r",
["s"] = "s", ["t"] = "t", ["u"] = "u", ["ü"] = "ü", ["v"] = "v",
["w"] = "w", ["x"] = "x", ["y"] = "y", ["z"] = "z",
- ["A"] = "a", ["Ä"] = "ä", ["B"] = "b", ["C"] = "c", ["D"] = "d",
- ["E"] = "e", ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i",
- ["J"] = "j", ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n",
- ["O"] = "o", ["Ö"] = "ö", ["P"] = "p", ["Q"] = "q", ["R"] = "r",
- ["S"] = "s", ["T"] = "t", ["U"] = "u", ["Ü"] = "ü", ["V"] = "v",
- ["W"] = "w", ["X"] = "x", ["Y"] = "y", ["Z"] = "z",
+-- ["A"] = "a", ["Ä"] = "ä", ["B"] = "b", ["C"] = "c", ["D"] = "d",
+-- ["E"] = "e", ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i",
+-- ["J"] = "j", ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n",
+-- ["O"] = "o", ["Ö"] = "ö", ["P"] = "p", ["Q"] = "q", ["R"] = "r",
+-- ["S"] = "s", ["T"] = "t", ["U"] = "u", ["Ü"] = "ü", ["V"] = "v",
+-- ["W"] = "w", ["X"] = "x", ["Y"] = "y", ["Z"] = "z",
}
-sorters.mappings['de-AT'] = {
+mappings['de-AT'] = {
["a"] = 1, ["ä"] = 3, ["b"] = 5, ["c"] = 7, ["d"] = 9,
["e"] = 11, ["f"] = 13, ["g"] = 15, ["h"] = 17, ["i"] = 19,
["j"] = 21, ["k"] = 23, ["l"] = 25, ["m"] = 27, ["n"] = 29,
["o"] = 31, ["ö"] = 33, ["p"] = 35, ["q"] = 37, ["r"] = 39,
["s"] = 41, ["t"] = 43, ["u"] = 45, ["ü"] = 47, ["v"] = 49,
["w"] = 51, ["x"] = 53, ["y"] = 55, ["z"] = 57,
- ["A"] = 2, ["Ä"] = 4, ["B"] = 6, ["C"] = 8, ["D"] = 10,
- ["E"] = 12, ["F"] = 14, ["G"] = 16, ["H"] = 18, ["I"] = 20,
- ["J"] = 22, ["K"] = 24, ["L"] = 26, ["M"] = 28, ["N"] = 30,
- ["O"] = 32, ["Ö"] = 34, ["P"] = 36, ["Q"] = 38, ["R"] = 40,
- ["S"] = 42, ["T"] = 44, ["U"] = 46, ["Ü"] = 48, ["V"] = 50,
- ["W"] = 52, ["X"] = 54, ["Y"] = 56, ["Z"] = 58,
+-- ["A"] = 2, ["Ä"] = 4, ["B"] = 6, ["C"] = 8, ["D"] = 10,
+-- ["E"] = 12, ["F"] = 14, ["G"] = 16, ["H"] = 18, ["I"] = 20,
+-- ["J"] = 22, ["K"] = 24, ["L"] = 26, ["M"] = 28, ["N"] = 30,
+-- ["O"] = 32, ["Ö"] = 34, ["P"] = 36, ["Q"] = 38, ["R"] = 40,
+-- ["S"] = 42, ["T"] = 44, ["U"] = 46, ["Ü"] = 48, ["V"] = 50,
+-- ["W"] = 52, ["X"] = 54, ["Y"] = 56, ["Z"] = 58,
}
--- finish (by Wolfgang Schuster)
+add_uppercase_entries ('de-AT')
+add_uppercase_mappings('de-AT',1)
-sorters.entries['fi'] = {
- [ 1] = "a", [ 3] = "b", [ 5] = "c", [ 7] = "d", [ 9] = "e",
- [11] = "f", [13] = "g", [15] = "h", [17] = "i", [19] = "j",
- [21] = "k", [23] = "l", [25] = "m", [27] = "n", [29] = "o",
- [31] = "p", [33] = "q", [35] = "r", [37] = "s", [39] = "t",
- [41] = "u", [43] = "v", [45] = "w", [47] = "x", [49] = "y",
- [51] = "z", [53] = "å", [55] = "ä", [57] = "ö",
- [ 2] = 1, [ 4] = 3, [ 6] = 5, [ 8] = 7, [10] = 9,
- [12] = 11, [14] = 13, [16] = 15, [18] = 17, [20] = 19,
- [22] = 21, [24] = 23, [26] = 25, [28] = 27, [30] = 29,
- [32] = 31, [34] = 33, [36] = 35, [38] = 37, [40] = 39,
- [42] = 41, [44] = 43, [46] = 45, [48] = 47, [50] = 49,
- [52] = 51, [54] = 53, [56] = 55, [58] = 57,
-}
+-- finish (by Wolfgang Schuster)
-sorters.entries['fi'] = {
+entries['fi'] = {
["a"] = "a", ["b"] = "b", ["c"] = "c", ["d"] = "d", ["e"] = "e",
["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i", ["j"] = "j",
["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o",
["p"] = "p", ["q"] = "q", ["r"] = "r", ["s"] = "s", ["t"] = "t",
["u"] = "u", ["v"] = "v", ["w"] = "w", ["x"] = "x", ["y"] = "y",
["z"] = "z", ["å"] = "å", ["ä"] = "ä", ["ö"] = "ö",
- ["A"] = "a", ["B"] = "b", ["C"] = "c", ["D"] = "d", ["E"] = "e",
- ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i", ["J"] = "j",
- ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n", ["O"] = "o",
- ["P"] = "p", ["Q"] = "q", ["R"] = "r", ["S"] = "s", ["T"] = "t",
- ["U"] = "u", ["V"] = "v", ["W"] = "w", ["X"] = "x", ["Y"] = "y",
- ["Z"] = "z", ["Å"] = "å", ["Ä"] = "ä", ["Ö"] = "ö",
}
---~ sorters.test = ''
---~ sorters.test = 'nl'
---~ sorters.test = 'cz'
-
---~ if sorters.test == 'nl' then -- dutch test
-
---~ data = {
---~ { 'e', { {"ijsco",""} },2,"","","",""},
---~ { 'e', { {"ysco" ,""} },2,"","","",""},
---~ { 'e', { {"ijsco",""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"aap" ,""} },2,"","","",""},
---~ { 'e', { {"$a$" ,""} },2,"","","",""},
---~ { 'e', { {"aap" ,""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"aap" ,""} },6,"","","",""},
---~ { 'e', { {"hans" ,""}, {"noot",""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"mies",""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"mies",""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"mies",""}, [3] = {"oeps",""} },2,"","","",""},
---~ { 'e', { {"hans" ,""}, {"mies",""}, [3] = {"oeps",""} },4,"","","",""},
---~ }
---~ sorters.index.process({ entries = data, language = 'nl'})
-
---~ elseif sorters.test == 'cz' then -- czech test
-
---~ data = {
---~ { 'e', { {"blabla",""} },2,"","","",""},
---~ { 'e', { {"czacza",""} },2,"","","",""},
---~ { 'e', { {"albalb",""} },2,"","","",""},
---~ { 'e', { {"azcazc",""} },2,"","","",""},
---~ { 'e', { {"chacha",""} },2,"","","",""},
---~ { 'e', { {"hazzah",""} },2,"","","",""},
---~ { 'e', { {"iaccai",""} },2,"","","",""},
---~ }
---~ sorters.index.process({ entries = data, language = 'cz'})
-
---~ end
-
-
---~ print(table.serialize(sorters))
+mappings['fi'] = {
+ ["a"] = 1, ["b"] = 3, ["c"] = 5, ["d"] = 7, ["e"] = 9,
+ ["f"] = 11, ["g"] = 13, ["h"] = 15, ["i"] = 17, ["j"] = 19,
+ ["k"] = 21, ["l"] = 23, ["m"] = 25, ["n"] = 27, ["o"] = 29,
+ ["p"] = 31, ["q"] = 33, ["r"] = 35, ["s"] = 37, ["t"] = 39,
+ ["u"] = 41, ["v"] = 43, ["w"] = 45, ["x"] = 47, ["y"] = 49,
+ ["z"] = 51, ["å"] = 53, ["ä"] = 55, ["ö"] = 57,
+}
+
+add_uppercase_entries ("fi")
+add_uppercase_mappings("fi")
+
+-- slovenian
+--
+-- MM: this will change since we need to add accented vowels
+
+entries['sl'] = {
+ ["a"] = "a", ["b"] = "b", ["c"] = "c", ["č"] = "č", ["ć"] = "ć", ["d"] = "d",
+ ["đ"] = "đ", ["e"] = "e", ["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i",
+ ["j"] = "j", ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o",
+ ["p"] = "p", ["q"] = "q", ["r"] = "r", ["s"] = "s", ["š"] = "š", ["t"] = "t",
+ ["u"] = "u", ["v"] = "v", ["w"] = "w", ["x"] = "x", ["y"] = "y", ["z"] = "z",
+ ["ž"] = "ž",
+}
+
+mappings['sl'] = {
+ ["a"] = 1, ["b"] = 3, ["c"] = 5, ["č"] = 7, ["ć"] = 9, ["d"] = 11,
+ ["đ"] = 13, ["e"] = 15, ["f"] = 17, ["g"] = 19, ["h"] = 21, ["i"] = 23,
+ ["j"] = 25, ["k"] = 27, ["l"] = 29, ["m"] = 31, ["n"] = 33, ["o"] = 35,
+ ["p"] = 37, ["q"] = 39, ["r"] = 41, ["s"] = 43, ["š"] = 45, ["t"] = 47,
+ ["u"] = 49, ["v"] = 51, ["w"] = 53, ["x"] = 55, ["y"] = 57, ["z"] = 59,
+ ["ž"] = 61,
+}
+
+add_uppercase_entries ("sl")
+add_uppercase_mappings("sl") -- cf. MM
diff --git a/Master/texmf-dist/tex/context/base/sort-lan.mkii b/Master/texmf-dist/tex/context/base/sort-lan.mkii
index ad5232b02c8..db52c63fb66 100644
--- a/Master/texmf-dist/tex/context/base/sort-lan.mkii
+++ b/Master/texmf-dist/tex/context/base/sort-lan.mkii
@@ -45,13 +45,13 @@
% \exportsortexpansion {cacute} {czz}
% \exportsortexpansion {dstroke} {dz}
% \exportsortexpansion {scaron} {sz}
-% \exportsortexpansion {zacron} {zz}
+% \exportsortexpansion {zcaron} {zz}
% \exportsortdivision {cz} {ccaron}
% \exportsortdivision {czz} {cacute}
% \exportsortdivision {dz} {dstroke}
% \exportsortdivision {sz} {scaron}
-% \exportsortdivision {zz} {zacron}
+% \exportsortdivision {zz} {zcaron}
% \stopmode
%
% \startmode[sortorder-sl]
@@ -59,13 +59,13 @@
% \exportsortexpansion {cacute} {c+2}
% \exportsortexpansion {dstroke} {d+1}
% \exportsortexpansion {scaron} {s+1}
-% \exportsortexpansion {zacron} {z+1}
+% \exportsortexpansion {zcaron} {z+1}
%
% \exportsortdivision {c+1} {ccaron}
% \exportsortdivision {c+2} {cacute}
% \exportsortdivision {d+1} {dstroke}
% \exportsortdivision {s+1} {scaron}
-% \exportsortdivision {z+1} {zacron}
+% \exportsortdivision {z+1} {zcaron}
% \stopmode
\startmode[sortorder-sl]
@@ -73,7 +73,7 @@
\exportsortrule {cacute} {c+2}
\exportsortrule {dstroke} {d+1}
\exportsortrule {scaron} {s+1}
- \exportsortrule {zacron} {z+1}
+ \exportsortrule {zcaron} {z+1}
\stopmode
% finnish
@@ -156,48 +156,62 @@
\gdef\czsortdivisionCh{Ch}
\startmode[sortorder-cz]
- \exportsortexpansion {aacute} {a+1}
- \exportsortexpansion {Aacute} {A+1}
+ \exportsortexpansion {aacute} {a}
+ \exportsortexpansion {Aacute} {A}
\exportsortexpansion {ccaron} {c+1}
\exportsortexpansion {Ccaron} {C+1}
\exportsortdivision {c+1} {ccaron}
- \exportsortexpansion {dcaron} {d+1}
- \exportsortexpansion {Dcaron} {D+1}
- \exportsortdivision {d+1} {dcaron}
- \exportsortexpansion {eacute} {e+1}
- \exportsortexpansion {Eacute} {E+1}
- \exportsortexpansion {ecaron} {e+2}
- \exportsortexpansion {Ecaron} {E+2}
+ \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+1}
- \exportsortexpansion {Iacute} {I+1}
- \exportsortexpansion {ncaron} {n+1}
- \exportsortexpansion {Ncaron} {N+1}
- \exportsortdivision {n+1} {ncaron}
- \exportsortexpansion {oacute} {o+1}
- \exportsortexpansion {Oacute} {O+1}
+ \exportsortexpansion {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+1}
- \exportsortexpansion {Tcaron} {T+1}
- \exportsortdivision {t+1} {tcaron}
- \exportsortexpansion {uacute} {u+1}
- \exportsortexpansion {Uacute} {U+1}
- \exportsortexpansion {uring} {u+2}
- \exportsortexpansion {Uring} {U+2}
- \exportsortexpansion {yacute} {y+1}
- \exportsortexpansion {Yacute} {Y+1}
+ \exportsortexpansion {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/spac-ali.mkiv b/Master/texmf-dist/tex/context/base/spac-ali.mkiv
new file mode 100644
index 00000000000..b168a02be27
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-ali.mkiv
@@ -0,0 +1,677 @@
+%D \module
+%D [ file=spac-ali,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Alignments,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Alignments}
+
+\unprotect
+
+% We will not use bodydir and pagedir so we disable them. That way we get
+% normal hyperlink support.
+
+\let\@@bodydir\normalbodydir
+\let\@@pagedir\normalpagedir
+
+\unexpanded\def\bodydir{\afterassignment\do@@bodydir\@@bodydir} \let\normalbodydir\bodydir
+\unexpanded\def\pagedir{\afterassignment\do@@pagedir\@@pagedir} \let\normalpagedir\pagedir
+
+\def\do@@bodydir{\@@bodydir TLT\relax}
+\def\do@@pagedir{\@@pagedir TLT\relax}
+
+% This will become a more advanced layout controller soon:
+
+\newconditional\layoutlefttoright \settrue\layoutlefttoright
+\newconditional\displaylefttoright \settrue\displaylefttoright
+\newconditional\inlinelefttoright \settrue\inlinelefttoright
+
+\unexpanded\def\lefttoright
+ {\ifvmode
+ \settrue\displaylefttoright
+ \settrue\inlinelefttoright
+ \textdir TLT\relax
+ \pardir TLT\relax
+ \else
+ \settrue\inlinelefttoright
+ \textdir TLT\relax
+ \fi}
+
+\unexpanded\def\righttoleft
+ {\ifvmode
+ \setfalse\displaylefttoright
+ \setfalse\inlinelefttoright
+ \textdir TRT\relax
+ \pardir TRT\relax
+ \else
+ \textdir TRT\relax
+ \setfalse\inlinelefttoright
+ \fi}
+
+\def\currentdirectionparameters
+ {\ifconditional\inlinelefttoright \else
+ idir="r2l",
+ \fi
+ \ifconditional\displaylefttoright \else
+ ddir="r2l",
+ \fi}
+
+\def\dodefinehbox[#1][#2]%
+ {\setvalue{hbox#1}##1{\hbox to #2{\begstrut##1\endstrut\hss}}}
+
+\unexpanded\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%
+ {\normalexpanded{\noexpand\dodosetraggedcommand{#1}}}
+
+\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}
+
+\setvalue{\@@ragged@@command\v!lefttoright}{\appendtoks\lefttoright\to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!righttoleft}{\appendtoks\righttoleft\to\everyraggedcommand}
+\setvalue{\@@ragged@@command l2r}{\appendtoks\lefttoright\to\everyraggedcommand}
+\setvalue{\@@ragged@@command r2l}{\appendtoks\righttoleft\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}
+
+% More alignments:
+
+% \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:
+
+\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}
+
+\unexpanded\def\startshowpardata
+ {\begingroup
+ \showcomposition
+ \showstruts\tracepositionstrue \tracingparagraphs\maxdimen
+ \appendtoksonce\showpardata\let\showpardata\relax\to\everypar}
+
+\unexpanded\def\stopshowpardata
+ {\endgraf
+ \endgroup}
+
+% defaults
+
+\def\raggedfillamount {1fil}
+\def\raggedhalffillamount{.5fil}
+\def\raggedspaceamount {\interwordspace} % {.3333em}
+\def\raggedxspaceamount {.5em}
+
+\unexpanded\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
+
+\unexpanded\def\raggedleft
+ {\setraggedness\leftraggedness
+ \setraggedskips1\leftraggedness\zeropoint\raggedspaceamount
+ \raggedxspaceamount\zeropoint\zeropoint}
+
+\unexpanded\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.
+
+\unexpanded\def\raggedright
+ {\setraggedness\rightraggedness
+ \setraggedskips3\zeropoint\rightraggedness\raggedspaceamount
+ \raggedxspaceamount\raggedfillamount\parindent}
+
+\unexpanded\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.
+
+\unexpanded\def\veryraggedcenter
+ {\setraggedskips2\raggedfillamount\raggedfillamount\raggedspaceamount
+ \raggedxspaceamount\zeropoint\zeropoint}
+
+\unexpanded\def\veryraggedright
+ {\setraggedskips3\zeropoint\raggedfillamount\raggedspaceamount
+ \raggedxspaceamount\zeropoint\parindent}
+
+\unexpanded\def\ttraggedright
+ {\tttf
+ \setraggedskips3\zeropoint\rightraggedness
+ \zeropoint\zeropoint\zeropoint\parindent} % \ctxparindent
+
+%D A bonus one:
+
+\unexpanded\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}
+
+\installalign \v!righttoleft {\lefttoright}
+\installalign \v!lefttoright {\righttoleft}
+\installalign {l2r} {\lefttoright}
+\installalign {r2l} {\righttoleft}
+
+\newcount\hyphenminoffset
+
+\ifx\sethyphenationvariables\undefined \let\sethyphenationvariables\relax \fi
+
+\unexpanded\def\lesshyphens
+ {\advance\hyphenminoffset\plusone
+ \sethyphenationvariables}
+
+\unexpanded\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}
+
+\unexpanded\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
+
+\unexpanded\def\startalignment
+ {\bgroup
+ \setupalign}
+
+\unexpanded\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
+ {\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
+
+\ifdefined\line \else \def\line {\hbox to\hsize} \fi
+\ifdefined\leftline \else \def\leftline #1{\line{#1\hss}} \fi
+\ifdefined\rightline \else \def\rightline #1{\line{\hss#1}} \fi
+\ifdefined\centerline \else \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:
+
+\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\ifcsname\s!do\v!line#1\endcsname#1\else#2\fi\endcsname}
+
+% \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 (see hyhenation/specialcases-001.tex)
+ \par}}
+
+\unexpanded\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}}
+
+\unexpanded\def\simplealignedbox#1{\executeifdefined{\s!simple\c!align#1}{\getvalue{\s!simple\c!align\v!right}}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spac-def.mkiv b/Master/texmf-dist/tex/context/base/spac-def.mkiv
new file mode 100644
index 00000000000..3aa85dda515
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-def.mkiv
@@ -0,0 +1,118 @@
+%D \module
+%D [ file=spac-def,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Definitions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Definitions}
+
+\unprotect
+
+\def\forgeteverypar
+ {\everypar{\the\neverypar}}
+
+\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!
+
+
+\appendtoks \spacing\plusone \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 \simplesetupindenting \to \everybodyfont
+\appendtoks \simplesetupblank \to \everybodyfont
+\appendtoks \simplesetupwhitespace \to \everybodyfont
+\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
+
+\setupwhitespace
+ [\v!none]
+
+\indenting
+ [\v!never]
+
+\setupindenting
+ [\v!none]
+
+\setupvspacing
+ [\v!standard,
+ \v!big]
+
+\definevspacing[\v!default] [\currentblank]
+\definevspacing[\v!before] [\v!default]
+\definevspacing[\v!inbetween][\v!default]
+\definevspacing[\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/spac-fnt.mkiv b/Master/texmf-dist/tex/context/base/spac-fnt.mkiv
new file mode 100644
index 00000000000..c268d7893cf
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-fnt.mkiv
@@ -0,0 +1,94 @@
+%D \module
+%D [ file=spac-fnt,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Fonts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Fonts}
+
+%D For historic reasons here, will move and/or disappear:
+
+\unprotect
+
+\let\dostopattributes\relax % in case these commands end up in an edef
+
+\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
+
+\newconditional\fontattributeisset
+
+\unexpanded\def\dosetfontattribute#1#2%
+ {\ifcsname#1#2\endcsname
+ \settrue\fontattributeisset % reset is done elsewhere
+ \@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}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-spa.mkii b/Master/texmf-dist/tex/context/base/spac-gen.mkii
index 7c97bcc9c88..8274db1b925 100644
--- a/Master/texmf-dist/tex/context/base/core-spa.mkii
+++ b/Master/texmf-dist/tex/context/base/spac-gen.mkii
@@ -1337,21 +1337,11 @@
\definecomplexorsimple\setupspacing
-% \dorecurse{100}{\recurselevel\spacefactor 800 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \space} \par
-% \dorecurse{100}{\recurselevel\spacefactor 800 \normalspaceprimitive} \par
-% \dorecurse{100}{\recurselevel\spacefactor1200 \normalspaceprimitive} \par
+\let\normalspaceprimitive=\ % space-comment is really needed else \<newline>
-% When we don't add the % here, we effectively get \<endlinechar> and
-% since we have by default \def\^^M{\ } we get into a loop.
+\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\normalspaceprimitive}
-\let\normalspaceprimitive=\ % space-comment is really needed
-
-\unexpanded\def\ {\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
-
-\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\space}
-
-\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace % overloaded later
+\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace
\def\space { }
\def\removelastspace{\ifhmode\unskip\fi}
@@ -1376,7 +1366,10 @@
\unskip\unskip\unskip\unskip\unskip
\fi}
-\appendtoks\let~\space\to\simplifiedcommands
+\appendtoks
+ \let~\space
+ \let\ \space
+\to\simplifiedcommands
% still not fixed in aleph / luatex
%
@@ -1590,11 +1583,9 @@
\fi}
\def\dosetupwhitespace % quick test for no list
- {\ifcsname\??ws\??ws\currentwhitespace\endcsname
- \csname\??ws\??ws\currentwhitespace\endcsname
- \else
- \expandafter\processcommalist\expandafter[\currentwhitespace]\dowhitespacemethod % can be raw
- \fi\relax
+ {\doifdefinedelse{\??ws\??ws\currentwhitespace}% no ifcsname due to nested \lineheight
+ {\getvalue{\??ws\??ws\currentwhitespace}}%
+ {\processcommacommand[\currentwhitespace]\dowhitespacemethod}%
\ifgridsnapping
\setfalse\flexiblewhitespace
\ifdim\ctxparskip>\zeropoint
@@ -1659,8 +1650,8 @@
% \def\dowhitespacemethod#1%
% {\executeifdefined{\??ws\??ws#1}{\ctxparskip#1}\relax}
-\def\dowhitespacemethod#1%
- {\ifcsname\??ws\??ws#1\endcsname\csname\??ws\??ws#1\endcsname\else\ctxparskip#1\fi\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
@@ -2607,6 +2598,9 @@
[ \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,
@@ -4513,10 +4507,10 @@
\def\obeyedspace{\mathortext\normalspace{\dontleavehmode \normalspace }}%
\let\ =\obeyedspace}
-\installspacehandler \v!off
+\installspacehandler \v!off % == default
{\normalspaces
\let\obeyedspace\normalspace
- \let\ =\normalspace}
+ \let\ =\normalspaceprimitive} % was \normalspace
\installspacehandler \v!fixed
{\obeyspaces
diff --git a/Master/texmf-dist/tex/context/base/core-grd.mkii b/Master/texmf-dist/tex/context/base/spac-grd.mkii
index 249e2e4308e..249e2e4308e 100644
--- a/Master/texmf-dist/tex/context/base/core-grd.mkii
+++ b/Master/texmf-dist/tex/context/base/spac-grd.mkii
diff --git a/Master/texmf-dist/tex/context/base/spac-grd.mkiv b/Master/texmf-dist/tex/context/base/spac-grd.mkiv
new file mode 100644
index 00000000000..bd5c51a853e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-grd.mkiv
@@ -0,0 +1,259 @@
+%D \module
+%D [ file=spac-grd,
+%D version=2009.10.16, % 1998.03.10, was core-grd.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Grid Snapping,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This module will be merged intio spac-ver.mkiv.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Grid Snapping}
+
+% buff-ver.mkiv: halfline spacing
+% strc-mat.mkiv: configure math grid (new code needed)
+% page-one.mkiv: to be checked
+% page-mul.mkiv: to be checked and redone
+% page-sid.mkiv: to be checked
+% page-set.mkiv: to be checked
+% strc-not.mkiv: to be checked
+% strc-ren.mkiv: to be checked
+% strc-flt.mkiv: to be checked (captions, probably top/bottom)
+% core-mis.mkiv: to be checked (placement, probbaly harmless)
+
+\unprotect
+
+%D Helpers:
+
+\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 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]
+
+\let\thetopbaselinecorrection \!!zeropoint
+\let\thebotbaselinecorrection \!!zeropoint
+\let\thenegtopbaselinecorrection\!!zeropoint
+\let\thenegbotbaselinecorrection\!!zeropoint
+
+\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<\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}
+
+\unexpanded\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.
+
+\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
+ \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
+
+\let\normalstartbaselinecorrection\startbaselinecorrection
+
+\unexpanded\def\startbaselinecorrection
+ {\ifgridsnapping
+ \snaptogrid[v!normal]\vbox\bgroup
+ \let\stopbaselinecorrection\egroup
+ \else
+ \normalstartbaselinecorrection
+ \fi}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spac-hor.lua b/Master/texmf-dist/tex/context/base/spac-hor.lua
new file mode 100644
index 00000000000..6cb6e3f497b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-hor.lua
@@ -0,0 +1,32 @@
+if not modules then modules = { } end modules ['spac-hor'] = {
+ version = 1.001,
+ comment = "companion to spac-hor.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local match = string.match
+local utfbyte = utf.byte
+local chardata = characters.data
+
+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
+}
+
+function commands.autonextspace(str) -- todo: use nexttoken
+ local ch = match(str,"the letter (.)") or match(str,"the character (.)")
+ ch = ch and chardata[utfbyte(ch)]
+ if ch and can_have_space[ch.category] then
+ -- texsprint(ctxcatcodes,"\\space") -- faster
+ context.space()
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/spac-hor.mkiv b/Master/texmf-dist/tex/context/base/spac-hor.mkiv
new file mode 100644
index 00000000000..9f902678a4c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-hor.mkiv
@@ -0,0 +1,946 @@
+%D \module
+%D [ file=spac-hor,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Horizontal,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Horizontal}
+
+\unprotect
+
+\registerctxluafile{spac-hor}{1.001}
+
+\let\currentindentation\empty % amount/keyword
+\let\currentindenting \empty % method
+
+\newdimen \ctxparindent
+\parindent\ctxparindent % for the show
+
+\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}}
+
+% 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}
+
+\definecomplexorsimple\setupindenting
+
+\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}% can this be done differently now?
+ \ifcsname\??in:\!!stringa\endcsname \else
+ \edef\currentindentation{#1}%
+ \let\normalindentation\currentindentation
+ \simplesetupindenting
+ \fi}
+
+\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
+
+\unexpanded\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[\csname#1\c!indentnext\endcsname]}
+
+\setvalue{\??in->\s!empty}{}
+\setvalue{\??in->\v!yes }{\doindentation}
+\setvalue{\??in->\v!no }{\noindentation}
+\setvalue{\??in->\v!auto }{\autoindentation}
+
+\unexpanded\def\checknextindentation[#1]%
+ {\csname\??in->\ifcsname\??in->#1\endcsname#1\else\s!empty\fi\endcsname}
+
+%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 % does not play well with noindentation
+ {\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 \startitemize \item itemize \stopitemize
+%D \input tufte \startitemize \item itemize \stopitemize
+%D \input tufte \startitemize \item itemize \stopitemize
+%D
+%D \page
+%D
+%D \input tufte
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D
+%D \input tufte
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D
+%D \input tufte
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D
+%D \page
+%D
+%D \input tufte \startformula a = b \stopformula
+%D \input tufte \startformula a = b \stopformula
+%D \input tufte \startformula a = b \stopformula
+%D \stoptyping
+
+\def\softbreak
+ {\relax\ifhmode\hskip\parfillskip\break\fi}
+
+%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}
+
+\unexpanded\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
+
+% \dorecurse{100}{\recurselevel\spacefactor 800 \space} \par
+% \dorecurse{100}{\recurselevel\spacefactor1200 \space} \par
+% \dorecurse{100}{\recurselevel\spacefactor 800 \normalspaceprimitive} \par
+% \dorecurse{100}{\recurselevel\spacefactor1200 \normalspaceprimitive} \par
+
+% When we don't add the % here, we effectively get \<endlinechar> and
+% since we have by default \def\^^M{\ } we get into a loop.
+
+\let\normalspaceprimitive=\ % space-comment is really needed
+
+% hm ...
+
+% \unexpanded\def\normalnotobeyedspace{\mathortext\normalspaceprimitive\space} % no \dontleavehmode\space (else no frenchspacing)
+% \let\ =\normalnotobeyedspace
+
+% Because I strip spaces at the end of lines (in the editor) we need a bit of
+% a trick to define slash+newline, so \space and \<newline> are the same
+
+% We need to be careful with \ and \space and the definition of ~ which uses \ as
+% we need to associate unicode spacing with it. There is some messy thing that that
+% I forgot to note down so I will revision the \ once I ran into it again.
+
+% \ruledhbox spread 10pt {\frenchspacing xx xx\ X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx\ X}
+% \ruledhbox spread 10pt {\frenchspacing xx xx X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx X}
+% \ruledhbox spread 10pt {\frenchspacing xx xx~X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx xx~X}
+
+% \ruledhbox spread 10pt {\frenchspacing xx dr.\ X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr.\ X}
+% \ruledhbox spread 10pt {\frenchspacing xx dr. X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr. X}
+% \ruledhbox spread 10pt {\frenchspacing xx dr.~X}
+% \ruledhbox spread 10pt {\nonfrenchspacing xx dr.~X}
+
+\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\normalspaceprimitive} % no space in math
+
+\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace % overloaded later
+
+\def\space { }
+\def\removelastspace{\ifhmode\unskip\fi}
+\def\nospace {\removelastspace\ignorespaces}
+
+\ifdefined\softhyphen \else \let\softhyphen\- \fi
+
+\ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\unexpanded\string\\def\string\\\string\n{\string\\space}")}
+% \ctxlua{tex.sprint(tex.ctxcatcodes,"\string\\let\string\\\string\n=\string\\space")}
+
+% 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}
+
+\appendtoks
+ \let~\space
+ \let\ \space
+\to\simplifiedcommands
+
+\unexpanded\def\removeunwantedspaces
+ {\ifhmode
+ \expandafter \doremoveunwantedspace
+ \fi}
+
+\def\doremoveunwantedspace
+ {\ifnum\lastnodetype=\@@gluenode
+ \unskip \expandafter\doremoveunwantedspace
+ \fi}
+
+% \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
+
+%D A couple of plain macros:
+
+\ifx\thinspace\undefined
+
+ \def\thinspace {\kern .16667\emwidth}
+ \def\negthinspace{\kern-.16667\emwidth}
+ \def\enspace {\kern .5\emwidth}
+
+\fi
+
+\ifx\quad\undefined
+
+ \def\enskip{\hskip.5\emwidth}
+ \def\quad {\hskip \emwidth}
+ \def\qquad {\hskip 2\emwidth}
+
+\fi
+
+\let\emspace\quad
+
+% 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!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
+ {\dorepeatwithcommand[#1]\donarrowermethod}
+
+\unexpanded\def\definenarrowermethod[#1]#2%
+ {\setvalue{\??sl:#1}{#2}}
+
+\def\donarrowermethod#1%
+ {\ifcsname\??sl:#1\endcsname\csname\??sl:#1\endcsname\else\global\advance\ctxmidskip#1\relax\fi}
+
+\definenarrowermethod[\v!left ]{\global\advance\ctxleftskip \@@slleft \relax}
+\definenarrowermethod[\v!middle ]{\global\advance\ctxmidskip \@@slmiddle\relax}
+\definenarrowermethod[\v!right ]{\global\advance\ctxrightskip \@@slright \relax}
+\definenarrowermethod[-\v!left ]{\global\advance\ctxleftskip -\@@slleft \relax}
+\definenarrowermethod[-\v!middle]{\global\advance\ctxmidskip -\@@slmiddle\relax}
+\definenarrowermethod[-\v!right ]{\global\advance\ctxrightskip-\@@slright \relax}
+\definenarrowermethod[\v!reset ]{\global\ctxleftskip \zeropoint
+ \global\ctxmidskip \zeropoint
+ \global\ctxrightskip\zeropoint\relax}
+\definenarrowermethod[\v!none ]{}
+
+% todo: definenarrower
+%
+% \definecomplexorsimple\startnarrower
+%
+% \def\simplestartnarrower
+% {\startnarrower[\v!middle]}
+%
+% \def\complexstartnarrower[#1]%
+% {\@@slbefore % was hard coded \par
+% \bgroup
+% \global\ctxleftskip \zeropoint
+% \global\ctxrightskip\zeropoint
+% \global\ctxmidskip \zeropoint
+% \processcommalistwithparameters[#1]\donarrower
+% \advance\leftskip \dimexpr\ctxleftskip +\ctxmidskip\relax
+% \advance\rightskip \dimexpr\ctxrightskip+\ctxmidskip\relax
+% \seteffectivehsize}
+%
+% \unexpanded\def\stopnarrower
+% {\@@slafter % was hard coded \par / needed, else skips forgotten
+% \egroup}
+%
+% \unexpanded\def\setupnarrower
+% {\dodoubleargument\getparameters[\??sl]}
+
+%D Contrary to \MKII\ we can now define classes of narrower (generalized
+%D by Wolfgang). This environment will be enhanced for bidi.
+
+\def\narrowerparameter #1{\csname\donarrowerparameter{\??sl\@@narrower}#1\endcsname}
+\def\donarrowerparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\donarrowerparentparameter\csname#1\s!parent\endcsname#2\fi}
+\def\donarrowerparentparameter#1#2{\ifx#1\relax\s!empty\else\donarrowerparameter#1#2\fi}
+
+\getparameters
+ [\??sl]
+ [\c!before=\endgraf,
+ \c!after=\endgraf,
+ \c!left=1.5em,
+ \c!right=1.5em,
+ \c!middle=1.5em]
+
+\unexpanded\def\definenarrower
+ {\dodoubleempty\dodefinenarrower}
+
+\def\dodefinenarrower[#1][#2]%
+ {\getparameters[\??sl#1][\s!parent=\??sl,#2]%
+ \setvalue{\e!start#1}{\dodoubleempty\dostartnarrower[#1]}%
+ \setvalue{\e!stop #1}{\dostopnarrower}}
+
+\unexpanded\def\setupnarrower
+ {\dodoubleempty\dosetupnarrower}
+
+\def\dosetupnarrower[#1][#2]%
+ {\doifelsenothing{#2}
+ {\getparameters[\??sl][#1]}
+ {\def\docommand##1{\getparameters[\??sl##1][#2]}%
+ \processcommacommand[#1]\docommand}}
+
+\definenarrowermethod[\v!left ]{\global\advance\ctxleftskip \narrowerparameter\c!left \relax}
+\definenarrowermethod[\v!middle ]{\global\advance\ctxmidskip \narrowerparameter\c!middle\relax}
+\definenarrowermethod[\v!right ]{\global\advance\ctxrightskip \narrowerparameter\c!right \relax}
+\definenarrowermethod[-\v!left ]{\global\advance\ctxleftskip -\narrowerparameter\c!left \relax}
+\definenarrowermethod[-\v!middle]{\global\advance\ctxmidskip -\narrowerparameter\c!middle\relax}
+\definenarrowermethod[-\v!right ]{\global\advance\ctxrightskip-\narrowerparameter\c!right \relax}
+\definenarrowermethod[\v!reset ]{\global\ctxleftskip \zeropoint
+ \global\ctxmidskip \zeropoint
+ \global\ctxrightskip\zeropoint\relax}
+\definenarrowermethod[\v!none ]{}
+
+\def\dostartnarrower[#1][#2]%
+ {\bgroup
+ \ifsecondargument % \doifsomethingelse{#2}?
+ \dodostartnarrower[#1][#2]%
+ \else
+ \dodostartnarrower[#1][\v!middle]%
+ \fi}
+
+\def\dodostartnarrower[#1][#2]%
+ {\edef\@@narrower{#1}%
+ \narrowerparameter\c!before
+ \global\ctxleftskip \zeropoint
+ \global\ctxrightskip\zeropoint
+ \global\ctxmidskip \zeropoint
+ \processcommalistwithparameters[#2]\donarrower
+ \advance\leftskip \dimexpr\ctxleftskip +\ctxmidskip\relax
+ \advance\rightskip\dimexpr\ctxrightskip+\ctxmidskip\relax
+ \seteffectivehsize}
+
+\def\dostopnarrower
+ {\narrowerparameter\c!after
+ \egroup}
+
+\def\v!narrower{narrower}
+
+\definenarrower[\v!narrower]
+
+\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}
+
+\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
+
+\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}
+
+%D Tolerance:
+
+\unexpanded\def\definetolerancemethod
+ {\dodoubleargument\dodefinetolerancemethod}
+
+\def\dodefinetolerancemethod[#1][#2]#3%
+ {\setvalue{\??to:#1:#2}{#3}}
+
+\definetolerancemethod [\v!vertical] [\v!verystrict ] {\let\bottomtolerance\empty}
+\definetolerancemethod [\v!vertical] [\v!strict ] {\def\bottomtolerance{.050}}
+\definetolerancemethod [\v!vertical] [\v!tolerant ] {\def\bottomtolerance{.075}}
+\definetolerancemethod [\v!vertical] [\v!verytolerant] {\def\bottomtolerance{.100}}
+
+\definetolerancemethod [\v!horizontal] [\v!stretch ] {\emergencystretch\bodyfontsize}
+\definetolerancemethod [\v!horizontal] [\v!space ] {\spaceskip.5em\!!plus.25em\!!minus.25em\relax}
+\definetolerancemethod [\v!horizontal] [\v!verystrict ] {\tolerance 200 }
+\definetolerancemethod [\v!horizontal] [\v!strict ] {\tolerance1500 }
+\definetolerancemethod [\v!horizontal] [\v!tolerant ] {\tolerance3000 }
+\definetolerancemethod [\v!horizontal] [\v!verytolerant] {\tolerance4500 }
+
+\def\dotolerancencemethodvertical #1{\csname\??to:\v!vertical :#1\endcsname}
+\def\dotolerancencemethodhorizontal#1{\csname\??to:\v!horizontal:#1\endcsname}
+
+\def\dosetuptolerance[#1]%
+ {\doifinsetelse\v!vertical{#1}%
+ {\processcommacommand[#1]\dotolerancencemethodvertical}
+ {\processcommacommand[#1]\dotolerancencemethodhorizontal}}
+
+\unexpanded\def\setuptolerance
+ {\dosingleargument\dosetuptolerance}
+
+%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
+
+\unexpanded\def\justonespace{\removeunwantedspaces\space}
+%unexpanded\def\justaperiod {\removeunwantedspaces.}
+%unexpanded\def\justacomma {\removeunwantedspaces,}
+
+\def\ignorecrlf
+ {\let\crlf\justonespace\let\\\crlf}
+
+\unexpanded\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]%
+ {\ifsecondargument
+ \dodohspace[#1][#2]%
+ \else\iffirstargument
+ \hspace[][#1]%
+ \else
+ \hspace[][\s!default]%
+ \fi\fi}
+
+\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}
+\unexpanded\def\breakabletextormathspace#1#2#3{\ifmmode\mskip#1#2\else\hskip#1\hspaceamount\empty{#3}\fi\relax}
+
+\newmuskip\hairmuskip \hairmuskip=.15mu
+
+\unexpanded\def\hairspace {\textormathspace+\hairmuskip{.5}}
+\unexpanded\def\thinspace {\textormathspace+\thinmuskip 1}
+\unexpanded\def\medspace {\textormathspace+\medmuskip 2}
+\unexpanded\def\thickspace {\textormathspace+\thickmuskip3}
+\unexpanded\def\neghairspace {\textormathspace-\thinmuskip{.5}}
+\unexpanded\def\negthinspace {\textormathspace-\thinmuskip 1}
+\unexpanded\def\negmedspace {\textormathspace-\medmuskip 2}
+\unexpanded\def\negthickspace{\textormathspace-\thickmuskip3}
+
+% needed for unicode:
+
+\unexpanded\def\breakablethinspace {\breakabletextormathspace+\thinmuskip 1}
+
+\unexpanded\def\twoperemspace {\hskip\dimexpr\emwidth/2\relax} % == \enspace
+\unexpanded\def\threeperemspace {\hskip\dimexpr\emwidth/3\relax}
+\unexpanded\def\fourperemspace {\hskip\dimexpr\emwidth/4\relax}
+\unexpanded\def\fiveperemspace {\hskip\dimexpr\emwidth/5\relax} % goodie
+\unexpanded\def\sixperemspace {\hskip\dimexpr\emwidth/6\relax}
+\unexpanded\def\figurespace {\begingroup\setbox\scratchbox\hbox{0}\hskip\wd\scratchbox\endgroup} % there is a command for this
+\unexpanded\def\punctuationspace {\begingroup\setbox\scratchbox\hbox{.}\hskip\wd\scratchbox\endgroup}
+\unexpanded\def\ideographicspace {\hskip\dimexpr\emwidth/1\relax}
+\unexpanded\def\ideographichalffillspace{\hskip\dimexpr\emwidth/2\relax}
+%unexpanded\def\nobreakspace {\penalty\plustenthousand\space}
+\unexpanded\def\nobreakspace {\penalty\plustenthousand\kern\interwordspace}
+\unexpanded\def\narrownobreakspace {\penalty\plustenthousand\thinspace}
+%unexpanded\def\zerowidthnobreakspace {\penalty\plustenthousand\hskip\zeropoint}
+\unexpanded\def\zerowidthnobreakspace {\penalty\plustenthousand\kern\zeropoint}
+\unexpanded\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
+
+\def\flexiblespaceamount#1#2#3%
+ {#1\interwordspace
+ \!!plus#2\interwordstretch
+ \!!minus#3\interwordshrink}
+
+\def\fixedspaceamount#1%
+ {#1\interwordspace}
+
+% moved from page-lin
+%
+% the following code is used in startlines\stoplines
+%
+% do we need \normalspaceprimitive here?
+
+\def\installspacehandler#1#2% needs to set \obeyedspace
+ {\setvalue{\??sr#1}{#2}}
+
+\installspacehandler \v!on
+ {\obeyspaces
+ \unexpanded\def\obeyedspace{\mathortext\normalspace{\dontleavehmode{\tt\controlspace}}}%
+ \let\ =\obeyedspace}
+
+\installspacehandler \v!yes
+ {\obeyspaces
+ \unexpanded\def\obeyedspace{\mathortext\normalspace{\dontleavehmode\normalspace}}%
+ \let\ =\obeyedspace}
+
+\installspacehandler \v!off % == default
+ {\normalspaces
+ \let\obeyedspace\normalspace
+ \let\ =\normalspaceprimitive} % was \normalspace
+
+\installspacehandler \v!fixed
+ {\obeyspaces
+ \unexpanded\def\obeyedspace{\mathortext\normalspace{\dontleavehmode\fixedspace}}%
+ \let\ =\obeyedspace}
+
+\def\activatespacehandler#1%
+ {\executeifdefined{\??sr#1}{\activatespacehandler\v!off}}
+
+\appendtoks
+ \normalspaces % to be sure
+\to \everybeforeoutput
+
+%D A more robust variant ofthe \MKII\ one:
+%D
+%D \startbuffer
+%D bla \TEX\autoinsertnextspace bla
+%D bla \TEX\autoinsertnextspace (bla)
+%D bla (\TEX\autoinsertnextspace) bla
+%D bla \TEX\autoinsertnextspace\ bla
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% unexpanded is important here as it prevents premature expansion in
+% e.g. \normalexpanded{\egroup\sortingparameter\c!next}
+
+\unexpanded\def\autoinsertnextspace
+ {\futurelet\nexttoken\doautoinsertnextspace}
+
+\def\doautoinsertnextspace
+ {\ctxlua{commands.autonextspace("\meaning\nexttoken")}} % todo, just consult nexttoken at the lua end
+
+%D Moved from bib module:
+
+\def\outdented#1%
+ {\hskip-\hangindent#1\relax}
+
+%D Beware: due to char-def this becomes an active character but that
+%D might change sometime when we will replace all these specials to
+%D node insertions. We might even expand it to utf then as it then
+%D can be used in string comparison (not that much needed anyway).
+
+\chardef\zwnj="200C
+\chardef\zwj ="200D
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spac-pag.mkiv b/Master/texmf-dist/tex/context/base/spac-pag.mkiv
new file mode 100644
index 00000000000..353afa5363f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-pag.mkiv
@@ -0,0 +1,199 @@
+%D \module
+%D [ file=spac-pag,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Pages,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Pages}
+
+\unprotect
+
+%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}
+
+\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
+
+\unexpanded\def\startsignalrightpage % one may do a \postsignalrightplace
+ {\advance\pagesignallevel\plusone
+ \presignalrightpage
+ \let\signalrightpage\relax
+ \let\presignalrightpage\relax
+ \let\startsignalrightpage\relax
+ \doifrightpageelse\donothing\donothing
+ \freezepagestate}
+
+\unexpanded\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}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spac-par.mkiv b/Master/texmf-dist/tex/context/base/spac-par.mkiv
new file mode 100644
index 00000000000..3477b1c1b14
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-par.mkiv
@@ -0,0 +1,192 @@
+%D \module
+%D [ file=spac-par,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Paragraphs,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Paragraphs}
+
+\unprotect
+
+%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%
+ {\normalexpanded % \scratchtoks{#1}%
+ {\noexpand#1% \the\scratchtoks
+ \hangindent\the\hangindent
+ \hangafter \the\hangafter
+ \parskip \the\parskip
+ \leftskip \the\leftskip
+ \rightskip \the\rightskip}}
+
+\newconditional \parbasedattributes
+
+\def\finishparbasedattributes
+ {\ifconditional\parbasedattributes
+ \setfalse\parbasedattributes
+ \par
+ \fi}
+
+\def\dostopparbasedattributes
+ {\settrue\parbasedattributes
+ \dostopattributes}
+
+% beware, changing this will break some code (like pos/backgrounds)
+
+\newtoks\everyfirstparagraphintro
+\newtoks\everynextparagraphintro
+\newtoks\@@everyparagraphtoks
+
+\chardef\everyparagraphintro\zerocount
+
+\unexpanded\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
+ \global\let\insertparagraphintro\doinsertparagraphintro}
+
+\def\doinsertparagraphintro % can be merged with the next
+ {\ifcase\everyparagraphintro\else\@EA\dodoinsertparagraphintro\fi}
+
+\def\dodoinsertparagraphintro
+ {\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
+ \global\let\insertparagraphintro\relax
+ \endgroup}
+
+\let\insertparagraphintro\relax
+
+%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
+\let\flushpostponednodedata\relax
+
+\def\flushatnextpar
+ {\bgroup
+ \global\let\flushpostponednodedata\doflushpostponednodedata
+ \dowithnextbox{\global\setbox\postponednodedata\hbox{\box\postponednodedata\box\nextbox}\egroup}\hbox}
+
+\def\doflushpostponednodedata
+ {\ifvoid\postponednodedata\else
+ \hbox{\smashedbox\postponednodedata}%
+ \fi
+ \global\let\flushpostponednodedata\relax}
+
+% Very nasty but needed for margin stuff inside colored
+% paragraphs.
+
+\let\normalvadjust\vadjust
+
+\def\graphicvadjust % nasty bidi handling
+ {\dowithnextboxcontent
+ {\forgetall}
+ {\vadjust{\vbox attr \graphicvadjustattribute \plusone
+ {\unvbox\nextbox
+ % corrects for one line paragraphs
+ \nointerlineskip
+ \kern-\struttotal
+ \nointerlineskip
+ \verticalstrut}}}%
+ \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\localvbox#1#% used?
+ {\vbox#1\bgroup
+ \forgetparskip
+ \setlocalhsize
+ \hsize\localhsize
+ \forgetparindent
+ \forgetbothskips
+ \forgeteverypar
+ \let\next=}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spac-ver.lua b/Master/texmf-dist/tex/context/base/spac-ver.lua
new file mode 100644
index 00000000000..c75eb1baa68
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-ver.lua
@@ -0,0 +1,1185 @@
+if not modules then modules = { } end modules ['spac-ver'] = {
+ version = 1.001,
+ comment = "companion to spac-ver.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- we also need to call the spacer for inserts!
+
+-- this code dates from the beginning and is kind of experimental; it
+-- will be optimized and improved soon
+--
+-- the collapser will be redone with user nodes; also, we might get make
+-- parskip into an attribute and appy it explicitly thereby getting rid
+-- of automated injections; eventually i want to get rid of the currently
+-- still needed tex -> lua -> tex > lua chain (needed because we can have
+-- expandable settings at the tex end
+
+-- todo: strip baselineskip around display math
+
+local next, type, tonumber = next, type, tonumber
+local format, gmatch, concat, match = string.format, string.gmatch, table.concat, string.match
+local ceil, floor, max, min, round = math.ceil, math.floor, math.max, math.min, math.round
+local texsprint, texlists, texdimen, texbox = tex.sprint, tex.lists, tex.dimen, tex.box
+local lpegmatch = lpeg.match
+local unpack = unpack or table.unpack
+
+local ctxcatcodes = tex.ctxcatcodes
+local variables = interfaces.variables
+
+local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
+
+-- vertical space handler
+
+local trace_vbox_vspacing = false trackers.register("nodes.vbox_vspacing", function(v) trace_vbox_vspacing = v end)
+local trace_page_vspacing = false trackers.register("nodes.page_vspacing", function(v) trace_page_vspacing = v end)
+local trace_collect_vspacing = false trackers.register("nodes.collect_vspacing", function(v) trace_collect_vspacing = v end)
+local trace_vspacing = false trackers.register("nodes.vspacing", function(v) trace_vspacing = v end)
+local trace_vsnapping = false trackers.register("nodes.vsnapping", function(v) trace_vsnapping = v end)
+
+local skip_category = attributes.private('skip-category')
+local skip_penalty = attributes.private('skip-penalty')
+local skip_order = attributes.private('skip-order')
+local snap_category = attributes.private('snap-category')
+local display_math = attributes.private('display-math')
+local snap_method = attributes.private('snap-method')
+local snap_done = attributes.private('snap-done')
+
+local has_attribute = node.has_attribute
+local unset_attribute = node.unset_attribute
+local set_attribute = node.set_attribute
+local find_node_tail = node.tail
+local free_node = node.free
+local copy_node = node.copy
+local traverse_nodes = node.traverse
+local traverse_nodes_id = node.traverse_id
+local insert_node_before = node.insert_before
+local insert_node_after = node.insert_after
+local remove_node = nodes.remove
+local make_penalty_node = nodes.penalty
+local make_kern_node = nodes.kern
+local make_rule_node = nodes.rule
+local count_nodes = nodes.count
+local node_ids_to_string = nodes.ids_to_string
+local hpack_node = node.hpack
+local vpack_node = node.vpack
+local writable_spec = nodes.writable_spec
+
+local glyph = node.id("glyph")
+local penalty = node.id("penalty")
+local kern = node.id("kern")
+local glue = node.id('glue')
+local hlist = node.id('hlist')
+local vlist = node.id('vlist')
+local adjust = node.id('adjust')
+
+vspacing = vspacing or { }
+vspacing.data = vspacing.data or { }
+
+vspacing.data.snapmethods = vspacing.data.snapmethods or { }
+
+storage.register("vspacing/data/snapmethods", vspacing.data.snapmethods, "vspacing.data.snapmethods")
+
+local snapmethods = vspacing.data.snapmethods --maybe some older code can go
+
+local default = {
+ maxheight = true,
+ maxdepth = true,
+ strut = true,
+ hfraction = 1,
+ dfraction = 1,
+}
+
+local fractions = {
+ minheight = "hfraction", maxheight = "hfraction",
+ mindepth = "dfraction", maxdepth = "dfraction",
+ top = "tlines", bottom = "blines",
+}
+
+local values = {
+ offset = "offset"
+}
+
+local colonsplitter = lpeg.splitat(":")
+
+local function listtohash(str)
+ local t = { }
+ for s in gmatch(str,"[^, ]+") do
+ local key, detail = lpegmatch(colonsplitter,s)
+ local v = variables[key]
+ if v then
+ t[v] = true
+ if detail then
+ local k = fractions[key]
+ if k then
+ detail = tonumber("0" .. detail)
+ if detail then
+ t[k] = detail
+ end
+ else
+ k = values[key]
+ if k then
+ detail = string.todimen(detail)
+ if detail then
+ t[k] = detail
+ end
+ end
+ end
+ end
+ else
+ detail = tonumber("0" .. key)
+ if detail then
+ t.hfraction, t.dfraction = detail, detail
+ end
+ end
+ end
+ if next(t) then
+ t.hfraction = t.hfraction or 1
+ t.dfraction = t.dfraction or 1
+ return t
+ else
+ return default
+ end
+end
+
+function vspacing.define_snap_method(name,method)
+ local n = #snapmethods + 1
+ local t = listtohash(method)
+ snapmethods[n] = t
+ t.name, t.specification = name, method
+ tex.write(n)
+end
+
+--~ local rule_id = node.id("rule")
+--~ local vlist_id = node.id("vlist")
+--~ function nodes.makevtop(n)
+--~ if n.id == vlist_id then
+--~ local list = n.list
+--~ local height = (list and list.id <= rule_id and list.height) or 0
+--~ n.depth = n.depth - height + n.height
+--~ n.height = height
+--~ end
+--~ end
+
+local function snap_hlist(current,method,height,depth) -- method.strut is default
+ local snapht, snapdp
+--~ print(table.serialize(method))
+ if method["local"] then
+ -- snapping is done immediately here
+ snapht, snapdp = texdimen.bodyfontstrutheight, texdimen.bodyfontstrutdepth
+ elseif method["global"] then
+ snapht, snapdp = texdimen.globalbodyfontstrutheight, texdimen.globalbodyfontstrutdepth
+ else
+ -- maybe autolocal
+ -- snapping might happen later in the otr
+ snapht, snapdp = texdimen.globalbodyfontstrutheight, texdimen.globalbodyfontstrutdepth
+ local lsnapht, lsnapdp = texdimen.bodyfontstrutheight, texdimen.bodyfontstrutdepth
+ if snapht ~= lsnapht and snapdp ~= lsnapdp then
+ snapht, snapdp = lsnapht, lsnapdp
+ end
+ end
+ local h, d = height or current.height, depth or current.depth
+ local hr, dr, ch, cd = method.hfraction or 1, method.dfraction or 1, h, d
+ local tlines, blines = method.tlines or 1, method.blines or 1
+ local done, plusht, plusdp = false, snapht, snapdp
+ local snaphtdp = snapht + snapdp
+ if method.none then
+ plusht, plusdp = 0, 0
+ end
+ if method.halfline then
+ plusht, plusdp = plusht + snaphtdp/2, plusdp + snaphtdp/2
+ end
+ if method.line then
+ plusht, plusdp = plusht + snaphtdp, plusdp + snaphtdp
+ end
+
+ if method.first then
+ if current.id == vlist then
+ local list, lh, ld = current.list
+ for n in traverse_nodes_id(hlist,list) do
+ lh, ld = n.height, n.depth
+ break
+ end
+ if lh then
+ local x = max(ceil((lh-hr*snapht)/snaphtdp),0)*snaphtdp + plusht
+ local n = make_kern_node(x-lh)
+ n.next, list.prev, current.list = list, n, n
+ ch = x + snaphtdp
+ cd = max(ceil((d+h-lh-dr*snapdp-hr*snapht)/snaphtdp),0)*snaphtdp + plusdp
+ done = true
+ end
+ end
+ elseif method.last then
+ if current.id == vlist then
+ local list, lh, ld = current.list
+ for n in traverse_nodes_id(hlist,list) do
+ lh, ld = n.height, n.depth
+ end
+ if lh then
+ local baseline_till_top = h + d - ld
+ local x = max(ceil((baseline_till_top-hr*snapht)/snaphtdp),0)*snaphtdp + plusht
+ local n = make_kern_node(x-baseline_till_top)
+ n.next, list.prev, current.list = list, n, n
+ ch = x
+ cd = max(ceil((ld-dr*snapdp)/snaphtdp),0)*snaphtdp + plusdp
+ done = true
+ end
+ end
+ end
+
+ if done then
+ -- first or last
+ elseif method.minheight then
+ ch = max(floor((h-hr*snapht)/snaphtdp),0)*snaphtdp + plusht
+ elseif method.maxheight then
+ ch = max(ceil((h-hr*snapht)/snaphtdp),0)*snaphtdp + plusht
+ else
+ ch = plusht
+ end
+ if done then
+ -- first or last
+ elseif method.mindepth then
+ cd = max(floor((d-dr*snapdp)/snaphtdp),0)*snaphtdp + plusdp
+ elseif method.maxdepth then
+ cd = max(ceil((d-dr*snapdp)/snaphtdp),0)*snaphtdp + plusdp
+ else
+ cd = plusdp
+ end
+ if method.top then
+ ch = ch + tlines * snaphtdp
+ end
+ if method.bottom then
+ cd = cd + blines * snaphtdp
+ end
+
+ local offset = method.offset
+ if offset then
+ -- we need to set the attr
+ local shifted = vpack_node(current.list)
+ shifted.shift = offset
+ current.list = shifted
+ end
+ if not height then
+ current.height = ch
+ end
+ if not depth then
+ current.depth = cd
+ end
+ -- set_attribute(current,snap_method,0)
+ return h, d, ch, cd, (ch+cd)/snaphtdp
+end
+
+--~ local function snap_topskip(current,method)
+--~ local spec = current.spec
+--~ local w = spec.width
+--~ local wd = w
+--~ if spec then
+--~ wd = 0
+--~ spec = writable_spec(current)
+--~ spec.width = wd
+--~ end
+--~ return w, wd
+--~ end
+
+local function snap_topskip(current,method)
+ local spec = current.spec
+ local w = spec.width
+ local wd = w
+ if spec.writable then
+ spec.width, wd = 0, 0
+ end
+ return w, wd
+end
+
+vspacing.categories = {
+ [0] = 'discard',
+ [1] = 'largest',
+ [2] = 'force' ,
+ [3] = 'penalty',
+ [4] = 'add' ,
+ [5] = 'disable',
+ [6] = 'nowhite',
+ [7] = 'goback',
+ [8] = 'together'
+}
+
+local categories = vspacing.categories
+
+function vspacing.tocategories(str)
+ local t = { }
+ for s in gmatch(str,"[^, ]") do
+ local n = tonumber(s)
+ if n then
+ t[categories[n]] = true
+ else
+ t[b] = true
+ end
+ end
+ return t
+end
+
+function vspacing.tocategory(str)
+ if type(str) == "string" then
+ return set.tonumber(vspacing.tocategories(str))
+ else
+ return set.tonumber({ [categories[str]] = true })
+ end
+end
+
+vspacing.data.map = vspacing.data.map or { }
+vspacing.data.skip = vspacing.data.skip or { }
+
+storage.register("vspacing/data/map", vspacing.data.map, "vspacing.data.map")
+storage.register("vspacing/data/skip", vspacing.data.skip, "vspacing.data.skip")
+
+do -- todo: interface.variables
+
+ local function logger(c,...)
+ logs.report("vspacing",concat {...})
+ texsprint(c,...)
+ end
+
+ vspacing.fixed = false
+
+ local map = vspacing.data.map
+ local skip = vspacing.data.skip
+
+ local multiplier = lpeg.C(lpeg.S("+-")^0 * lpeg.R("09")^1) * lpeg.P("*")
+ local category = lpeg.P(":") * lpeg.C(lpeg.P(1)^1)
+ local keyword = lpeg.C((1-category)^1)
+ local splitter = (multiplier + lpeg.Cc(1)) * keyword * (category + lpeg.Cc(false))
+
+ local k_fixed, k_flexible, k_category, k_penalty, k_order = variables.fixed, variables.flexible, "category", "penalty", "order"
+
+ -- This will change: just node.write and we can store the values in skips which
+ -- then obeys grouping
+
+ local function analyse(str,oldcategory,texsprint) -- we could use shorter names
+ for s in gmatch(str,"([^ ,]+)") do
+ local amount, keyword, detail = lpegmatch(splitter,s)
+ if not keyword then
+ logs.report("vspacing","unknown directive: %s",s)
+ else
+ local mk = map[keyword]
+ if mk then
+ category = analyse(mk,category,texsprint)
+ elseif keyword == k_fixed then
+ texsprint(ctxcatcodes,"\\fixedblankskip")
+ elseif keyword == k_flexible then
+ texsprint(ctxcatcodes,"\\flexibleblankskip")
+ elseif keyword == k_category then
+ local category = tonumber(detail)
+ if category then
+ texsprint(ctxcatcodes,"\\setblankcategory{",category,"}")
+ if category ~= oldcategory then
+ texsprint(ctxcatcodes,"\\flushblankhandling")
+ oldcategory = category
+ end
+ end
+ elseif keyword == k_order and detail then
+ local order = tonumber(detail)
+ if order then
+ texsprint(ctxcatcodes,"\\setblankorder{",order,"}")
+ end
+ elseif keyword == k_penalty and detail then
+ local penalty = tonumber(detail)
+ if penalty then
+ texsprint(ctxcatcodes,"\\setblankpenalty{",penalty,"}")
+ end
+ else
+ amount = tonumber(amount) or 1
+ local sk = skip[keyword]
+ if sk then
+ texsprint(ctxcatcodes,"\\addpredefinedblankskip{",amount,"}{",keyword,"}")
+ else -- no check
+ texsprint(ctxcatcodes,"\\addaskedblankskip{",amount,"}{",keyword,"}")
+ end
+ end
+ end
+ end
+ return category
+ end
+
+ function vspacing.analyse(str)
+ local texsprint = (trace_vspacing and logger) or texsprint
+ texsprint(ctxcatcodes,"\\startblankhandling")
+ analyse(str,1,texsprint)
+ texsprint(ctxcatcodes,"\\stopblankhandling")
+ end
+
+ --
+
+ function vspacing.setmap(from,to)
+ map[from] = to
+ end
+
+ function vspacing.setskip(key,value,grid)
+ if value ~= "" then
+ if grid == "" then grid = value end
+ skip[key] = { value, grid }
+ end
+ end
+
+end
+
+-- implementation
+
+--~ nodes.snapvalues = { }
+
+--~ function nodes.setsnapvalue(n,ht,dp)
+--~ nodes.snapvalues[n] = { ht, dp, ht+dp }
+--~ end
+
+local trace_list, tracing_info, before, after = { }, false, "", ""
+
+local function glue_to_string(glue)
+ local spec = glue.spec
+ local t = { }
+ t[#t+1] = aux.strip_zeros(number.topoints(spec.width))
+ if spec.stretch_order and spec.stretch_order ~= 0 then
+ t[#t+1] = format("plus -%sfi%s",spec.stretch/65536,string.rep("l",math.abs(spec.stretch_order)-1))
+ elseif spec.stretch and spec.stretch ~= 0 then
+ t[#t+1] = format("plus %s",aux.strip_zeros(number.topoints(spec.stretch)))
+ end
+ if spec.shrink_order and spec.shrink_order ~= 0 then
+ t[#t+1] = format("minus -%sfi%s",spec.shrink/65536,string.rep("l",math.abs(spec.shrink_order)-1))
+ elseif spec.shrink and spec.shrink ~= 0 then
+ t[#t+1] = format("minus %s",aux.strip_zeros(number.topoints(spec.shrink)))
+ end
+ return concat(t," ")
+end
+
+local function nodes_to_string(head)
+ local current, t = head, { }
+ while current do
+ local id = current.id
+ local ty = node.type(id)
+ if id == penalty then
+ t[#t+1] = format("%s:%s",ty,current.penalty)
+ elseif id == glue then
+ t[#t+1] = format("%s:%s",ty,aux.strip_zeros(number.topoints(current.spec.width)))
+ elseif id == kern then
+ t[#t+1] = format("%s:%s",ty,aux.strip_zeros(number.topoints(current.kern)))
+ else
+ t[#t+1] = ty
+ end
+ current = current.next
+ end
+ return concat(t," + ")
+end
+
+local function reset_tracing(head)
+ trace_list, tracing_info, before, after = { }, false, nodes_to_string(head), ""
+end
+
+local function trace_skip(str,sc,so,sp,data)
+ trace_list[#trace_list+1] = { "skip", format("%s | %s | category %s | order %s | penalty %s", str, glue_to_string(data), sc or "-", so or "-", sp or "-") }
+ tracing_info = true
+end
+
+local function trace_natural(str,data)
+ trace_list[#trace_list+1] = { "skip", format("%s | %s", str, glue_to_string(data)) }
+ tracing_info = true
+end
+
+local function trace_info(message, where, what)
+ trace_list[#trace_list+1] = { "info", format("%s: %s/%s",message,where,what) }
+end
+
+local function trace_node(what)
+ local nt = node.type(what.id)
+ local tl = trace_list[#trace_list]
+ if tl and tl[1] == "node" then
+ trace_list[#trace_list] = { "node", tl[2] .. " + " .. nt }
+ else
+ trace_list[#trace_list+1] = { "node", nt }
+ end
+end
+
+local function trace_done(str,data)
+ if data.id == penalty then
+ trace_list[#trace_list+1] = { "penalty", format("%s | %s", str, data.penalty) }
+ else
+ trace_list[#trace_list+1] = { "glue", format("%s | %s", str, glue_to_string(data)) }
+ end
+ tracing_info = true
+end
+
+local function show_tracing(head)
+ if tracing_info then
+ after = nodes_to_string(head)
+ for i=1,#trace_list do
+ local tag, text = unpack(trace_list[i])
+ if tag == "info" then
+ logs.report("collapse",text)
+ else
+ logs.report("collapse"," %s: %s",tag,text)
+ end
+ end
+ logs.report("collapse","before: %s",before)
+ logs.report("collapse","after : %s",after)
+ end
+end
+
+-- alignment box begin_of_par vmode_par hmode_par insert penalty before_display after_display
+
+local user_skip = 0
+local line_skip = 1
+local baseline_skip = 2
+local par_skip = 3
+local above_display_skip = 4
+local below_display_skip = 5
+local above_display_short_skip = 6
+local below_display_short_skip = 7
+local left_skip_code = 8
+local right_skip_code = 9
+local top_skip_code = 10
+local split_top_skip_code = 11
+local tab_skip_code = 12
+local space_skip_code = 13
+local xspace_skip_code = 14
+local par_fill_skip_code = 15
+local thin_mu_skip_code = 16
+local med_mu_skip_code = 17
+local thick_mu_skip_code = 18
+
+local skips = {
+ [ 0] = "user_skip",
+ [ 1] = "line_skip",
+ [ 2] = "baseline_skip",
+ [ 3] = "par_skip",
+ [ 4] = "above_display_skip",
+ [ 5] = "below_display_skip",
+ [ 6] = "above_display_short_skip",
+ [ 7] = "below_display_short_skip",
+ [ 8] = "left_skip_code",
+ [ 9] = "right_skip_code",
+ [10] = "top_skip_code",
+ [11] = "split_top_skip_code",
+ [12] = "tab_skip_code",
+ [13] = "space_skip_code",
+ [14] = "xspace_skip_code",
+ [15] = "par_fill_skip_code",
+ [16] = "thin_mu_skip_code",
+ [17] = "med_mu_skip_code",
+ [18] = "thick_mu_skip_code",
+}
+
+local free_glue_node = free_node
+local discard, largest, force, penalty, add, disable, nowhite, goback, together = 0, 1, 2, 3, 4, 5, 6, 7, 8
+
+--~ local function free_glue_node(n) free_node(n.spec) free_node(n) end
+
+function vspacing.snap_box(n,how)
+ local sv = snapmethods[how]
+ if sv then
+ local box = texbox[n]
+ local list = box.list
+--~ if list and (list.id == hlist or list.id == vlist) then
+ if list then
+ local s = has_attribute(list,snap_method)
+ if s == 0 then
+ if trace_vsnapping then
+ -- logs.report("snapper", "hlist not snapped, already done")
+ end
+ else
+ local h, d, ch, cd, lines = snap_hlist(box,sv,box.height,box.depth)
+ box.height, box.depth = ch, cd
+ if trace_vsnapping then
+ logs.report("snapper", "hlist snapped from (%s,%s) to (%s,%s) using method '%s' (%s) for '%s' (%s lines)",h,d,ch,cd,sv.name,sv.specification,"direct",lines)
+ end
+ set_attribute(list,snap_method,0)
+ end
+ end
+ end
+end
+
+local function forced_skip(head,current,width,where,trace)
+ if where == "after" then
+ head, current = insert_node_after(head,current,make_rule_node(0,0,0))
+ head, current = insert_node_after(head,current,make_kern_node(width))
+ head, current = insert_node_after(head,current,make_rule_node(0,0,0))
+ else
+ local c = current
+ head, current = insert_node_before(head,current,make_rule_node(0,0,0))
+ head, current = insert_node_before(head,current,make_kern_node(width))
+ head, current = insert_node_before(head,current,make_rule_node(0,0,0))
+ current = c
+ end
+ if trace then
+ logs.report("vspacing", "inserting forced skip of %s",width)
+ end
+ return head, current
+end
+
+local function collapser(head,where,what,trace,snap) -- maybe also pass tail
+ if trace then
+ reset_tracing(head)
+ end
+ local current, oldhead = head, head
+ local glue_order, glue_data, force_glue = 0, nil, false
+ local penalty_order, penalty_data, natural_penalty = 0, nil, nil
+ local parskip, ignore_parskip, ignore_following, ignore_whitespace, keep_together = nil, false, false, false, false
+ --
+ -- todo: keep_together: between headers
+ --
+ local function flush(why)
+ if penalty_data then
+ local p = make_penalty_node(penalty_data)
+ if trace then trace_done("flushed due to " .. why,p) end
+ head, _ = insert_node_before(head,current,p)
+ end
+ if glue_data then
+ if force_glue then
+ if trace then trace_done("flushed due to " .. why,glue_data) end
+ head, _ = forced_skip(head,current,glue_data.spec.width,"before",trace)
+ free_glue_node(glue_data)
+ elseif glue_data.spec.writable then
+ if trace then trace_done("flushed due to " .. why,glue_data) end
+ head, _ = insert_node_before(head,current,glue_data)
+ else
+ free_glue_node(glue_data)
+ end
+ end
+ if trace then trace_node(current) end
+ glue_order, glue_data, force_glue = 0, nil, false
+ penalty_order, penalty_data, natural_penalty = 0, nil, nil
+ parskip, ignore_parskip, ignore_following, ignore_whitespace = nil, false, false, false
+ end
+ if trace_vsnapping then
+ logs.report("snapper", "global ht/dp = %s/%s, local ht/dp = %s/%s",
+ texdimen.globalbodyfontstrutheight, texdimen.globalbodyfontstrutdepth,
+ texdimen.bodyfontstrutheight, texdimen.bodyfontstrutdepth)
+ end
+ if trace then trace_info("start analyzing",where,what) end
+ while current do
+ local id, subtype = current.id, current.subtype
+ if id == hlist or id == vlist then
+-- needs checking, why so many calls
+ if snap then
+ local s = has_attribute(current,snap_method)
+ if not s then
+ -- if trace_vsnapping then
+ -- logs.report("snapper", "hlist not snapped")
+ -- end
+ elseif s == 0 then
+ if trace_vsnapping then
+ -- logs.report("snapper", "hlist not snapped, already done")
+ end
+ else
+ local sv = snapmethods[s]
+ if sv then
+ local h, d, ch, cd, lines = snap_hlist(current,sv)
+ if trace_vsnapping then
+ logs.report("snapper", "hlist snapped from (%s,%s) to (%s,%s) using method '%s' (%s) for '%s' (%s lines)",h,d,ch,cd,sv.name,sv.specification,where,lines)
+ end
+ elseif trace_vsnapping then
+ logs.report("snapper", "hlist not snapped due to unknown snap specification")
+ end
+ set_attribute(current,snap_method,0)
+ end
+ else
+ --
+ end
+ -- tex.prevdepth = 0
+ flush("list")
+ current = current.next
+ elseif id == penalty then
+ --~ natural_penalty = current.penalty
+ --~ if trace then trace_done("removed penalty",current) end
+ --~ head, current = remove_node(head, current, true)
+ current = current.next
+ elseif id == kern then
+ if snap and trace_vsnapping and current.kern ~= 0 then
+ --~ current.kern = 0
+ logs.report("snapper", "kern of %s (kept)",current.kern)
+ end
+ flush("kern")
+ current = current.next
+ elseif id ~= glue then
+ flush("something else")
+ current = current.next
+ elseif subtype == user_skip then -- todo, other subtypes, like math
+ local sc = has_attribute(current,skip_category) -- has no default, no unset (yet)
+ local so = has_attribute(current,skip_order ) or 1 -- has 1 default, no unset (yet)
+ local sp = has_attribute(current,skip_penalty ) -- has no default, no unset (yet)
+ if sp and sc == penalty then
+ if not penalty_data then
+ penalty_data = sp
+ elseif penalty_order < so then
+ penalty_order, penalty_data = so, sp
+ elseif penalty_order == so and sp > penalty_data then
+ penalty_data = sp
+ end
+ if trace then trace_skip('penalty in skip',sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ elseif not sc then -- if not sc then
+ if glue_data then
+ if trace then trace_done("flush",glue_data) end
+ head, current = nodes.before(head,current,glue_data)
+ if trace then trace_natural("natural",current) end
+ current = current.next
+ else
+ -- not look back across head
+ local previous = current.prev
+ if previous and previous.id == glue and previous.subtype == 0 then
+ local ps = previous.spec
+ if ps.writable then
+ local cs = current.spec
+ if cs.writable and ps.stretch_order == 0 and ps.shrink_order == 0 and cs.stretch_order == 0 and cs.shrink_order == 0 then
+ local pw, pp, pm = ps.width, ps.stretch, ps.shrink
+ local cw, cp, cm = cs.width, cs.stretch, cs.shrink
+ ps = writable_spec(previous) -- no writable needed here
+ ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm
+ if trace then trace_natural("removed",current) end
+ head, current = remove_node(head, current, true)
+ -- current = previous
+ if trace then trace_natural("collapsed",previous) end
+ -- current = current.next
+ else
+ if trace then trace_natural("filler",current) end
+ current = current.next
+ end
+ else
+ if trace then trace_natural("natural (no prev spec)",current) end
+ current = current.next
+ end
+ else
+ if trace then trace_natural("natural (no prev)",current) end
+ current = current.next
+ end
+ end
+ glue_order, glue_data = 0, nil
+ elseif sc == disable then
+ ignore_following = true
+ if trace then trace_skip("disable",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ elseif sc == together then
+ keep_together = true
+ if trace then trace_skip("together",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ elseif sc == nowhite then
+ ignore_whitespace = true
+ head, current = remove_node(head, current, true)
+ elseif sc == discard then
+ if trace then trace_skip("discard",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ elseif ignore_following then
+ if trace then trace_skip("disabled",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ elseif not glue_data then
+ if trace then trace_skip("assign",sc,so,sp,current) end
+ glue_order = so
+ head, current, glue_data = remove_node(head, current)
+ elseif glue_order < so then
+ if trace then trace_skip("force",sc,so,sp,current) end
+ glue_order = so
+ free_glue_node(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
+ if sc == largest then
+ local cs, gs = current.spec, glue_data.spec
+ local cw, gw = cs.width, gs.width
+ if cw > gw then
+ if trace then trace_skip('largest',sc,so,sp,current) end
+ free_glue_node(glue_data) -- also free spec
+ head, current, glue_data = remove_node(head, current)
+ else
+ if trace then trace_skip('remove smallest',sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ end
+ elseif sc == goback then
+ if trace then trace_skip('goback',sc,so,sp,current) end
+ free_glue_node(glue_data) -- also free spec
+ 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
+ -- but not now
+ if trace then trace_skip('force',sc,so,sp,current) end
+ free_glue_node(glue_data) -- also free spec
+ head, current, glue_data = remove_node(head, current)
+ elseif sc == penalty then
+ -- ? ? ? ?
+ if trace then trace_skip('penalty',sc,so,sp,current) end
+ free_glue_node(glue_data) -- also free spec
+ glue_data = nil
+ head, current = remove_node(head, current, true)
+ elseif sc == add then
+ if trace then trace_skip('add',sc,so,sp,current) end
+--~ local old, new = glue_data.spec, current.spec
+ local old, new = writable_spec(glue_data), current.spec
+ old.width = old.width + new.width
+ old.stretch = old.stretch + new.stretch
+ old.shrink = old.shrink + new.shrink
+ -- toto: order
+ head, current = remove_node(head, current, true)
+ else
+ if trace then trace_skip("unknown",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ end
+ else
+ if trace then trace_skip("unknown",sc,so,sp,current) end
+ head, current = remove_node(head, current, true)
+ end
+ if sc == force then
+ force_glue = true
+ end
+ elseif subtype == line_skip then
+ if snap then
+ local s = has_attribute(current,snap_method)
+ if s and s ~= 0 then
+ set_attribute(current,snap_method,0)
+ if current.spec.writable then
+ local spec = writable_spec(current)
+ spec.width = 0
+ if trace_vsnapping then
+ logs.report("snapper", "lineskip set to zero")
+ end
+ end
+ else
+ if trace then trace_skip("lineskip",sc,so,sp,current) end
+ flush("lineskip")
+ end
+ else
+ if trace then trace_skip("lineskip",sc,so,sp,current) end
+ flush("lineskip")
+ end
+ current = current.next
+ elseif subtype == baseline_skip then
+ if snap then
+ local s = has_attribute(current,snap_method)
+ if s and s ~= 0 then
+ set_attribute(current,snap_method,0)
+ if current.spec.writable then
+ local spec = writable_spec(current)
+ spec.width = 0
+ if trace_vsnapping then
+ logs.report("snapper", "baselineskip set to zero")
+ end
+ end
+ else
+ if trace then trace_skip("baselineskip",sc,so,sp,current) end
+ flush("baselineskip")
+ end
+ else
+ if trace then trace_skip("baselineskip",sc,so,sp,current) end
+ flush("baselineskip")
+ end
+ current = current.next
+ elseif subtype == par_skip then
+ -- parskip always comes later
+ if ignore_whitespace then
+ if trace then trace_natural("ignored parskip",current) end
+ head, current = remove_node(head, current, true)
+ elseif glue_data then
+ local ps, gs = current.spec, glue_data.spec
+ if ps.writable and gs.writable and ps.width > gs.width then
+ glue_data.spec = copy_node(ps)
+ if trace then trace_natural("taking parskip",current) end
+ else
+ if trace then trace_natural("removed parskip",current) end
+ end
+ head, current = remove_node(head, current, true)
+ else
+ if trace then trace_natural("honored parskip",current) end
+ head, current, glue_data = remove_node(head, current)
+ end
+ elseif subtype == top_skip_code or subtype == split_top_skip_code then
+ if snap then
+ local s = has_attribute(current,snap_method)
+ if s and s ~= 0 then
+ set_attribute(current,snap_method,0)
+ local sv = snapmethods[s]
+ local w, cw = snap_topskip(current,sv)
+ if trace_vsnapping then
+ logs.report("snapper", "topskip snapped from %s to %s for '%s'",w,cw,where)
+ end
+ else
+ if trace then trace_skip("topskip",sc,so,sp,current) end
+ flush("topskip")
+ end
+ else
+ if trace then trace_skip("topskip",sc,so,sp,current) end
+ flush("topskip")
+ end
+ current = current.next
+ elseif subtype == above_display_skip then
+ --
+ if trace then trace_skip("above display skip (normal)",sc,so,sp,current) end
+ flush("above display skip (normal)")
+ current = current.next
+ --
+ elseif subtype == below_display_skip then
+ --
+ if trace then trace_skip("below display skip (normal)",sc,so,sp,current) end
+ flush("below display skip (normal)")
+ current = current.next
+ --
+ elseif subtype == above_display_short_skip then
+ --
+ if trace then trace_skip("above display skip (short)",sc,so,sp,current) end
+ flush("above display skip (short)")
+ current = current.next
+ --
+ elseif subtype == below_display_short_skip then
+ --
+ if trace then trace_skip("below display skip (short)",sc,so,sp,current) end
+ flush("below display skip (short)")
+ current = current.next
+ --
+ else -- other glue
+ if snap and trace_vsnapping and current.spec.writable and current.spec.width ~= 0 then
+ logs.report("snapper", "%s of %s (kept)",skips[subtype],current.spec.width)
+ --~ current.spec.width = 0
+ end
+ if trace then trace_skip(format("some glue (%s)",subtype),sc,so,sp,current) end
+ flush("some glue")
+ current = current.next
+ end
+ end
+ if trace then trace_info("stop analyzing",where,what) end
+ --~ if natural_penalty and (not penalty_data or natural_penalty > penalty_data) then
+ --~ penalty_data = natural_penalty
+ --~ end
+ if trace and (glue_data or penalty_data) then
+ trace_info("start flushing",where,what)
+ end
+ local tail
+ if penalty_data then
+ tail = find_node_tail(head)
+ local p = make_penalty_node(penalty_data)
+ if trace then trace_done("result",p) end
+ head, tail = insert_node_after(head,tail,p)
+ end
+ if glue_data then
+ if not tail then tail = find_node_tail(head) end
+ if trace then trace_done("result",glue_data) end
+ if force_glue then
+ head, tail = forced_skip(head,tail,glue_data.spec.width,"after",trace)
+ free_glue_node(glue_data)
+ else
+ head, tail = insert_node_after(head,tail,glue_data)
+ end
+ end
+ if trace then
+ if glue_data or penalty_data then
+ trace_info("stop flushing",where,what)
+ end
+ show_tracing(head)
+ if oldhead ~= head then
+ trace_info("head has been changed from '%s' to '%s'",node.type(oldhead.id),node.type(head.id))
+ end
+ end
+ return head, true
+end
+
+-- alignment after_output end box new_graf vmode_par hmode_par insert penalty before_display after_display
+-- \par -> vmode_par
+--
+-- status.best_page_break
+-- tex.lists.best_page_break
+-- tex.lists.best_size (natural size to best_page_break)
+-- tex.lists.least_page_cost (badness of best_page_break)
+-- tex.lists.page_head
+-- tex.lists.contrib_head
+
+local stackhead, stacktail, stackhack = nil, nil, false
+
+local function report(message,lst)
+ logs.report("vspacing",message,count_nodes(lst,true),node_ids_to_string(lst))
+end
+
+function nodes.handle_page_spacing(newhead,where)
+--~ local newhead = texlists.contrib_head
+ if newhead then
+--~ starttiming(vspacing)
+ local newtail = find_node_tail(newhead)
+ local flush = false
+ stackhack = true -- todo: only when grid snapping once enabled
+ for n in traverse_nodes(newhead) do -- we could just look for glue nodes
+ local id = n.id
+ if id == glue then
+ if n.subtype == 0 then
+ if has_attribute(n,skip_category) then
+ stackhack = true
+ else
+ flush = true
+ end
+ else
+ -- tricky
+ end
+ else
+ flush = true
+ end
+ end
+ if flush then
+ if stackhead then
+ if trace_collect_vspacing then report("appending %s nodes to stack (final): %s",newhead) end
+ stacktail.next = newhead
+ newhead.prev = stacktail
+ newhead = stackhead
+ stackhead, stacktail = nil, nil
+ end
+ if stackhack then
+ stackhack = false
+ if trace_collect_vspacing then report("processing %s nodes: %s",newhead) end
+--~ texlists.contrib_head = collapser(newhead,"page",where,trace_page_vspacing,true)
+newhead = collapser(newhead,"page",where,trace_page_vspacing,true)
+ else
+ if trace_collect_vspacing then report("flushing %s nodes: %s",newhead) end
+--~ texlists.contrib_head = newhead
+ end
+ else
+ if stackhead then
+ if trace_collect_vspacing then report("appending %s nodes to stack (intermediate): %s",newhead) end
+ stacktail.next = newhead
+ newhead.prev = stacktail
+ else
+ if trace_collect_vspacing then report("storing %s nodes in stack (initial): %s",newhead) end
+ stackhead = newhead
+ end
+ stacktail = newtail
+--~ texlists.contrib_head = nil
+newhead = nil
+ end
+--~ stoptiming(vspacing)
+ end
+return newhead
+end
+
+local ignore = table.tohash {
+ "split_keep",
+ "split_off",
+ -- "vbox",
+}
+
+function nodes.handle_vbox_spacing(head,where)
+ if head and not ignore[where] and head.next then
+ -- starttiming(vspacing)
+ head = collapser(head,"vbox",where,trace_vbox_vspacing,false)
+ -- stoptiming(vspacing)
+ end
+ return head
+end
+
+function nodes.collapse_vbox(n) -- for boxes
+ local list = texbox[n].list
+ if list then
+ -- starttiming(vspacing)
+ texbox[n].list = vpack_node(collapser(list,"snapper","vbox",trace_vbox_vspacing,true))
+ -- stoptiming(vspacing)
+ end
+end
+
+-- we will split this module hence the locals
+
+local attribute = attributes.private('graphicvadjust')
+
+local hlist = node.id('hlist')
+local vlist = node.id('vlist')
+
+local remove_node = nodes.remove
+local hpack_node = node.hpack
+local vpack_node = node.vpack
+local has_attribute = node.has_attribute
+
+function nodes.repackage_graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only
+ if groupcode == "" then -- mvl only
+ local h, p, done = head, nil, false
+ while h do
+ local id = h.id
+ if id == hlist or id == vlist then
+ local a = has_attribute(h,attribute)
+ if a then
+ if p then
+ local n
+ head, h, n = remove_node(head,h)
+ local pl = p.list
+ if n.width ~= 0 then
+ n = hpack_node(n,0,'exactly') -- todo: dir
+ end
+ if pl then
+ pl.prev = n
+ n.next = pl
+ end
+ p.list = n
+ done = true
+ else
+ -- can't happen
+ end
+ else
+ p = h
+ h = h.next
+ end
+ else
+ h = h.next
+ end
+ end
+ return head, done
+ else
+ return head, false
+ end
+end
+
+--~ function nodes.repackage_graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only
+--~ if groupcode == "" then -- mvl only
+--~ return head, false
+--~ else
+--~ return head, false
+--~ end
+--~ end
+
+--~ tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust")
+
+nodes.builders = nodes.builder or { }
+
+local builders = nodes.builders
+
+local actions = tasks.actions("vboxbuilders",5)
+
+function nodes.builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction)
+ local done = false
+ if head then
+ starttiming(builders)
+ if trace_callbacks then
+ local before = nodes.count(head)
+ head, done = actions(head,groupcode,size,packtype,maxdepth,direction)
+ local after = nodes.count(head)
+ if done then
+ tracer("vpack","changed",head,groupcode,before,after,true)
+ else
+ tracer("vpack","unchanged",head,groupcode,before,after,true)
+ end
+ stoptiming(builders)
+ else
+ head, done = actions(head,groupcode)
+ stoptiming(builders)
+ end
+ end
+ return head, done
+end
+
+-- This one is special in the sense that it has no head
+-- and we operate on the mlv. Also, we need to do the
+-- vspacing last as it removes items from the mvl.
+
+local actions = tasks.actions("mvlbuilders",1)
+
+function nodes.builders.buildpage_filter(groupcode)
+ starttiming(builders)
+ local head = texlists.contrib_head
+ local head, done = actions(head,groupcode)
+ texlists.contrib_head = head
+ stoptiming(builders)
+ return (done and head) or true
+end
+
+callbacks.register('vpack_filter', nodes.builders.vpack_filter, "vertical spacing etc")
+callbacks.register('buildpage_filter', nodes.builders.buildpage_filter, "vertical spacing etc (mvl)")
+
+statistics.register("v-node processing time", function()
+ return statistics.elapsedseconds(builders)
+end)
diff --git a/Master/texmf-dist/tex/context/base/spac-ver.mkiv b/Master/texmf-dist/tex/context/base/spac-ver.mkiv
new file mode 100644
index 00000000000..75af82df79a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spac-ver.mkiv
@@ -0,0 +1,2078 @@
+%D \module
+%D [ file=spac-ver,
+%D version=2009.10.16, % 1997.03.31, was core-spa.tex
+%D title=\CONTEXT\ Spacing Macros,
+%D subtitle=Vertical,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Spacing Macros / Vertical}
+
+\unprotect
+
+\registerctxluafile{spac-ver}{1.001}
+
+\newskip\blankskip \blankskip=\bigskipamount
+
+\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
+
+%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}
+
+% \unexpanded\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
+
+\def\presetnormallineheight
+ {\edef\normallineheight{\interlinespaceparameter\c!line}%
+ %done elsewhere : \spacing\!!plusone % new per 10/08/2004, else problems in otr / !! needed
+ \iflocalinterlinespace \else
+ \doifdefined\bodyfontinterlinespecs
+ {\doifsomething\bodyfontinterlinespace
+ {\edef\normallineheight{\bodyfontinterlinespace}}}%
+ \fi}
+
+\unexpanded\def\setupspecifiedinterlinespace[#1]%
+ {\getparameters[\??it\currentinterlinespace][#1]%
+ \dosetupspecifiedinterlinespaceindeed}
+
+\def\dosetupspecifiedinterlinespaceindeed
+ {\edef\strutheightfactor {\interlinespaceparameter\c!height}%
+ \edef\strutdepthfactor {\interlinespaceparameter\c!depth}%
+ \edef\minimumstrutheight {\interlinespaceparameter\c!minheight}%
+ \edef\minimumstrutdepth {\interlinespaceparameter\c!mindepth}%
+ \edef\minimumlinedistance{\interlinespaceparameter\c!distance}%
+ \edef\normallineheight {\interlinespaceparameter\c!line}%
+ \edef\topskipfactor {\interlinespaceparameter\c!top}%
+ \edef\maxdepthfactor {\interlinespaceparameter\c!bottom}%
+ \edef\baselinegluefactor {\interlinespaceparameter\c!stretch}%
+ % often topskip does more bad than good, so:
+ \ifx\topskipfactor\v!height
+ \let\topskipfactor\strutheightfactor
+ \fi
+ \setfontparameters % redundant, can be \setstrut, test first
+ \updateraggedskips} % yes indeed
+
+\let\currentrelativeinterlinespace\empty
+
+\setvalue{\??it::\v!on }{\oninterlineskip}
+\setvalue{\??it::\v!off }{\offinterlineskip}
+\setvalue{\??it::\v!reset}{\let\currentrelativeinterlinespace\empty
+ \let\setrelativeinterlinespace\relax
+ \setfontparameters}
+\setvalue{\??it::\v!auto }{\let\setrelativeinterlinespace\dosetrelativeinterlinespace}
+
+% \def\dosetspecifiedrelativeinterlinespace#1%
+% {\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
+% \spacing\currentrelativeinterlinespace}
+
+% \def\dosetspecifiedrelativeinterlinespace#1% fragile?
+% {\doifdimensionelse{#1}
+% {\setupspecifiedinterlinespace[\c!line=#1]}
+% {\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
+% \spacing\currentrelativeinterlinespace}}
+
+\def\dosetspecifiedrelativeinterlinespace#1% fragile?
+ {\doifdimenstringelse{#1}
+ {\setupspecifiedinterlinespace[\c!line=#1]}
+ {\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
+ \spacing\currentrelativeinterlinespace}}
+
+\unexpanded\def\setuprelativeinterlinespace[#1]%
+ {\processcommalist[#1]\dosetuprelativeinterlinespace}
+
+\def\dosetuprelativeinterlinespace#1%
+ {\ifcsname\??it::#1\endcsname
+ \csname\??it::#1\endcsname
+ \else
+ \dosetspecifiedrelativeinterlinespace{#1}%
+ \fi}
+
+\def\dosetrelativeinterlinespace
+ {\ifx\currentrelativeinterlinespace\empty\else
+ \spacing\currentrelativeinterlinespace
+ \fi}
+
+\let\setrelativeinterlinespace\relax
+
+% \appendtoks \setrelativeinterlinespace \to \everybodyfont
+
+\newtoks \everysetupglobalinterlinespace
+\newtoks \everysetuplocalinterlinespace
+
+% \def\complexsetupinterlinespace[#1]% \commalistelement ipv #1
+% {\doifassignmentelse{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]%
+% \the\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi}
+
+\def\interlinespaceparameter #1{\csname\dointerlinespaceparameter{\??it\currentinterlinespace}#1\endcsname}
+\def\dointerlinespaceparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dointerlinespaceparentparameter\csname#1\s!parent\endcsname#2\fi}
+\def\dointerlinespaceparentparameter#1#2{\ifx#1\relax\s!empty\else\dointerlinespaceparameter#1#2\fi}
+
+\newconditional\interlinespaceisset
+
+\let\currentinterlinespace\empty
+
+\unexpanded\def\defineinterlinespace
+ {\dodoubleempty\dodefineinterlinespace}
+
+\def\dodefineinterlinespace[#1][#2]%
+ {\getparameters[\??it#1][\s!parent=\??it,#2]}
+
+\unexpanded\def\setupinterlinespace
+ {\dodoubleempty\dosetupinterlinespace}
+
+\def\dosetupinterlinespace[#1][#2]%
+ {\settrue\interlinespaceisset % reset has to be done when needed
+ \ifsecondargument
+ \getparameters[\??it#1][#2]%
+ \else\iffirstargument
+ \edef\currentinterlinespace{\ifcsname\??it#1\s!parent\endcsname#1\fi}%
+ \ifx\currentinterlinespace\empty
+ \complexsetupinterlinespace[#1]%
+ \else
+ \dosetupspecifiedinterlinespaceindeed
+ \fi
+ \else
+ \let\currentinterlinespace\empty
+ \simplesetupinterlinespace
+ \fi\fi}
+
+\def\complexsetupinterlinespace[#1]% \commalistelement ipv #1
+ {\doifassignmentelse{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]%
+ \the\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi}
+
+\def\simplesetupinterlinespace % adapts to the font
+ {\localinterlinespacetrue
+ \setfontparameters
+ \updateraggedskips % funny one here
+ \the\everysetuplocalinterlinespace
+ \localinterlinespacefalse}
+
+% \def\dosetupcheckedinterlinespace#1% often a chain
+% {\edef\askedinterlinespace{#1}%
+% \ifx\askedinterlinespace\empty
+% \simplesetupinterlinespace
+% \else
+% \normalexpanded{\noexpand\doifassignmentelse{\askedinterlinespace}%
+% \noexpand\setupspecifiedinterlinespace
+% \noexpand\setuprelativeinterlinespace[\askedinterlinespace]}%
+% \iflocalinterlinespace
+% \the\everysetuplocalinterlinespace
+% \else
+% \localinterlinespacetrue
+% \the\everysetuplocalinterlinespace
+% \localinterlinespacefalse
+% \fi
+% \fi}
+
+\def\dosetupcheckedinterlinespace#1% often a chain
+ {\edef\askedinterlinespace{#1}%
+ \ifx\askedinterlinespace\empty
+ \simplesetupinterlinespace
+ \else\ifcsname\??it\askedinterlinespace\s!parent\endcsname
+ \pushmacro\currentinterlinespace
+ \let\currentinterlinespace\askedinterlinespace
+ \dosetupspecifiedinterlinespaceindeed
+ \iflocalinterlinespace
+ \the\everysetuplocalinterlinespace
+ \else
+ \localinterlinespacetrue
+ \the\everysetuplocalinterlinespace
+ \localinterlinespacefalse
+ \fi
+ \popmacro\currentinterlinespace
+ \else
+ \normalexpanded{\noexpand\doifassignmentelse{\askedinterlinespace}%
+ \noexpand\setupspecifiedinterlinespace
+ \noexpand\setuprelativeinterlinespace[\askedinterlinespace]}%
+ \iflocalinterlinespace
+ \the\everysetuplocalinterlinespace
+ \else
+ \localinterlinespacetrue
+ \the\everysetuplocalinterlinespace
+ \localinterlinespacefalse
+ \fi
+ \fi\fi}
+
+% \unexpanded\def\setuplocalinterlinespace[#1]%
+% {\localinterlinespacetrue
+% \let\@@saveditheight \@@itheight
+% \let\@@saveditdepth \@@itdepth
+% \let\@@saveditline \@@itline
+% \let\@@saveditminheight\@@itminheight
+% \let\@@saveditmindepth \@@itmindepth
+% \let\@@saveditdistance \@@itdistance
+% \let\@@savedittop \@@ittop
+% \let\@@saveditbottom \@@itbottom
+% \let\@@saveditstretch \@@itstretch
+% \setupinterlinespace[#1]%
+% \let\@@itheight \@@saveditheight
+% \let\@@itdepth \@@saveditdepth
+% \let\@@itline \@@saveditline
+% \let\@@itminheight\@@saveditminheight
+% \let\@@itmindepth \@@saveditmindepth
+% \let\@@itdistance \@@saveditdistance
+% \let\@@ittop \@@savedittop
+% \let\@@itbottom \@@saveditbottom
+% \let\@@itstretch \@@saveditstretch
+% \localinterlinespacefalse}
+
+\unexpanded\def\setuplocalinterlinespace[#1]%
+ {\localinterlinespacetrue
+ \pushmacro\currentinterlinespace
+ \setupinterlinespace[#1]%
+ \popmacro\currentinterlinespace
+ \localinterlinespacefalse}
+
+\let\switchtointerlinespace\setuplocalinterlinespace
+
+\definecomplexorsimple\setupinterlinespace
+
+\def\removelastskip % a redefinition of plain
+ {\ifvmode\ifdim\lastskip=\zeropoint\else\vskip-\lastskip\fi\fi}
+
+\def\doifoutervmode#1%
+ {\ifvmode\ifinner\else#1\fi\fi}
+
+\def\dosomebreak#1%
+ {\doifoutervmode
+ {\scratchskip\lastskip
+ \removelastskip
+ %\leavevmode\type{#1}%
+ #1\relax
+ \ifdim\scratchskip=\zeropoint % else interference with footnotes
+ \else
+ \vskip\scratchskip
+ \fi}}
+
+\def\packed
+ {\nointerlineskip}
+
+\def\godown[#1]%
+ {\relax
+ \ifhmode\endgraf\fi
+ \ifvmode\nointerlineskip\vskip#1\relax\fi}
+
+\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
+
+\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\currentwhitespace {\zeropoint}
+
+\definecomplexorsimple\setupwhitespace
+
+\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
+ {\ifcsname\??ws\??ws\currentwhitespace\endcsname
+ \csname\??ws\??ws\currentwhitespace\endcsname
+ \else
+ \expandafter\processcommalist\expandafter[\currentwhitespace]\dowhitespacemethod % can be raw
+ \fi\relax
+ \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
+
+\unexpanded\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%
+ {\ifcsname\??ws\??ws#1\endcsname\csname\??ws\??ws#1\endcsname\else\ctxparskip#1\fi\relax}
+
+% \def\nowhitespace
+% {\ifdim\parskip>\zeropoint\relax
+% \ifdim\lastskip=-\parskip
+% \else
+% \vskip-\parskip
+% \fi
+% \fi}
+%
+% \def\nowhitespaceunlessskip
+% {\ifdim\lastskip>\zeropoint \else
+% \nowhitespace
+% \fi}
+%
+% \def\whitespace
+% {\par
+% \ifdim\parskip>\zeropoint\relax
+% %\ifdim\lastskip>\parskip \else
+% % \removelastskip interferes with blanko blokkeer en klein
+% \vskip\parskip
+% %\fi
+% \fi}
+
+\def\nowhitespace{\vspacing[\v!nowhite]}
+\def\whitespace {\vspacing[\v!white]}
+
+% obsolete:
+%
+% \def\savedcurrentwhitespace{\currentwhitespace}
+% \def\savecurrentwhitespace {\edef\savedcurrentwhitespace{\currentwhitespace}}
+% \def\restorecurrentwhitespace{\edef\currentwhitespace{\savedcurrentwhitespace}}
+
+% 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.
+
+\newsignal \noparskipsignal % \def\noparskipsignal {0.00001pt}
+\def\lastdoneparskip {0pt}
+
+\newconditional\noblankinpacked
+\newcount\packeddepth
+
+\unexpanded\def\startpacked
+ {\dosingleempty\dostartpacked}
+
+\def\dostartpacked[#1]% nesting afvangen
+ {\global\advance\packeddepth\plusone
+ \par
+ \ifnum\packeddepth=\plusone \ifvmode
+ \bgroup
+ \whitespace % not combined
+ \blank[\v!disable]%
+ \doifelse{#1}\v!blank\setfalse\settrue\noblankinpacked
+ \setupwhitespace[\v!none]%
+ \fi \fi}
+
+\unexpanded\def\stoppacked
+ {\par
+ \ifnum\packeddepth=\plusone \ifvmode
+ \egroup
+ \fi \fi
+ \global\advance\packeddepth\minusone}
+
+\unexpanded\def\startunpacked
+ {\blank
+ \bgroup}
+
+\unexpanded\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.
+
+% \prevdepth crosses pageboundaries!
+%
+% todo: a version that works ok inside a box
+
+\let\doaroundlinecorrection\relax
+
+\unexpanded\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}
+
+\unexpanded\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
+%
+% \dontleavehmode
+
+% 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}
+
+\let\spacingfactor \plusone
+
+\def\topskipfactor {1.0}
+\def\maxdepthfactor {0.5}
+
+\def\systemtopskipfactor {\topskipfactor}
+\def\systemmaxdepthfactor {\maxdepthfactor}
+
+\ifdefined\globalbodyfontsize\else
+ \newdimen\globalbodyfontsize
+ \globalbodyfontsize=12pt
+\fi
+
+\ifdefined\normalizedbodyfontsize\else
+ \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
+ {\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
+\ifgridsnapping
+ \topskip\zeropoint
+\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 \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
+ %\dosetupgridsnapping
+ }
+
+\def\spacing#1%
+ {\ifgridsnapping
+ %\ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{\withoutpt\the\dimexpr#1\points\relax}\fi
+ \let\spacingfactor\plusone
+ \else
+ \edef\spacingfactor{#1}%
+ \fi
+ \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\else\unhcopy\fi\strutbox}
+
+\fi
+
+\let\normalstrut\strut
+
+% The double \hbox construction enables us to \backtrack
+% boxes.
+
+\let\strutht\undefined \newdimen\strutht
+\let\strutdp\undefined \newdimen\strutdp
+
+\unexpanded\def\setstrut
+ {\ifgridsnapping
+ \setstrutgridyes
+ \else
+ \setstrutgridnop
+ \fi}
+
+\unexpanded\def\setstrutgridyes
+ {\strutht\spacingfactor\dimexpr
+ \ifdim\minimumstrutheight>\zeropoint
+ \minimumstrutheight
+ \else
+ \strutheightfactor\dimexpr\normallineheight
+ \fi
+ \strutdp\dimexpr
+ \ifdim\minimumstrutdepth>\zeropoint
+ \minimumstrutdepth
+ \else
+ \normallineheight-\strutht
+ \fi
+ \dosetstrut}
+
+\unexpanded\def\setstrutgridnop
+ {\strutht\spacingfactor\dimexpr
+ \ifdim\minimumstrutheight>\zeropoint
+ \minimumstrutheight
+ \else
+ \strutheightfactor\dimexpr\normallineheight
+ \fi
+ \strutdp\spacingfactor\dimexpr
+ \ifdim\minimumstrutdepth>\zeropoint
+ \minimumstrutdepth
+ \else
+ \strutdepthfactor\dimexpr\normallineheight
+ \fi
+ \dosetstrut}
+
+\unexpanded\def\setcharstrut#1%
+ {\setbox\strutbox\normalhbox{#1}%
+ \strutht\ht\strutbox
+ \strutdp\dp\strutbox
+ \dosetstrut}
+
+\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}
+
+% 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
+
+\newdimen\tempstrutdimen
+
+\def\dosetstrut
+ {\let\strut\normalstrut
+ \tempstrutdimen\dimexpr\strutht+\strutdp-\lineheight\relax
+ \ifabsnum\tempstrutdimen<\plustwo
+ % compensate rounding error /- 1sp to avoid too many
+ % 1sp baselineskips in for instance verbatim
+ \strutht\dimexpr\strutht-\tempstrutdimen\relax
+ \fi
+ \edef\strutheight{\the\strutht}% maybe better \number\strutht sp
+ \edef\strutdepth {\the\strutdp}%
+ \ifdim\strutwidth=\zeropoint
+ \dosetstruthide
+ \else
+ \dosetstrutvide
+ \fi
+ \struttotal\dimexpr\strutht+\strutdp\relax}
+
+\def\dosetstruthide
+ {\setbox\strutbox\normalhbox
+ {\vrule
+ \!!width \zeropoint
+ \!!height\strutht
+ \!!depth \strutdp}}
+
+\def\dosetstrutvide
+ {\setbox\strutbox\normalhbox
+ {\normalhbox to \zeropoint
+ {% \hss % new, will be option
+ \vrule
+ \!!width \strutwidth
+ \!!height\strutht
+ \!!depth \strutdp
+ \hss}}}
+
+%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.
+
+% experiment
+
+\newbox\emptystrutbox \setbox\emptystrutbox\hbox{}
+
+\def\dosetstruthide
+ {\setbox\strutbox\copy\emptystrutbox
+ \ht\strutbox\strutht
+ \dp\strutbox\strutdp}
+
+\def\strut{\relax\dontleavehmode\copy\strutbox} % still callbacks for \hbox{\strut}
+
+
+\let\normalstrut\strut
+
+%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
+
+\unexpanded\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\showstruts
+ {\setteststrut
+ \settestcrlf}
+
+\def\setteststrut
+ {\def\strutwidth{.8pt}%
+ \setstrut}
+
+\def\autostrutfactor{1.1}
+
+\def\setautostrut
+ {\begingroup
+ \setbox\scratchbox\copy\strutbox
+ \setstrut
+ \ifdim\strutht>\autostrutfactor\ht\scratchbox
+ \endgroup \setstrut
+ \else\ifdim\strutdp>\autostrutfactor\dp\scratchbox
+ \endgroup \setstrut
+ \else
+ \endgroup
+ \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
+ {\def\strutwidth{\zeropoint}% no let
+ \setstrut}
+
+\ifdefined\setfontparameters\else
+ % 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\offinterlineskip
+ {\baselineskip-\thousandpoint
+ \lineskip\zeropoint
+ \lineskiplimit\maxdimen
+ % We also need this here now; thanks to taco for figuring that out!
+ \def\minimumlinedistance{\zeropoint}}
+
+\def\nointerlineskip
+ {\prevdepth-\thousandpoint}
+
+\let\normaloffinterlineskip=\offinterlineskip % knuth's original
+
+%D My own one:
+
+\def\dopushinterlineskip
+ {\edef\oninterlineskip
+ {\baselineskip\the\baselineskip
+ \lineskip\the\lineskip
+ \lineskiplimit\the\lineskiplimit
+ \noexpand\edef\noexpand\minimumlinedistance{\the\dimexpr\minimumlinedistance}%
+ \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}}
+
+\def\nopushinterlineskip
+ {\let\oninterlineskip\setnormalbaselines}
+
+\def\offinterlineskip
+ {\ifdim\baselineskip>\zeropoint
+ \dopushinterlineskip
+ \else
+ \nopushinterlineskip
+ \fi
+ \normaloffinterlineskip}
+
+\let\oninterlineskip=\relax
+
+\def\leaveoutervmode
+ {\ifvmode\ifinner\else
+ \leavevmode
+ \fi\fi}
+
+% We stellen enkele penalties anders in dan Plain TEX:
+%
+% \widowpenalty=\defaultwidowpenalty\relax
+% \clubpenalty =\defaultclubpenalty \relax
+
+\def\resetpenalties#1%
+ {\ifdefined#1%
+ #1\minusone
+ \fi}
+
+\def\setpenalties#1#2#3%
+ {\ifdefined#1% 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.
+
+% just before margintexts ... will eventually be done differently in mkiv using
+% attributes
+
+\newcount\nofkeeplinestogether
+\let\restoreinterlinepenalty\relax
+
+\def\dorestoreinterlinepenalty
+ {\global\let\restoreinterlinepenalty\relax
+ \global\resetpenalties\interlinepenalties
+ \global\nofkeeplinestogether\zerocount}
+
+\def\keeplinestogether#1%
+ {\ifnum#1>\nofkeeplinestogether
+ \global\nofkeeplinestogether#1%
+ \global\setpenalties\interlinepenalties\nofkeeplinestogether\plustenthousand
+ \global\let\restoreinterlinepenalty\dorestoreinterlinepenalty
+ \fi}
+
+\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}
+
+\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
+
+%D To be checked:
+
+\ifx\savedstrutbox\undefined \newbox\savedstrutbox \fi
+
+\def\savestrut {\setbox\savedstrutbox\copy\strutbox}
+\def\savedstrut{\copy \savedstrutbox}
+
+%D Page spacing
+
+\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
+
+%D Good old blank redone:
+
+\definesystemattribute[kern-chars]
+\definesystemattribute[skip-category] \chardef\skipcategoryattribute \dogetattributeid{skip-category}
+\definesystemattribute[skip-penalty] \chardef\skippenaltyattribute \dogetattributeid{skip-penalty}
+\definesystemattribute[skip-order] \chardef\skiporderattribute \dogetattributeid{skip-order}
+\definesystemattribute[display-math] \chardef\displaymathattribute \dogetattributeid{display-math}
+\definesystemattribute[snap-method] \chardef\snapmethodattribute \dogetattributeid{snap-method}
+\definesystemattribute[snap-done] \chardef\snapdoneattribute \dogetattributeid{snap-done}
+
+%definesystemattribute[snap-category] \chardef\snapcategoryattribute \dogetattributeid{snap-category}
+
+% TODO: NAMED SNAPPERS
+
+\newskip \bodyfontlineheight
+\newdimen \bodyfontstrutheight
+\newdimen \bodyfontstrutdepth
+
+\newskip \globalbodyfontlineheight
+\newdimen \globalbodyfontstrutheight
+\newdimen \globalbodyfontstrutdepth
+
+% \appendtoks
+% \dosetupgridsnapping
+% \to \everysetupbodyfont
+
+\def\installsnapvalues#1#2% todo: a proper define
+ {\edef\currentsnapper{#1:#2}%
+ \ifcsname\currentsnapper\endcsname \else
+ \setevalue\currentsnapper{\ctxlua{vspacing.define_snap_method("#1","#2")}}%
+ \fi
+ \setevalue{\??gr:#1}{\attribute\snapmethodattribute\csname\currentsnapper\endcsname\space}}
+
+\unexpanded\def\definegridsnapping
+ {\dodoubleargument\dodefinegridsnapping}
+
+\def\dodefinegridsnapping[#1][#2]%
+ {\installsnapvalues{#1}{#2}}
+
+\edef\resetsnapvalue
+ {%\gridsnappingfalse
+ \attribute\snapmethodattribute\attributeunsetvalue}
+
+\def\setsnapvalue#1%
+ {%\gridsnappingtrue
+ \ifcsname\??gr:#1\endcsname\csname\??gr:#1\endcsname\fi}
+
+\def\autosetsnapvalue#1%
+ {\ifcsname\??gr:#1\endcsname
+ \csname\??gr:#1\endcsname
+ \else
+ \installsnapvalues\s!dummy{#1}%
+ \csname\??gr:\s!dummy\endcsname
+ \fi}
+
+% \installsnapvalues{loose} {\v!maxdepth:0.8,\v!maxheight:0.8,\v!strut}
+% \installsnapvalues{normal}{\v!maxdepth:1.0,\v!maxheight:1.0,\v!strut}
+% \installsnapvalues{tight} {\v!maxdepth:1.2,\v!maxheight:1.2,\v!strut}
+
+% none don't enlarge
+% halfline enlarge by halfline/halfline
+% line enlarge by line/line
+% strut enlarge by ht/dp (default)
+% first align to top line
+% last align to bottom line
+% mindepth round depth down
+% maxdepth round depth up
+% minheight round height down
+% maxheight round height up
+% local use local interline space
+% shift:-3tp vertical shift within box
+
+%D We're not downward compatible with \MKII !
+
+\definegridsnapping[\v!normal] [\v!maxheight,\v!maxdepth,\v!strut]
+\definegridsnapping[\v!standard] [\v!maxheight,\v!maxdepth,\v!strut]
+\definegridsnapping[\v!yes] [\v!maxheight,\v!maxdepth,\v!strut]
+
+\definegridsnapping[\v!strict] [\v!maxdepth:0.8,\v!maxheight:0.8,\v!strut]
+\definegridsnapping[\v!tolerant] [\v!maxdepth:1.2,\v!maxheight:1.2,\v!strut]
+
+\definegridsnapping[\v!top] [\v!minheight,\v!maxdepth,\v!strut]
+\definegridsnapping[\v!bottom] [\v!maxheight,\v!mindepth,\v!strut]
+\definegridsnapping[\v!both] [\v!minheight,\v!mindepth,\v!strut]
+
+\definegridsnapping[\v!broad] [\v!maxheight,\v!maxdepth,\v!strut,0.8] % maybe 0.85
+\definegridsnapping[\v!fit] [\v!maxheight,\v!maxdepth,\v!strut,1.2] % tight 0.15
+
+\definegridsnapping[\v!first] [\v!first]
+\definegridsnapping[\v!last] [\v!last]
+\definegridsnapping[\v!high] [\v!minheight,\v!maxdepth,\v!none]
+\definegridsnapping[\v!low] [\v!maxheight,\v!mindepth,\v!none]
+\definegridsnapping[\v!line] [\v!line]
+\definegridsnapping[\v!strut] [\v!strut]
+
+\definegridsnapping[\v!max] [\v!maxdepth,\v!maxheight,\v!strut]
+\definegridsnapping[\v!min] [\v!mindepth,\v!minheight,\v!strut]
+
+\newtoks\everysetupgridsnapping % this only happens at the setuplayout level
+
+\def\dosetupgridsnapping{\the\everysetupgridsnapping} % not used !
+
+\def\synchronizelocallinespecs
+ {\bodyfontlineheight \normallineheight
+ \bodyfontstrutheight\strutheight
+ \bodyfontstrutdepth \strutdepth}
+
+\def\synchronizegloballinespecs
+ {\global\globalbodyfontlineheight \normallineheight
+ \global\globalbodyfontstrutheight\strutheight
+ \global\globalbodyfontstrutdepth \strutdepth}
+
+% \appendtoks
+% \synchronizegloballinespecs
+% \synchronizelocallinespecs
+% \to \everysetupgridsnapping
+
+\appendtoks
+ \synchronizegloballinespecs
+ \synchronizelocallinespecs
+\to \everysetupglobalinterlinespace
+
+\appendtoks
+ \synchronizelocallinespecs
+\to \everysetuplocalinterlinespace
+
+% \appendtoks
+% \resetsnapvalues
+% \to \everyforgetall
+
+%D Snapping.
+
+\newif\ifgridsnapping
+
+\let\showgridsnapping\relax
+
+\def\snaptogrid {\dosingleempty\dosnaptogrid}
+\def\moveongrid {\dosingleempty\domoveongrid}
+\unexpanded\def\placeongrid{\dosingleempty\doplaceongrid}
+
+\def\dodomoveongrid[#1]%
+ {} % gone, unless we set an attribute
+
+\def\doplaceongrid[#1]%
+ {\snaptogrid[#1]\vbox}
+
+\def\dosnaptogrid[#1]% list or predefined
+ {\ifgridsnapping
+ \expandafter\dodosnaptogrid
+ \else
+ \expandafter\gobbleoneargument
+ \fi{#1}}
+
+\def\dodosnaptogrid#1%
+ {\bgroup
+ \resetsnapvalue
+ \dowithnextbox{\dododosnaptogrid{#1}}}
+
+% eventually there will always be a line snap
+
+\def\dododosnaptogrid#1%
+ {\ifvbox\nextbox
+ \ctxlua{nodes.collapse_vbox(\number\nextbox)}%
+ \fi
+ \doifelsenothing{#1}{\setsnapvalue\v!normal}{\autosetsnapvalue{#1}}%
+ \ctxlua{vspacing.snap_box(\number\nextbox,\number\attribute\snapmethodattribute)}%
+% \ifzeropt\ht\nextbox
+% \ifzeropt\dp\nextbox
+% \box\nextbox % here, else empty and zero
+% \kern-\bodyfontlineheight
+% \else
+% \box\nextbox
+% \fi
+% \else
+ \box\nextbox
+% \fi
+ \egroup}
+
+\def\docheckgridsnapping
+ {\edef\askedgridmode{\layoutparameter\c!grid}% needs checking by WS
+ \doifelse\askedgridmode\v!no
+ {\gridsnappingfalse
+ \resetsystemmode\v!grid
+ \resetsnapvalue}
+ {\gridsnappingtrue
+ \setsystemmode\v!grid
+ \autosetsnapvalue\askedgridmode}}
+
+%D Visualization:
+
+\definepalet
+ [grid]
+ [ one=red,
+ two=green,
+ three=blue,
+ four=gray]
+
+\def\setgridtracebox#1[#2]% % maybe reverse the order
+ {\setbox\nextbox#1%
+ {\hbox
+ {\hbox to \zeropoint
+ {\setlayoutcomponentattribute\v!grid\v!test
+ \color[grid:#2]{\ruledhbox \layoutcomponentboxattribute {\fakebox\nextbox}}%
+ \hss}%
+ \flushnextbox}}}
+
+\chardef\gridboxlinenomode\plusone % 0:nothing 1:all 2:lines 3:frame 4:l/r
+\chardef\gridboxlinemode \plusone
+
+\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% maybe ifgridsnapping at outer level
+ {\setbox#1\gridboxvbox to #3 % given size
+ {\forgetall
+ \resetteststrut
+ \offinterlineskip
+ \hsize#2%
+ \baselinerulefalse
+ \ifnum\gridboxlinenomode=\plusthree
+ \chardef\gridboxlinenomode\ifodd\realpageno\plusone\else\plustwo\fi
+ \fi
+ \gridboxvbox % calculated size
+ {\getrawnoflines{#3}% \getnoflines{#3}%
+% \ifgridsnapping \else
+% \vskip\topskip
+% \vskip-\strutht
+% \fi
+ \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 This has become obsolete:
+
+\def\fuzzysnappedbox#1#2% \box<n> \unvbox<n>
+ {#1#2}
+
+% \def\moveboxontogrid#1#2#3% will become obsolete
+% {\doif{#2}\v!top {\setbox#1\hbox{\snaptogrid[\v!first]\box#1}}%
+% \doif{#2}\v!bottom{\setbox#1\hbox{\snaptogrid[\v!last ]\box#1}}}
+
+\def\moveboxontogrid#1#2#3% will become obsolete
+ {}
+
+%D Helper:
+
+\def\doassignsomeskip#1\to#2% ook nog \v!halfline+fuzzysnap
+ {\doifelse{#1}\v!line
+ {#2\ifgridsnapping
+ \bodyfontlineheight
+ \else
+ \openlineheight
+ \fi}
+ {\ifgridsnapping
+ \assigndimension{#1}{#2}{.25\bodyfontlineheight}{.5\bodyfontlineheight}\bodyfontlineheight
+ \else
+ \assigndimension{#1}{#2}\smallskipamount\medskipamount\bigskipamount
+ \fi}%
+ \relax}
+
+% \start \dosetstretch{.25em} \setuptolerance[tolerant,stretch] \input tufte \endgraf \stop
+% \start \dosetstretch{.5em} effe flink doorfietsen \stop
+
+% \def\dosetupgridsnapping % calls too often, only needed in gridsnapping
+% {\ctxlua{nodes.setsnapvalue(1,\number\openstrutheight,\number\openstrutdepth)}}
+%
+% \def\doenablegridsnapping
+% {\attribute\snapcategoryattribute\plusone
+% \topskip\strutht
+% \offinterlineskip}
+%
+% \def\dodisablegridsnapping
+% {\attribute\snapcategoryattribute\attributeunsetvalue
+% % reset topskip
+% \oninterlineskip}
+
+% experimental code, not yet interfaced:
+
+% category:
+% 0 == discard discard
+% 1 == only if larger largest
+% 2 == force even if smaller force
+% 3 == only take penalty component penalty
+% 4 == add to existing skip add
+% 5 == disable (ignore following) disable
+% 6 == kill whitespace nowhite
+% 7 == discard previous back
+%
+% penalty: larger wins
+% order: larger wins
+% category:2,order:5,penalty:10000,skip:value|kw
+%
+% \defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi}
+
+% todo, in grid mode: vspacing.fixed = false
+
+\let\saveouterspacing \relax % for old times sake
+\let\restoreouterspacing\relax % for old times sake
+
+\newtoks\everybeforeblankhandling
+\newtoks\everyafterblankhandling
+
+\newconditional\someblankdone
+
+\appendtoks
+ \blankskip\zeropoint
+ \attribute\skipcategoryattribute\plusone
+ \attribute\skippenaltyattribute \attributeunsetvalue
+ \attribute\skiporderattribute \attributeunsetvalue
+ \ifgridsnapping % \ifblankflexible
+ \setfalse\blankisfixed
+ \else
+ \settrue\blankisfixed
+ \fi
+\to \everybeforeblankhandling
+
+\appendtoks
+ \ifconditional\blankisfixed
+ \blankskip1\blankskip
+ \else
+ \blankskip1\blankskip\!!plus\skipgluefactor\blankskip\!!minus\skipgluefactor\blankskip
+ \fi
+\to \everyafterblankhandling
+
+% \ifgridsnapping will go
+
+\appendtoks
+ \ifgridsnapping
+ \settrue\blankisfixed
+ \else
+ \setfalse\blankisfixed
+ \fi
+\to \everybeforeblankhandling
+
+\def\setblankcategory#1%
+ {\settrue\someblankdone
+ \attribute\skipcategoryattribute#1\relax}
+
+\def\setblankorder#1%
+ {\attribute\skiporderattribute#1\relax}
+
+\def\fixedblankskip
+ {\settrue\blankisfixed}
+
+\def\flexibleblankskip
+ {\setfalse\blankisfixed}
+
+\def\addblankskip#1#2#3%
+ {\settrue\someblankdone
+ \advance\blankskip#1\dimexpr\ifgridsnapping#3\else#2\fi\relax\relax}
+
+\def\setblankpenalty #1%
+ {\flushblankhandling
+ \settrue\someblankdone
+ \attribute\skipcategoryattribute \plusthree
+ \attribute\skippenaltyattribute #1\relax
+ \flushblankhandling}
+
+\unexpanded\def\startblankhandling
+ {\par
+ \ifvmode
+ \expandafter\dostartblankhandling
+ \else
+ \expandafter\nostartblankhandling
+ \fi}
+
+\def\nostartblankhandling#1\stopblankhandling
+ {}
+
+\def\dostartblankhandling
+ {\begingroup
+ \setfalse\someblankdone
+ \the\everybeforeblankhandling}
+
+\unexpanded\def\stopblankhandling
+ {\the\everyafterblankhandling
+ \ifconditional\someblankdone
+ \vskip\blankskip
+ \fi
+ \endgroup}
+
+\def\flushblankhandling
+ {\the\everyafterblankhandling
+ \ifconditional\someblankdone
+ \vskip\blankskip
+ \fi
+ \setfalse\someblankdone
+ \the\everybeforeblankhandling}
+
+% % % % we can move much to lua once we can expand there % % % %
+
+\unexpanded\def\definevspacingamount
+ {\dotripleempty\dodefinevspacingamount}
+
+% \def\dodefinevspacingamount[#1][#2][#3]%
+% {\ctxlua{vspacing.setskip("#1",\!!bs\detokenize{#2}\!!es,\!!bs\detokenize{#3}\!!es)}}
+
+\def\dodefinevspacingamount[#1][#2][#3]% can be combined
+ {\setvalue{\??vs:#1}{\ifgridsnapping#3\else#2\fi}%
+ \ctxlua{vspacing.setskip("#1")}}
+
+\def\addpredefinedblankskip#1#2%
+ {\settrue\someblankdone
+ \advance\blankskip#1\dimexpr\csname\??vs:#2\endcsname\relax}
+
+\def\addaskedblankskip#1#2%
+ {\settrue\someblankdone
+ \advance\blankskip#1\dimexpr#2\relax}
+
+\unexpanded\def\definevspacing
+ {\dodoubleempty\dodefinevspacing}
+
+\def\dodefinevspacing[#1][#2]%
+ {\ctxlua{vspacing.setmap("#1","#2")}}
+
+\unexpanded\def\vspacing
+ {\dosingleempty\dovspacing}
+
+% todo: when packed blocks blank, we need to enable forced
+
+\def\dovspacing % blank also has a \flushnotes
+ {\ifinpagebody
+ \expandafter\dovspacingyes
+ \else\ifconditional\noblankinpacked % todo: better reset this conditional in pagebody
+ \expandafter\expandafter\expandafter\dovspacingnop
+ \else
+ \expandafter\expandafter\expandafter\dovspacingyes
+ \fi\fi}
+
+\def\dovspacingyes[#1]%
+ {\ifmmode\else\ctxlua{vspacing.analyse("\iffirstargument#1\else\s!default\fi")}\fi}
+
+\def\dovspacingnop[#1]%
+ {\ifmmode\else\par\fi}
+
+% todo: check them and make them faster:
+
+\definecomplexorsimple\setupvspacing
+
+\let\currentvspacing\empty
+
+\def\complexsetupvspacing[#1]%
+ {\edef\currentvspacing{#1}}
+
+\def\simplesetupvspacing
+ {\ifx\empty\currentvspacing\else
+ \let\currentvspacing\s!default
+ \fi
+ \simplesetupwhitespace}
+
+\def\restorestandardblank
+ {\let\currentvspacing\v!standard}
+
+% used both
+
+\def\doinhibitblank{\vspacing[\v!disable]} % can be made faster
+\def\inhibitblank {\vspacing[\v!disable]} % can be made faster
+
+\let\setupblank \setupvspacing
+\let\simplesetupblank\simplesetupvspacing
+\let\blank \vspacing
+
+% category:4 is default
+
+% \definevspacingamount[\v!big] [\bigskipamount] [\openlineheight]
+% \definevspacingamount[\v!medium] [\medskipamount] [0.50\openlineheight]
+% \definevspacingamount[\v!small] [\smallskipamount] [0.25\openlineheight]
+% \definevspacingamount[\v!line] [\openlineheight] [\openlineheight]
+% \definevspacingamount[\v!halfline][0.50\openlineheight][0.50\openlineheight]
+% \definevspacingamount[\v!formula] [\medskipamount] [0.50\openlineheight]
+% \definevspacingamount[\v!white] [\parskip] [\openlineheight]
+% \definevspacingamount[\v!height] [\strutheight] [\strutheight]
+% \definevspacingamount[\v!depth] [\strutdepth] [\strutdepth]
+
+\definevspacingamount[\v!none] [\zeropoint] [\zeropoint]
+\definevspacingamount[\v!big] [\bigskipamount] [\bodyfontlineheight]
+\definevspacingamount[\v!medium] [\medskipamount] [0.50\bodyfontlineheight]
+\definevspacingamount[\v!small] [\smallskipamount] [0.25\bodyfontlineheight]
+\definevspacingamount[\v!line] [\openlineheight] [\bodyfontlineheight]
+\definevspacingamount[\v!halfline][0.50\openlineheight][0.50\bodyfontlineheight]
+\definevspacingamount[\v!formula] [\medskipamount] [0.50\bodyfontlineheight]
+\definevspacingamount[\v!white] [\parskip] [\bodyfontwhitespace]
+\definevspacingamount[\v!height] [\strutheight] [\bodyfontstrutheight]
+\definevspacingamount[\v!depth] [\strutdepth] [\bodyfontstrutdepth]
+
+\def\bodyfontwhitespace
+ {\dimexpr
+ \ifdim\parskip=\zeropoint
+ \zeropoint
+ \else\ifgridsnapping
+ \bodyfontlineheight
+ \else
+ \parskip
+ \fi\fi
+ \relax}
+
+\definevspacing[\v!preference][penalty:-500] % goodbreak
+\definevspacing[\v!samepage] [penalty:10000] % real strong
+\definevspacing[\v!max] [category:1]
+\definevspacing[\v!force] [category:2]
+\definevspacing[\v!disable] [category:5]
+\definevspacing[\v!nowhite] [category:6]
+\definevspacing[\v!back] [category:7]
+\definevspacing[\v!always] [category:0]
+\definevspacing[\v!weak] [order:0]
+\definevspacing[\v!strong] [order:100]
+
+\definevspacing[\s!default] [\v!white] % was big for a while
+
+\dorecurse{10} % todo: other values < 4000
+ {\expanded{\definevspacing[\v!samepage-\recurselevel][penalty:\the\numexpr4000+250*\recurselevel\relax]}}
+
+% \setfalse\vspacingenabled
+%
+% \newtoks\everyenablevspacing
+% \newtoks\everydisablevspacing
+%
+% \def\enablevspacing {\the\everyenablevspacing}
+% \def\disablevspacing{\the\everydisablevspacing}
+%
+% \appendtoks
+% \writestatus\m!systems{! ! enabling vspacing ! !}%
+% \settrue\vspacingenabled
+% \ctxlua{vspacing.enable()}%
+% \to \everyenablevspacing
+%
+% \appendtoks
+% \writestatus\m!systems{! ! disabling vspacing ! !}%
+% \setfalse\vspacingenabled
+% \ctxlua{vspacing.disable()}%
+% \to \everydisablevspacing
+
+\let\blank \vspacing
+\let\defineblank \definevspacing
+\let\defineblankmethod\definevspacingamount
+
+%D The following command is for Wolfgang. It has to be used with
+%D care as it does {\em not} work in tandem with the other spacing
+%D commands.
+
+\unexpanded\def\definevspace
+ {\dotripleempty\dodefinevspace}
+
+\def\dodefinevspace[#1][#2][#3]%
+ {\ifthirdargument
+ \setvalue{\??va#1:#2}{#3}%
+ \else
+ \setvalue{\??va:#1}{#2}%
+ \fi}
+
+\unexpanded\def\vspace
+ {\dodoubleempty\dovspace}
+
+\def\dovspace[#1][#2]%
+ {\ifsecondargument
+ \dodovspace[#1][#2]%
+ \else\iffirstargument
+ \vspace[][#1]%
+ \else
+ \vspace[][\s!default]%
+ \fi\fi}
+
+\def\dodovspace[#1][#2]%
+ {\par
+ \ifvmode
+ \removelastskip
+ \vskip\vspaceamount{#1}{#2}\relax
+ \fi}
+
+\def\vspaceamount#1#2%
+ {\executeifdefined{\??va#1:#2}{\executeifdefined{\??va:#2}\zeropoint}}
+
+%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
+
+% \unexpanded\def\setuplines
+% {\dodoubleargument\getparameters[\??rg]}
+%
+% \unexpanded\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}
+%
+% \unexpanded\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]
+
+%D Contrary to \MKII\ we can now define classes of lines (generalized by
+%D Wolfgang). I will probably rewrite bits in \LUA.
+
+\let\currentlines\empty
+
+\def\linesparameter #1{\csname\dolinesparameter{\??rg\currentlines}#1\endcsname}
+\def\linesparameterhash#1{\dolinesparameterhash {\??rg\currentlines}#1}
+
+\def\dolinesparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dolinesparentparameter \csname#1\s!parent\endcsname#2\fi}
+\def\dolinesparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\dolinesparentparameterhash\csname#1\s!parent\endcsname#2\fi}
+
+\def\dolinesparentparameter #1#2{\ifx#1\relax\s!empty\else\dolinesparameter #1#2\fi}
+\def\dolinesparentparameterhash#1#2{\ifx#1\relax \else\dolinesparameterhash#1#2\fi}
+
+\def\dosetlinesattributes#1#2% style color
+ {\edef\fontattributehash {\linesparameterhash#1}%
+ \edef\colorattributehash{\linesparameterhash#2}%
+ \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi
+ \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi}
+
+\getparameters
+ [\??rg]
+ [\c!option=,
+ \c!before=\blank,
+ \c!after=\blank,
+ \c!inbetween=\blank,
+ \c!indenting=\v!no,
+ \c!space=\v!default]
+
+\unexpanded\def\definelines
+ {\dodoubleempty\dodefinelines}
+
+\def\dodefinelines[#1][#2]%
+ {\getparameters[\??rg#1][\s!parent=\??rg,#2]%
+ \setvalue{\e!start#1}{\dostartlines[#1]}%
+ \setvalue{\e!stop #1}{\dostoplines}}
+
+\unexpanded\def\setuplines
+ {\dodoubleempty\dosetuplines}
+
+\def\dosetuplines[#1][#2]%
+ {\doifelsenothing{#2}
+ {\getparameters[\??rg][#1]}
+ {\def\docommand##1{\getparameters[\??rg##1][#2]}%
+ \processcommacommand[#1]\docommand}}
+
+\def\dostartlines[#1]%
+ {\bgroup
+ \edef\currentlines{#1}%
+ \linesparameter\c!before
+ \pushmacro\checkindentation
+ \whitespace
+ \begingroup
+ \dosetlinesattributes\c!style\c!color
+ \setupindenting[\linesparameter\c!indenting]%
+ \setupalign[\linesparameter\c!align]%
+ \typesettinglinestrue
+ \setupwhitespace[\v!none]%
+ \obeylines
+ \ignorespaces
+ \gdef\afterfirstobeyedline % tzt two pass, net als opsomming
+ {\gdef\afterfirstobeyedline
+ {\nobreak
+ \doifnot{\linesparameter\c!option}\v!packed{\global\let\afterfirstobeyedline\relax}}}%
+ \def\obeyedline
+ {\par
+ \futurelet\next\dobetweenthelines}%
+ \activatespacehandler{\linesparameter\c!space}%
+ \GotoPar}
+
+\def\dostoplines
+ {\endgroup
+ \popmacro\checkindentation
+ \linesparameter\c!after
+ \egroup}
+
+\def\dobetweenthelines
+ {\doifmeaningelse\next\obeyedline
+ {\linesparameter\c!inbetween}
+ {\afterfirstobeyedline}}
+
+\definelines[\v!lines]
+
+\def\emptylines
+ {\dosingleempty\doemptylines}
+
+\def\doemptylines[#1]%
+ {\endgraf\dorecurse{\iffirstargument#1\else3\fi}\crlf}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-dpm.mkii b/Master/texmf-dist/tex/context/base/spec-dpm.mkii
index 9cf023fe0a8..efecd792806 100644
--- a/Master/texmf-dist/tex/context/base/spec-dpm.mkii
+++ b/Master/texmf-dist/tex/context/base/spec-dpm.mkii
@@ -411,7 +411,8 @@
\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 (#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
diff --git a/Master/texmf-dist/tex/context/base/spec-dpx.mkii b/Master/texmf-dist/tex/context/base/spec-dpx.mkii
index ed49ea843c9..c521da8c72c 100644
--- a/Master/texmf-dist/tex/context/base/spec-dpx.mkii
+++ b/Master/texmf-dist/tex/context/base/spec-dpx.mkii
@@ -590,7 +590,8 @@
%\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 (#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
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.mkii b/Master/texmf-dist/tex/context/base/spec-fdf.mkii
index 6579a9247f6..30e15ff34eb 100644
--- a/Master/texmf-dist/tex/context/base/spec-fdf.mkii
+++ b/Master/texmf-dist/tex/context/base/spec-fdf.mkii
@@ -191,6 +191,26 @@
\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
@@ -301,10 +321,20 @@
\addPDFdocumentinfo
\to \everyfirstshipout
-\def\PDFversion{1.5}
+\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.5}%
+ \def\PDFversion{1.\the\pdfminorversion}%
\let\addPDFdocumentinfo\relax
\to \everyresetspecials
@@ -347,21 +377,39 @@
\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
- \edef\!!stringa{#5}%
- \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
- \edef\!!stringa{D:\pdfdate}%
- \fi \fi
+ \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 (#1)
- /Subject (#2)
- /Author (#3)
- /Creator (#4)
- /ModDate (\!!stringa)
- /ID (\jobname.\!!stringa) % needed for pdf/x
- /Keywords (#6)}}%
+ {/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
@@ -1149,10 +1197,8 @@
\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1
{\bgroup
- % todo, unicode
- \sanitizePDFdocencoding#3\to\bookmarktext % uses scratchcounter
+ \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter
\stripstring\bookmarktext
- %\sanitizePDFstring#3\to\bookmarktext
\doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
\egroup}
@@ -1171,7 +1217,7 @@
\def\FDFflagMultiLine {4096} % 13
\def\FDFflagNoToggleToOff {16384} % 15
-\def\FDFflagRadio {32768} % 16
+\def\FDFflagRadio {32768} % 16 (not used as such)
\def\FDFflagPushButton {65536} % 17
\def\FDFflagPopUp {131072} % 18
\def\FDFflagEdit {262144} % 19
@@ -1376,66 +1422,31 @@
\let\FDFactions\empty
-%\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8]%
-% {\global\let\FDFactions\empty
-% \setFDFaction D#1% mousedown
-% \setFDFaction U#2% mouseup
-% \setFDFaction E#3% enterregion
-% \setFDFaction X#4% exitregion
-% \setFDFaction K#5% afterkeystroke
-% \setFDFaction F#6% formatresult
-% \setFDFaction V#7% validateresult
-% \setFDFaction C#8% calculatewhatever
-% \ifx\FDFactions\empty\else
-% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited
-% \fi}
-%% {\setFDFaction A#2}% mouseup % changed for version 5
-
-% \def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,%
-% {\global\let\FDFactions\empty
-% \setFDFaction D#1% mousedown
-% %\setFDFaction U#2% mouseup
-% \setFDFaction E#3% enterregion
-% \setFDFaction X#4% exitregion
-% \setFDFaction K#5% afterkeystroke
-% \setFDFaction F#6% formatresult
-% \setFDFaction V#7% validateresult
-% \setFDFaction C#8% calculatewhatever
-% \setFDFactionsmore#2,}
-
-% \def\setFDFactionsmore#1,#2,#3]%
-% {\setFDFaction{Fo}#2% focusin
-% \setFDFaction{Bl}#3% 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
-% \setFDFaction A#1}% mouseup
-
\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,%
{\global\let\FDFactions\empty
- \setFDFaction D#1% mousedown
- \setFDFaction U#2% mouseup
- \setFDFaction E#3% enterregion
- \setFDFaction X#4% exitregion
- \setFDFaction K#5% afterkeystroke
- \setFDFaction F#6% formatresult
- \setFDFaction V#7% validateresult
- \setFDFaction C#8% calculatewhatever
+ \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% focusin
- \setFDFaction{Bl}#2% focusout % was I (now pdf ref manual explicitly talks about lowercase l)
+ {\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
-% \setFDFaction{PC}\@@DriverFieldPageClose
-% \setFDFaction{PV}\@@DriverFieldPageVisible
-% \setFDFaction{PI}\@@DriverFieldPageInVisible
+% \setFDFaction{PO}\@@DriverFieldPageOpen\relax
+% \setFDFaction{PC}\@@DriverFieldPageClose\relax
+% \setFDFaction{PV}\@@DriverFieldPageVisible\relax
+% \setFDFaction{PI}\@@DriverFieldPageInVisible\relax
%D The event handler becomes something:
%D
@@ -1444,7 +1455,7 @@
%D /A << /S /JavaScript /JS (...) >>
%D \stoptyping
-% \def\setFDFaction#1#2%
+% \def\setFDFaction#1#2\relax%
% {\bgroup
% \global\let\sanitizedJScode\empty
% \def\setFDFaction##1%
@@ -1466,7 +1477,7 @@
%
% acrobat 5 supports other that JS actions too
-\def\setFDFaction#1#2%
+\def\setFDFaction#1#2\relax%
{\bgroup
\def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}%
\@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion
@@ -1486,7 +1497,7 @@
%D a message to the console.
\def\testFDFactions
- {\def\setFDFaction##1##2%
+ {\def\setFDFaction##1##2\relax%
{\doPSsanitizeJScode console.show();console.println("executing:##1"); \to\sanitizedJScode
\edef\FDFactions{\FDFactions /##1 << /S /JavaScript /JS (\sanitizedJScode) >> }}}
@@ -1919,6 +1930,11 @@
\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
@@ -2003,13 +2019,19 @@
% 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]%
+ % \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
@@ -2358,7 +2380,69 @@
\let^^M=\\}
\egroup
-\let\sanitizePDFencoding\sanitizePDFdocencoding
+% \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:
@@ -3279,6 +3363,9 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/spec-tpd.mkii b/Master/texmf-dist/tex/context/base/spec-tpd.mkii
index 597993e0a72..6af3b1272df 100644
--- a/Master/texmf-dist/tex/context/base/spec-tpd.mkii
+++ b/Master/texmf-dist/tex/context/base/spec-tpd.mkii
@@ -1176,7 +1176,7 @@
\pdfoutline
user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
\ifcase#2 \else count \ifcase#5-\fi#2 \fi
- {#3}}
+ {\ifPDFunicode<#3>\else#3\fi}}
%D \macros
%D {doPDFdictionaryobject,doPDFarrayobject}
diff --git a/Master/texmf-dist/tex/context/base/spec-tst.mkii b/Master/texmf-dist/tex/context/base/spec-tst.mkii
index bdd8a29b221..543baa647b3 100644
--- a/Master/texmf-dist/tex/context/base/spec-tst.mkii
+++ b/Master/texmf-dist/tex/context/base/spec-tst.mkii
@@ -11,113 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifcase \pdfoutput \endinput \fi
-
\unprotect
-%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}
-
-% pdftex specific
-
-\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}
-
-\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}}
-
-\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 The code is now merged into spec-*.mkii
\protect
\doifnotmode{demo}{\endinput}
-% \input spec-tst.tex
-
\mainlanguage[vn]
\enableregime[utf]
\usetypescript[all][computer-modern][t5]
@@ -149,4 +50,3 @@
\subsection{Mục nhỏ thứ hai} Thử tiếng Việt
\stoptext
-
diff --git a/Master/texmf-dist/tex/context/base/strc-bkm.lua b/Master/texmf-dist/tex/context/base/strc-bkm.lua
index 8f8a3ca246a..f34d83ec557 100644
--- a/Master/texmf-dist/tex/context/base/strc-bkm.lua
+++ b/Master/texmf-dist/tex/context/base/strc-bkm.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-bkm'] = {
version = 0.200,
- comment = "companion to strc-bkm.tex",
+ comment = "companion to strc-bkm.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -59,21 +59,35 @@ local function stripped(str) -- kind of generic
return str
end
+-- todo: collect specs and collect later i.e. multiple places
+
function bookmarks.place()
if names ~= "" then
local list = lists.filter(names,"all",nil,lists.collected)
+ local lastlevel = 1
if #list > 0 then
local opened, levels = aux.settings_to_set(opened), { }
for i=1,#list do
local li = list[i]
local metadata = li.metadata
local name = metadata.name
- if not metadata.nolist and levelmap[name] then
+ if not metadata.nolist then -- and levelmap[name] then
local titledata = li.titledata
if titledata then
+ local structural = levelmap[name]
+ lastlevel = structural or lastlevel
+ local title = titledata.bookmark
+ if not title or title == "" then
+ if not structural then
+ -- placeholder, todo: bookmarklabel
+ title = name .. ": " .. (titledata.title or "?")
+ else
+ title = titledata.title or "?"
+ end
+ end
levels[#levels+1] = {
- levelmap[name],
- stripped(titledata.bookmark or titledata.title or "?"),
+ lastlevel,
+ stripped(title),
li.references, -- has internal and realpage
allopen or opened[name]
}
@@ -85,3 +99,33 @@ function bookmarks.place()
function bookmarks.place() end -- prevent second run
end
end
+
+lpdf.registerdocumentfinalizer(function() structure.bookmarks.place() end,1)
+
+-- bkm
+--~ function nodes.toutf(list)
+--~ local t= { }
+--~ for n in node.traverse(list) do
+--~ local id = n.id
+--~ if id == node.id("glyph") then
+--~ local c = n.char
+--~ local f = fonts.ids[n.font]
+--~ if f then
+--~ local u = f.characters[c].tounicode
+--~ if u then
+--~ for s in string.gmatch(u,"..") do
+--~ t[#t+1] = utf.char(tonumber(s,16))
+--~ end
+--~ else
+--~ t[#t+1] = utf.char(c)
+--~ end
+--~ else
+--~ t[#t+1] = utf.char(c)
+--~ end
+--~ elseif id == node.id("glue") then
+--~ t[#t+1] = " "
+--~ end
+--~ end
+--~ return table.concat(t,"")
+--~ end
+--~ print(nodes.toutf(tex.box[999].list))
diff --git a/Master/texmf-dist/tex/context/base/strc-bkm.mkiv b/Master/texmf-dist/tex/context/base/strc-bkm.mkiv
index 9298a9d8ef6..77854738d2f 100644
--- a/Master/texmf-dist/tex/context/base/strc-bkm.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-bkm.mkiv
@@ -55,7 +55,7 @@
%D Placement \unknown\ look how simple compared to \MKII:
-\def\placebookmarks
+\unexpanded\def\placebookmarks
{\dodoubleempty\doplacebookmarks}
\def\doplacebookmarks[#1][#2]%
@@ -67,7 +67,8 @@
\fi
\fi}
-\appendtoks\ctxlua{structure.bookmarks.place()}\to\everystoptext
+% \prependtoks\ctxlua{structure.bookmarks.place()}\to\everystoptext % too late
+% \prependtoks\ctxlua{structure.bookmarks.place()}\to\everylastbackendshipout % okay but not nice
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/strc-blk.lua b/Master/texmf-dist/tex/context/base/strc-blk.lua
index 33dbb0b7ce8..2589190eb5c 100644
--- a/Master/texmf-dist/tex/context/base/strc-blk.lua
+++ b/Master/texmf-dist/tex/context/base/strc-blk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc--blk'] = {
version = 1.001,
- comment = "companion to strc--blk.mkiv",
+ comment = "companion to strc-blk.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['strc--blk'] = {
-- this one runs on top of buffers and structure
-local texprint, format, gmatch = tex.print, string.format, string.gmatch
+local texprint, format, gmatch, find = tex.print, string.format, string.gmatch, string.find
+local lpegmatch = lpeg.match
local ctxcatcodes = tex.ctxcatcodes
@@ -29,7 +30,7 @@ end
job.register('structure.blocks.collected', structure.blocks.tobesaved, initializer)
-local printer = (lpeg.linebyline/texprint)^0
+local printer = (lpeg.patterns.textline/texprint)^0 -- can be shared
function blocks.print(name,data,hide)
if hide then
@@ -42,7 +43,7 @@ function blocks.print(name,data,hide)
texprint(data[i])
end
else
- printer:match(data)
+ lpegmatch(printer,data)
end
if hide then
texprint(ctxcatcodes,"\\dostophiddenblock")
@@ -65,7 +66,7 @@ function blocks.setstate(state,name,tag)
elseif all then
sn.all = state
else
- for _, tag in pairs(tags) do
+ for _, tag in next, tags do
sn[tag] = state
end
end
@@ -76,7 +77,7 @@ end
function blocks.select(state,name,tag,criterium)
criterium = criterium or "text"
- if tag:find("=") then tag = "" end
+ if find(tag,"=") then tag = "" end
local names = aux.settings_to_set(name)
local all = tag == ""
local tags = not all and aux.settings_to_set(tag)
@@ -91,7 +92,7 @@ function blocks.select(state,name,tag,criterium)
blocks.print(name,ri.data,hide)
else
local mtags = metadata.tags
- for tag, sta in pairs(tags) do
+ for tag, sta in next, tags do
if mtags[tag] then
blocks.print(name,ri.data,hide)
break
@@ -129,7 +130,7 @@ function blocks.save(name,tag,buffer) -- wrong, not yet adapted
end
else
local sn = states[name]
- for tag, _ in pairs(tags) do
+ for tag, _ in next, tags do
if sn[tag] == nil then
if allstate ~= "hide" then
blocks.print(name,data)
diff --git a/Master/texmf-dist/tex/context/base/strc-blk.mkiv b/Master/texmf-dist/tex/context/base/strc-blk.mkiv
index 90d2ff9ab05..8aa8568407f 100644
--- a/Master/texmf-dist/tex/context/base/strc-blk.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-blk.mkiv
@@ -25,15 +25,15 @@
\def\blockparameter#1#2{\ifcsname\??tb#1#2\endcsname\csname\??tb#1#2\endcsname\fi}
-\def\setupblockparameters{\dodoubleargument \dosetupblock} % fast one (for compatibility)
-\def\setupblock {\dodoubleargumentwithset\dosetupblock} % handles set
+\unexpanded\def\setupblockparameters{\dodoubleargument \dosetupblock} % fast one (for compatibility)
+\unexpanded\def\setupblock {\dodoubleargumentwithset\dosetupblock} % handles set
\def\dosetupblock[#1]{\getparameters[\??tb#1]} % [#1][#2]}
-\def\defineblock
- {\dosingleargument\dodefineblock}
+\unexpanded\def\defineblock[#1]%
+ {\processcommalist[#1]\dodefineblock}
-\def\dodefineblock[#1]%
+\def\dodefineblock#1%
{\getparameters
[\??tb#1]
[\c!before=\blank,
@@ -59,11 +59,13 @@
% order matters: \c!before (think of: \c!before=\startitemize)
+% no \endgroups
+
\let\doblocksetups\gobbleoneargument
\def\dostartnormalblock#1% name
{\bgroup
-\visibletrue
+ \visibletrue
\edef\currentblock{#1}%
\doblocksetups\currentblock
\let\doblocksetups\gobbleoneargument
@@ -83,7 +85,7 @@
{\ctxlua{structure.blocks.setstate("#1","#2","#3")}}
\def\doselectblocks[#1][#2][#3][#4]% state name tag setups
- {\begingroup
+ {\bgroup
\doifassignmentelse{#3}
{\getparameters[\??tb\??tb][\c!criterium=\v!text,#3]%
\def\doblocksetups##1{\getparameters[\??tb##1][#3]}%
@@ -91,7 +93,7 @@
{\getparameters[\??tb\??tb][\c!criterium=\v!text,#4]%
\def\doblocksetups##1{\getparameters[\??tb##1][#4]}%
\ctxlua{structure.blocks.select("#1","#2","#3","\@@tb@@tbcriterium")}}%
- \endgroup}
+ \egroup}
% hide: save, if [+] also hidden execute
% keep: save and normal execute
diff --git a/Master/texmf-dist/tex/context/base/strc-def.mkiv b/Master/texmf-dist/tex/context/base/strc-def.mkiv
index 2395ddf6c67..77793c7eb7e 100644
--- a/Master/texmf-dist/tex/context/base/strc-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-def.mkiv
@@ -76,8 +76,11 @@
%\c!margintext=,
\c!number=\v!yes,
\c!numbercolor=\structureheadparameter\c!color,
- %\c!numbercommand=,
+ \c!textcolor=\structureheadparameter\c!color,
\c!numberstyle=\structureheadparameter\c!style,
+ \c!textstyle=\structureheadparameter\c!style,
+ %\c!numbercommand=,
+ %\c!textcommand=,
\c!ownnumber=\v!no,
%\c!page=,
\c!placehead=\v!yes,
@@ -86,13 +89,12 @@
%\c!sectionsegments=,
\c!sectionseparatorset=\s!default,
\c!sectionset=\v!all,
+ \c!interlinespace=,
%\c!sectionstopper=,
+ %\c!sectionstarter=,
%\c!strut=,
%\c!style=,
%\c!text=,
- \c!textcolor=\structureheadparameter\c!color,
- %\c!textcommand=,
- \c!textstyle=\structureheadparameter\c!style,
%\c!tolerance=
]
@@ -109,17 +111,18 @@
\definestructureseparatorset [\s!default] [] [.]
\definestructureconversionset [\s!default] [] [numbers]
-\definestructureresetset [\s!default] [] [1]
+\definestructureresetset [\s!default] [] [1] % each level
\definestructureprefixset [\s!default] [section-1,section-2,section-3] []
\definestructureprefixset [\v!all] [section-1,section-2,section-3,section-4,section-5,section-6,section-7,section-8] []
+\definestructureprefixset [\v!none] [] []
\definestructureprefixset [\v!part] [section-1] []
\definestructureprefixset [\v!chapter] [section-2] []
\definestructureseparatorset [\v!appendix:\s!default] [] [.]
\definestructureconversionset [\v!appendix:\s!default] [Romannumerals,Characters] [numbers]
-\definestructureresetset [\v!appendix:\s!default] [] [0]
+\definestructureresetset [\v!appendix:\s!default] [] [1] % why was this 0
% \definesectionblock
@@ -285,14 +288,14 @@
\setuplist
[\v!part]
- [\c!before={\blank\page[\v!preference]},
+ [\c!before={\blank[\v!preference,\v!big]}, % sort of mkii compatible, watch columns
\c!after=\blank,
\c!label=\v!yes,
\c!distance=1em]
\setuplist
[\v!chapter]
- [\c!before={\blank\page[\v!preference]},
+ [\c!before={\blank[\v!preference,\v!big]}, % sort of mkii compatible, watch columns
\c!after=]
\setuplist [\v!part] [\c!width=0em]
diff --git a/Master/texmf-dist/tex/context/base/strc-des.lua b/Master/texmf-dist/tex/context/base/strc-des.lua
index 0d548e61f44..ee5fe702b7f 100644
--- a/Master/texmf-dist/tex/context/base/strc-des.lua
+++ b/Master/texmf-dist/tex/context/base/strc-des.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-des'] = {
version = 1.001,
- comment = "companion to strc-des.tex",
+ comment = "companion to strc-des.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/strc-des.mkiv b/Master/texmf-dist/tex/context/base/strc-des.mkiv
index 2c3a0d6416c..29e4ea36c80 100644
--- a/Master/texmf-dist/tex/context/base/strc-des.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-des.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=strc-blk,
+%D [ file=strc-des,
%D version=2008.10.20,
%D title=\CONTEXT\ Structure Macros,
%D subtitle=Descriptions,
@@ -21,19 +21,30 @@
%D
%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 \defineenumeration[two] [one] % clone one
+%D \defineenumeration[three] [counter=one,style=slanted] % only use counter of one
+%D \defineenumeration[four] [three] % clone three
+%D \defineenumeration[five] [three] [counter=five] % clone three and use own counter
+%D \defineenumeration[six] [three] [counter=four] % clone tree and use counter four (undefined)
%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 \startone test test 6 \stopone
+%D \starttwo test test 7 \stoptwo
+%D \startthree test test 8 \stopthree
+%D \startfour test test 9 \stopfour
+%D \startfive test test 2 \stopfive
+%D \startsix test test 10 \stopsix
%D \stopbuffer
%D
%D \typebuffer \start \getbuffer \stop
+%D
+%D \starttyping
+%D \setupenumerations[one] [prefix=yes,prefixsegments=section]
+%D \setupenumerations[two] [prefix=yes,prefixsegments=section]
+%D \setupenumerations[three][prefix=yes,prefixsegments=section]
+%D \setupenumerations[four] [prefix=yes,prefixsegments=chapter:section]
+%D \setupenumerations[five] [prefix=yes,prefixsegments=chapter:section]
+%D \setupenumerations[six] [prefix=yes,prefixsegments=chapter:section]
+%D \stoptyping
% list and titles are experimental
%
@@ -67,6 +78,17 @@
\def\dodescriptionparentparameter#1#2%
{\ifx#1\relax\s!empty\else\dodescriptionparameter#1#2\fi}
+\def\descriptionlocationparameter#1{\csname\dodescriptionlocationparameter{\??dd\currentdescription}#1\endcsname}
+
+\def\dodescriptionlocationparameter#1#2%
+ {\ifcsname#1#2:\descriptionparameter\c!location\endcsname
+ #1#2:\descriptionparameter\c!location
+ \else\ifcsname#1\s!parent\endcsname
+ \expandafter\dodescriptionlocationparameter\csname#1\s!parent\endcsname#2%
+ \else
+ \dodescriptionparameter{\??dd\currentdescription}#2%
+ \fi\fi}
+
% description hashes (needed for style/color)
\def\descriptionparameterhash #1{\dodescriptionparameterhash{\??dd\currentdescription }#1}
@@ -136,17 +158,17 @@
\noindent
\llap
{\@@makedescriptionpurebox\raggedright
- \hbox to \descriptionparameter\c!width{\copy\descriptionheadbox\hss}%
- \hskip\descriptionparameter\c!distance}%
+ \hbox to \descriptionsheadwidth{\copy\descriptionheadbox\hss}%
+ \hskip\descriptionsheaddistance}%
\@@dodescription}
\def\@@descriptionrightmargin % whatever this means
{\def\\{\crlf}%
\noindent
\rlap
- {\hskip\descriptionparameter\c!distance
+ {\hskip\descriptionsheaddistance
\@@makedescriptionpurebox\raggedright
- \hbox to \descriptionparameter\c!width{\copy\descriptionheadbox\hss}}%
+ \hbox to \descriptionsheadwidth{\copy\descriptionheadbox\hss}}%
\@@dodescription}
\def\@@makedescriptionpurebox#1%
@@ -155,7 +177,7 @@
\hsize\descriptionsheadwidth
\leftskip\zeropoint
\rightskip\zeropoint
- #1\setupalign[\descriptionparameter\c!align]%
+ #1\setupalign[\descriptionparameter\c!headalign]%
\ifhbox\descriptionheadbox\unhcopy\else\copy\fi\descriptionheadbox}%
\ht\descriptionheadbox\strutht
\dp\descriptionheadbox\strutdp}
@@ -191,7 +213,7 @@
{\forgetall
\dontcomplain
\hsize\descriptionsheadwidth
- #1\setupalign[\descriptionparameter\c!align]#2%
+ #1\setupalign[\descriptionparameter\c!headalign]#2%
\ifhbox\descriptionheadbox\unhcopy\else\copy\fi\descriptionheadbox}%
\ht\descriptionheadbox\strutht
\dp\descriptionheadbox\strutdp
@@ -256,7 +278,7 @@
\setvalue{@@description\v!serried}%
{\processaction
- [\descriptionparameter\c!width]
+ [\descriptionlocationparameter\c!width]
[ \v!fit=>\let\next\v!fit,
\v!broad=>\let\next\v!broad,
\s!unknown=>\let\next\v!wide,
@@ -309,35 +331,31 @@
\begingroup
\doadaptleftskip{\descriptionparameter\c!margin}%
\showcomposition
- \descriptionsheaddistance\descriptionparameter\c!distance\relax
+ \setlocalhsize % so we can use \localhsize in width assignments
+ \descriptionsheaddistance\descriptionlocationparameter\c!distance\relax
\ifdim\descriptionsheaddistance=\zeropoint\relax
- \doif{\descriptionparameter\c!width}\v!broad{\descriptionsheaddistance=1em}%
+ \doif{\descriptionlocationparameter\c!width}\v!broad{\descriptionsheaddistance=1em}%
\fi
\setbox\descriptionheadbox\hbox
{\forgetall\dontcomplain
\trialtypesettingtrue
\doifelsenothing{\descriptionparameter\c!sample}
- {\dodescriptionhandler
- {\begstrut\descriptionparameter\c!text\ignorespaces\currentdescriptiontext\endstrut}}%
- {\dodescriptionhandler
- {\begstrut\descriptionparameter\c!text\descriptionparameter\c!sample\endstrut}}}%
+ {\dodescriptionhandler\currentdescriptiontext}%
+ {\dodescriptionhandler\currentdescriptionsample}}%
\assignwidth
\descriptionsheadwidth
- {\descriptionparameter\c!width}
+ {\descriptionlocationparameter\c!width}
{\unhcopy\descriptionheadbox}
\descriptionsheaddistance
\setbox\descriptionheadbox\hbox
{\forgetall\dontcomplain
\doifelse{\descriptionparameter\c!location}\v!serried % brrr, hack
- {\dodescriptionhandler
- {\begstrut\descriptionparameter\c!text\currentdescriptiontext\endstrut}}
- {\dodescriptionhandler
- {\vtop
- {\hsize\dimexpr\descriptionsheadwidth-\descriptionsheaddistance\relax
- \begstrut\descriptionparameter\c!text\ignorespaces\currentdescriptiontext\endstrut}}}}%
+ {\dodescriptionhandler\currentdescriptiontext}
+ {\dodescriptionhandler{\boxeddescriptionhead\currentdescriptiontext}}}%
\doifelse{\descriptionparameter\c!aligntitle}\v!no
{\leftdescriptionskip\leftskip\rightdescriptionskip\rightskip}
{\ifcase\nesteddescriptionstate\leftdescriptionskip\leftskip\rightdescriptionskip\rightskip\fi}%
+ \doifsomething{\descriptionparameter\c!align}{\setupalign[\descriptionparameter\c!align]}%
\normalexpanded{\noexpand\indenting[\descriptionparameter\c!indenting]}%
% better a system mode
\ifcase\nesteddescriptionstate
@@ -347,6 +365,13 @@
\fi % now happens elsewhere : \noindent\ignorespaces
\@@resetdescriptionclosesymbol}
+\def\boxeddescriptionhead#1%
+ {\vtop
+ %{\hsize\dimexpr\descriptionsheadwidth-\descriptionsheaddistance\relax
+ {\hsize\descriptionsheadwidth
+ \doifsomething{\descriptionparameter\c!headalign}{\setupalign[\descriptionparameter\c!headalign]}%
+ #1}}
+
\def\@@stopdescription
{\@@placedescriptionclosesymbol
\par % else we loose
@@ -399,10 +424,11 @@
\csname @@description\currentdescriptionlocation\endcsname} % args not needed
\def\@@makedescription[#1]#2%
- {\postponenotes % new, assumes grouping
- \doenumerationcheckconditions
- \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#2},\c!bookmark=,][]%
- \@@dostartdescriptionindeed}
+ {\postponenotes % new, assumes grouping
+ \edef\currentdescriptionreference{#1}%
+ \doenumerationcheckconditions
+ \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#2},\c!bookmark=,\c!list=][]%
+ \@@dostartdescriptionindeed}
\def\dostartstoreddescription
{\@@dostartdescriptionindeed}
@@ -418,7 +444,7 @@
% setup descriptions
-\def\setupdescriptions
+\unexpanded\def\setupdescriptions
{\dodoubleempty\dosetupdescriptions}
\def\dosetupdescriptions[#1][#2]% % beter: \iffirstargument
@@ -433,7 +459,7 @@
% define descriptions
-\def\definedescription
+\unexpanded\def\definedescription
{\dotripleemptywithset\dodefinedescription}
\def\dodefinedescription[#1][#2][#3]% to be simplified cf enumeration
@@ -449,9 +475,9 @@
\fi}
\def\dodefinedescriptioncommands#1#2%
- {\unexpanded\setevalue {#1}{\noexpand\dodescriptioncommand{#1}}%
- \unexpanded\setevalue{\e!start#1}{\noexpand\dodescriptionstart {#1}}%
- \unexpanded\setevalue{\e!stop #1}{\noexpand\dodescriptionstop {#1}}}
+ {\setuevalue {#1}{\noexpand\dodescriptioncommand{#1}}%
+ \setuevalue{\e!start#1}{\noexpand\dodescriptionstart {#1}}%
+ \setuevalue{\e!stop #1}{\noexpand\dodescriptionstop {#1}}}
% handle descriptions
@@ -465,9 +491,14 @@
\def\dodescriptionstart #1{\dodescriptioninit{#1}\dosingleempty\@@startdescription}
\def\dodescriptionstop #1{\dodescriptioninit{#1}\@@stopdescription}
-\def\dodescriptionhandler {\csname\??dd:\descriptionparameter\s!handler:\s!handler \endcsname}
-\def\dohandledescriptiondo {\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!do \endcsname}
-\def\dohandledescriptionstart{\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!start\endcsname}
+\def\dodescriptiontext {\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!text \endcsname}
+\def\dodescriptionnumber {\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!number\endcsname}
+\def\dodescriptionhandler {\csname\??dd:\descriptionparameter\s!handler:\s!handler \endcsname}
+\def\dohandledescriptiondo {\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!do \endcsname}
+\def\dohandledescriptionstart{\csname\??dd:\descriptionparameter\s!handler:\s!handler:\s!start \endcsname}
+
+\def\currentdescriptiontext {\begstrut\dodescriptiontext\endstrut}
+\def\currentdescriptionsample{\begstrut\descriptionparameter\c!text\descriptionparameter\c!sample\endstrut}
% implementation
@@ -476,28 +507,33 @@
\newtoks \everydescription
+\setvalue{\??dd:\v!description:\s!handler:\s!text }{\@@dodescriptiontext}
\setvalue{\??dd:\v!description:\s!handler }{\@@dodescriptionhandler}
\setvalue{\??dd:\v!description:\s!handler:\s!do }{\@@somedescription}
\setvalue{\??dd:\v!description:\s!handler:\s!start}{\@@startsomedescription}
\def\@@dodescriptionhandler#1%
- {\strut
- \dodescriptionheadtext{#1}%
- \iftrialtypesetting \else
+ {\iftrialtypesetting \else
+ \begingroup
\currentdescriptionsynchronize
- \dosetattribute{destination}\currentdescriptionattribute % todo
- \fi}
+ \attribute\destinationattribute\currentdescriptionattribute\relax % todo, whole text
+ \forcecolorhack
+ \endgroup
+ \fi#1}
+
+\def\@@dododescriptiontext
+ {\ctxlua{structure.lists.savedtitle("\currentdescriptionmain",\currentdescriptionnumberentry)}}
-\def\dodescriptionheadtext#1% title
+\def\@@dodescriptiontext
{\begingroup
\dosetdescriptionattributes\c!headstyle\c!headcolor
\the\everydescription
- \descriptionparameter\c!command{\strut#1}% probably incomplete
+ \descriptionparameter\c!command{\strut\descriptionparameter\c!text\ignorespaces\@@dododescriptiontext}% probably incomplete
\endgroup}
% setup enumerations
-\def\setupenumerations
+\unexpanded\def\setupenumerations
{\dodoubleempty\dosetupenumerations}
\def\dodosetupenumerations[#1][#2]%
@@ -514,7 +550,7 @@
% define enumerations
-\def\defineenumeration
+\unexpanded\def\defineenumeration
{\dotripleemptywithset\dodefineenumeration}
\def\dodefineenumeration[#1][#2][#3]% #2 or #3 assignment
@@ -529,13 +565,13 @@
{\normalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel\v!sub}{\??dd\@@subslevel#1}}%
\edef\@@subslevel{\@@subslevel\v!sub}}%
\else % clone
- \getparameters[\??dd#1][\s!counter=#2,#3]%
+ \getparameters[\??dd#1][\s!parent=\??dd#2,#3]%
\let\@@subslevel\empty
\dorecurse{\descriptionparameter\c!levels}
{\normalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel}{\??dd\@@subslevel#2}}%
\edef\@@subslevel{\@@subslevel\v!sub}}%
\fi
- \edef\currentdescriptioncounter{\descriptionparameter\c!number}%
+ \edef\currentdescriptioncounter{\descriptionparameter\s!counter}%
\ifx\currentdescriptioncounter\empty
\ifdone\dodefineenumerationcounter{#1}\fi
\else\ifx\currentdescriptioncounter\v!yes
@@ -544,8 +580,10 @@
\ifdone\dodefineenumerationcounter{#1}\fi
\else
\letvalue{\??dd#1\s!counter}\currentdescriptioncounter % ?
+ %[[#1:\currentdescriptioncounter]]
\doifstructurecounterelse{\currentdescriptioncounter}{}{\dodefineenumerationcounter\currentdescriptioncounter}%
- \fi\fi\fi}
+ \fi\fi\fi
+ \dosetupenumerationcounter{#1}} % new
\newtoks\everysetupenumerationcounter
\let\currentenumerationcountername\empty
@@ -565,9 +603,9 @@
\def\dodefineenumerationcommands#1#2#3#4% since we use \currentdescription, we need an edef
{\setevalue{\??dd#3#1\s!parent}{#4}%
- \unexpanded\setevalue {#3#1}{\noexpand\doenumerationcommand{#1}{#2}{#3}}%
- \unexpanded\setevalue{\e!start#3#1}{\noexpand\doenumerationstart {#1}{#2}{#3}}%
- \unexpanded\setevalue{\e!stop #3#1}{\noexpand\doenumerationstop {#1}{#2}{#3}}}
+ \setuevalue {#3#1}{\noexpand\doenumerationcommand{#1}{#2}{#3}}%
+ \setuevalue{\e!start#3#1}{\noexpand\doenumerationstart {#1}{#2}{#3}}%
+ \setuevalue{\e!stop #3#1}{\noexpand\doenumerationstop {#1}{#2}{#3}}}
% handle enumeration
@@ -592,98 +630,96 @@
\newtoks \everyenumeration
\newconditional\enumerationnumberenabled
-\chardef \enumerationcouplingmode \zerocount
\def \enumerationdisablenumbersignal {-}
\appendtoks \disablepseudocaps \to \everyenumeration % sorry, uppercase causes troubles
-\letvalue{\??dd:\c!couplingway:\v!local }\plusone
-\letvalue{\??dd:\c!couplingway:\v!global}\plustwo
+\setvalue{\??dd:\v!enumeration:\s!handler:\s!number}{\@@doenumerationnumber}
+\setvalue{\??dd:\v!enumeration:\s!handler:\s!text }{\@@doenumerationtext}
+\setvalue{\??dd:\v!enumeration:\s!handler }{\@@doenumerationhandler}
+\setvalue{\??dd:\v!enumeration:\s!handler:\s!do }{\@@somedescription}
+\setvalue{\??dd:\v!enumeration:\s!handler:\s!start }{\@@startsomedescription}
-\setvalue{\??dd:\v!enumeration:\s!handler }{\@@doenumerationhandler}
-\setvalue{\??dd:\v!enumeration:\s!handler:\s!do }{\@@somedescription}
-\setvalue{\??dd:\v!enumeration:\s!handler:\s!start}{\@@startsomedescription}
+\let\@@doenumerationhandler\@@dodescriptionhandler
-\def\@@doenumerationhandler#1%
- {\strut
- \ifconditional\enumerationnumberenabled
+% \def\currentenumerationfullnumber
+% {\ctxlua{structure.lists.savedprefixednumber("\currentdescriptionmain",\currentdescriptionnumberentry)}}
+
+\def\@@doenumerationnumber
+ {\ctxlua{structure.lists.savedprefixednumber("\currentdescriptionmain",\currentdescriptionnumberentry)}}
+
+\def\@@dodoenumerationtext
+ {\ctxlua{structure.lists.savedtitle("\currentdescriptionmain",\currentdescriptionnumberentry)}}
+
+\def\doenumerationnumber
+ {\descriptionparameter\c!left
+ \descriptionparameter\c!starter
+ \dodescriptionnumber
+ \descriptionparameter\c!stopper
+ \descriptionparameter\c!right}
+
+\def\@@doenumerationtext
+ {\ifconditional\enumerationnumberenabled
\iftrialtypesetting
- \doenumerationfullnumber\showdntext{#1}%
+ \doenumerationfullnumber\showdntext
\doenumerationcouplingsymbol
\else
\doenumerationregistercoupling
- \doenumerationfullnumber\showdntext{#1}%
+ \doenumerationfullnumber\showdntext
\doenumerationcouplingsymbol
\fi
\else
- \doenumerationfullnumber\showdnpuretext{#1}%
- \fi
- \iftrialtypesetting \else
- \currentdescriptionsynchronize
- \dosetattribute{destination}\currentdescriptionattribute % todo
+ \doenumerationfullnumber\showdnpuretext
\fi}
+\def\doenumerationfullnumber#1% text, title
+ {\begingroup
+ \dosetdescriptionattributes\c!headstyle\c!headcolor
+ \the\everyenumeration
+ \descriptionparameter\c!command{\strut#1\doenumerationnumber\doenumerationextratext}%
+ \endgroup}
+
+\def\doenumerationextratext
+ {\doif{\descriptionparameter\c!title}\v!yes
+ {\begingroup
+ \dosetdescriptionattributes\c!titlestyle\c!titlecolor
+ \hskip\descriptionparameter\c!titledistance
+ \descriptionparameter\c!titlecommand
+ {\descriptionparameter\c!titleleft
+ \begstrut\@@dodoenumerationtext\endstrut
+ \descriptionparameter\c!titleright}%
+ \endgroup}}
+
\def\doenumerationsavecounter {\savestructurecounter[\currentdescriptionnumber]}
\def\doenumerationrestorecounter {\restorestructurecounter[\currentdescriptionnumber]}
\def\doenumerationincrementcounter{\doincrementsubstructurecounter[\currentdescriptionnumber][\currentdescriptionlevel]}
+% to be used in for instance:
+%
+% coupling=questions .... coupling=answers
+%
+% we will provide some more control, like skipping etc or reference relates
+
\def\doenumerationcheckconditions
{\doifelse{\descriptionparameter\c!number}\v!yes
{\ifx\currentdescriptionreference\enumerationdisablenumbersignal
\setfalse\enumerationnumberenabled \else \settrue\enumerationnumberenabled
\fi}%
{\setfalse\enumerationnumberenabled}%
- \chardef\enumerationcouplingmode \iflocation
- \executeifdefined{\??dd:\c!couplingway:\descriptionparameter\c!coupling}\zerocount
- \else
- \zerocount
- \fi}
+ \edef\currentenumerationcoupling{\descriptionparameter\c!coupling}}
\def\doenumerationregistercoupling
{\iflocation
- \ifcase\enumerationcouplingmode
- \or
- % todo
- \or
- % todo
- \fi
+ % no area yet, we will provide variants some day
\fi}
\def\doenumerationcouplingsymbol
- {\iflocation\ifcase\enumerationcouplingmode \else
- % todo
- \fi\fi}
-
-\def\currentdescriptiontext
- {\ctxlua{structure.lists.savedtitle("\currentdescriptionmain",\currentdescriptionnumberentry)}}
+ {\iflocation \ifx\currentenumerationcoupling\empty\else
+ \symbolreference[order(description:\currentenumerationcoupling:\nextinternalorderreference)]%
+ \fi \fi}
-\def\currentenumerationfullnumber
- {\ctxlua{structure.lists.savednumber("\currentdescriptionmain",\currentdescriptionnumberentry)}}
-
-\def\doenumerationfullnumber#1#2% text, title
- {\begingroup
- \dosetdescriptionattributes\c!headstyle\c!headcolor
- \the\everyenumeration
- \descriptionparameter\c!command
- {\strut
- #1%
- \descriptionparameter\c!left
- \currentenumerationfullnumber
- % save cq. treat expansion etc
- \doiftext{#2} % always true anyway
- {\doif{\descriptionparameter\c!title}\v!yes
- {\begingroup
- \dosetdescriptionattributes\c!titlestyle\c!titlecolor
- \hskip\descriptionparameter\c!titledistance
- \descriptionparameter\c!titlecommand
- {\descriptionparameter\c!titleleft
- \begstrut#2\endstrut
- \descriptionparameter\c!titleright}%
- \endgroup}}%
- %
- \descriptionparameter\c!stopper
- \descriptionparameter\c!right}%
- \endgroup}
+\def\skipenumerationcoupling[#1]% e.g. for questions with no answer
+ {\ctxlua{jobreferences.setnextorder("description","#1")}}
\def\showdnpuretext{\strut\descriptionparameter\c!text} % geen spatie
\def\showdnlisttext{\descriptionparameter\c!listtext} % space in default
@@ -720,29 +756,59 @@
\def\dododescriptioncomponent[#1][#2]% #1=interfaced-settings, #2=optional user data
{\begingroup % similar to structure so we might generalize this
\getparameters[\??dd\currentdescription][#1]%
- \edef\currentdescriptionexpansion{\descriptionparameter\c!expansion}%
+ %
+ \xdef\currentdescriptionexpansion {\descriptionparameter\c!expansion}%
+ \xdef\currentdescriptionxmlsetup {\descriptionparameter\c!xmlsetup}%
+ \xdef\currentdescriptioncatcodes {\descriptionparameter\s!catcodes}%
+ \xdef\currentdescriptionlabel {\descriptionparameter\c!label}%
+ \xdef\currentdescriptionreference {\descriptionparameter\c!reference}%
+ \xdef\currentdescriptionreferenceprefix{\descriptionparameter\c!referenceprefix}%
+ %xdef\currentdescriptionshownumber {\descriptionparameter\c!number}%
+ \xdef\currentdescriptionsaveinlist {\descriptionparameter\c!saveinlist}%
+ \xdef\currentdescriptionincrementnumber{\descriptionparameter\c!incrementnumber}%
+ %
+ \ifx\currentdescriptionexpansion\empty
+ \glet\currentdescriptionexpansion\v!no
+ \fi
+ %
\ifx\currentdescriptionexpansion\s!xml
- \xdef\currentdescriptiontitle {\detokenizeddescriptionparameter\c!title}%
- \xdef\currentdescriptionbookmark{\detokenizeddescriptionparameter\c!bookmark}%
\xmlstartraw
- \xdef\currentdescriptionlisttitle {\descriptionparameter\c!title}%
+ \xdef\currentdescriptiontitle {\descriptionparameter\c!title}%
+ \xdef\currentdescriptionbookmark{\descriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\descriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\descriptionparameter\c!list}%
\xmlstopraw
+ \ifx\currentdescriptionlist\empty
+ \globallet\currentdescriptionlist\currentdescriptiontitle
+ \fi
\globallet\currentdescriptioncoding\s!xml
\else
\ifx\currentdescriptionexpansion\v!yes
\xdef\currentdescriptiontitle {\descriptionparameter\c!title}%
\xdef\currentdescriptionbookmark{\descriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\descriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\descriptionparameter\c!list}%
\else
\xdef\currentdescriptiontitle {\detokenizeddescriptionparameter\c!title}%
\xdef\currentdescriptionbookmark{\detokenizeddescriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\detokenizeddescriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\detokenizeddescriptionparameter\c!list}%
+ \iflocation \ifx\currentdescriptionbookmark\empty
+ \begingroup
+ \simplifycommands
+ \xdef\currentdescriptionbookmark{\detokenize\expandafter{\normalexpanded{\descriptionparameter\c!title}}}%
+ \endgroup
+ \fi \fi
+ \fi
+ \ifx\currentdescriptionlist\empty
+ \globallet\currentdescriptionlist\currentdescriptiontitle
\fi
- \globallet\currentdescriptionlisttitle \currentdescriptiontitle
\globallet\currentdescriptioncoding\s!tex
\fi
- \xdef\currentdescriptionlabel {\descriptionparameter\c!label}%
- \xdef\currentdescriptionreference{\descriptionparameter\c!reference}%
%
- \doif{\descriptionparameter\c!title}\v!none{\global\nodescriptioncaptiontrue\global\nodescriptionnumbertrue}% will become obsolete
+ \ifx\currentdescriptiontitle\v!none % will become obsolete
+ \global\nodescriptioncaptiontrue\global\nodescriptionnumbertrue
+ \fi
%
\ifconditional\enumerationnumberenabled
\doifelsedescriptioncomponent\donothing\doenumerationincrementcounter
@@ -753,16 +819,19 @@
\glet\currentdescriptionsynchronize\relax
\glet\currentdescriptionattribute \relax
\else
- \setnextinternalreference
+ %\setnextinternalreference
+ \setnextinternalreferences{description}\currentdescriptionname % plural
\xdef\currentdescriptionnumberentry{\ctxlua{structure.lists.push{
metadata = {
kind = "description",
name = "\currentdescriptionname",
level = structure.sections.currentlevel(),
catcodes = \the\catcodetable,
+ % \currentdirectionparameters
},
references = {
internal = \nextinternalreference,
+ order = \nextinternalorderreference,
reference = "\currentdescriptionreference",
referenceprefix = "\referenceprefix",
block = "\currentstructureblock",
@@ -774,8 +843,8 @@
\ifx\currentdescriptionbookmark\currentdescriptiontitle \else
bookmark = \!!bs\detokenize\expandafter{\currentdescriptionbookmark}\!!es,
\fi
- \ifx\currentdescriptionlisttitle\currentdescriptiontitle \else % \ifx\currentdescriptionsaveinlist\v!no
- list = \!!bs\detokenize\expandafter{\currentdescriptionlisttitle }\!!es,
+ \ifx\currentdescriptionlist\currentdescriptiontitle \else % \ifx\currentdescriptionsaveinlist\v!no
+ list = \!!bs\detokenize\expandafter{\currentdescriptionlist }\!!es,
\fi % \fi
},
\ifconditional\enumerationnumberenabled
@@ -789,10 +858,11 @@
connector = \!!bs\descriptionparameter\c!prefixconnector\!!es,
},
numberdata = {
- numbers = structure.counters.compact("\currentdescriptionname",nil,true),
+ numbers = structure.counters.compact("\currentdescriptionnumber",nil,true), % ! number can be cloned
separatorset = "\descriptionparameter\c!numberseparatorset",
conversion = "\descriptionparameter\c!numberconversion",
conversionset = "\descriptionparameter\c!numberconversionset",
+ starter = \!!bs\descriptionparameter\c!numberstarter\!!es,
stopper = \!!bs\descriptionparameter\c!numberstopper\!!es,
segments = "\descriptionparameter\c!numbersegments",
},
@@ -800,11 +870,19 @@
userdata = structure.helpers.touserdata(\!!bs\detokenize{#2}\!!es)
}
}}%
- \xdef\currentdescriptionattribute {\ctxlua {tex.write(jobreferences.setinternalreference("\referenceprefix","\currentdescriptionreference",\nextinternalreference,"\@@iafocus"))}}%
- \xdef\currentdescriptionsynchronize{\ctxlatelua{structure.lists.enhance(\currentdescriptionnumberentry)}}%
+ \xdef\currentdescriptionattribute {\ctxlua {tex.write(jobreferences.setinternalreference("\referenceprefix","\currentdescriptionreference",\nextinternalreference,"\@@iafocus"))}}%
+ \xdef\currentdescriptionsynchronize{\ctxlatelua{structure.lists.enhance(\currentdescriptionnumberentry)}}%
\fi
\endgroup}
+% This is not so nice, some day i'll just store the number with the entry
+% and deal with all at the Lua end, but first we need to be able to set
+% macros.
+
+\def\reinstatedescriptionnumberentry#1%
+ {\xdef\currentdescriptionattribute {\ctxlua {tex.write(jobreferences.getinternalreference(#1))}}%
+ \xdef\currentdescriptionsynchronize{\ctxlatelua{structure.lists.enhance(#1)}}}
+
\installstructurelistprocessor{description}{\usestructurelistprocessor{number+title}}
% labels, we could share with enumerations and forget about the text; anyhow, figure
@@ -814,10 +892,10 @@
% unfinished
-\def\setuplabels
+\unexpanded\def\setuplabels
{\getparameters[\??db]}
-\def\definelabel
+\unexpanded\def\definelabel
{\dotripleargumentwithset\dodefinelabel}
\def\dodefinelabel[#1][#2][#3]% #2 or #3 assignment
@@ -835,12 +913,12 @@
\fi}
\def\dodefinelabelcommands#1#2%
- {\unexpanded\setevalue {#1}{\noexpand\dolabelnumbercommand {#1}}%
- \unexpanded\setevalue{\c!reset #1}{\noexpand\doresetlabelnumber {#1}}%
- %\unexpanded\setevalue{\c!set #1}{\noexpand\dosetlabelnumber {#1}}% [#2] or {#2} ?
- \unexpanded\setevalue{\e!next #1}{\noexpand\donextlabelnumber {#1}}%
- \unexpanded\setevalue{\e!increment#1}{\noexpand\doincrementlabelnumber{#1}}%
- \unexpanded\setevalue{\c!current #1}{\noexpand\docurrentlabelnumber {#1}}}
+ {\setuevalue {#1}{\noexpand\dolabelnumbercommand {#1}}%
+ \setuevalue{\c!reset #1}{\noexpand\doresetlabelnumber {#1}}%
+ %\setuevalue{\c!set #1}{\noexpand\dosetlabelnumber {#1}}% [#2] or {#2} ?
+ \setuevalue{\e!next #1}{\noexpand\donextlabelnumber {#1}}%
+ \setuevalue{\e!increment#1}{\noexpand\doincrementlabelnumber{#1}}%
+ \setuevalue{\c!current #1}{\noexpand\docurrentlabelnumber {#1}}}
% this is just for downward compatibility, we might drop it
@@ -884,7 +962,7 @@
% to be reimplmented
-\def\setupindentations
+\unexpanded\def\setupindentations
{\dodoubleempty\dosetupindentations}
\def\dosetupindentations[#1][#2]%
@@ -897,7 +975,7 @@
\def\dodosetupindentations[#1][#2]%
{\getparameters[\??ds#1][#2]}
-\def\defineindenting
+\unexpanded\def\defineindenting
{\dodoubleargumentwithset\dodefineindenting}
\def\dodefineindenting[#1][#2]%
@@ -905,9 +983,9 @@
[\c!text,\c!separator,\c!width,\c!style,\c!color,
\c!headstyle,\c!sample,\c!before,\c!after,\c!distance]%
\getparameters[\??ds#1][#2]%
- \unexpanded\setvalue {#1}{\dododefineindenting{#1}{0}{1}}%
- \unexpanded\setvalue {\v!sub#1}{\dododefineindenting{#1}{1}{2}}%
- \unexpanded\setvalue{\v!sub\v!sub#1}{\dododefineindenting{#1}{2}{3}}}
+ \setuvalue {#1}{\dododefineindenting{#1}{0}{1}}%
+ \setuvalue {\v!sub#1}{\dododefineindenting{#1}{1}{2}}%
+ \setuvalue{\v!sub\v!sub#1}{\dododefineindenting{#1}{2}{3}}}
\def\dododefineindenting#1#2#3%
{\par
@@ -953,6 +1031,7 @@
\c!hang=,
\c!sample=,
\c!align=,
+ \c!headalign=,
\c!margin=\v!no,
\c!before=\blank,
\c!inbetween=\blank,
@@ -970,12 +1049,35 @@
[\c!location=\v!top,
\c!text=,
\c!way=\v!by\v!text,
+ \c!prefix=\v!no,
\c!prefixconnector=.,
+ \c!starter=,
\c!stopper=,
\c!number=\v!yes, % else description
\c!start=0,
\s!parent=\??dd]
+\setupdescriptions
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
+\setupenumerations
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
+\setupdescriptions
+ [\c!width=7em,
+ \c!distance=1em]
+
+\setupdescriptions[\c!width:\c!top=\localhsize] % undocumented, only width and distance
+% \setupdescriptions[\c!width:\c!left=7em,\c!distance=1em]
+% \setupdescriptions[\c!width:\c!right=7em,\c!distance=1em]
+
+
\setuplabels
[\s!parent=\??dn]
diff --git a/Master/texmf-dist/tex/context/base/strc-doc.lua b/Master/texmf-dist/tex/context/base/strc-doc.lua
index cb279e32065..7faf0d5b393 100644
--- a/Master/texmf-dist/tex/context/base/strc-doc.lua
+++ b/Master/texmf-dist/tex/context/base/strc-doc.lua
@@ -1,21 +1,28 @@
if not modules then modules = { } end modules ['strc-doc'] = {
version = 1.001,
- comment = "companion to strc-doc.tex",
+ comment = "companion to strc-doc.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
+-- todo: associate counter with head
+
+-- we need to freeze and document this module
+
local next, type = next, type
-local format, gsub, find, concat = string.format, string.gsub, string.find, table.concat
+local format, gsub, find, concat, gmatch, match = string.format, string.gsub, string.find, table.concat, string.gmatch, string.match
local texsprint, texwrite = tex.sprint, tex.write
+local concat = table.concat
+local max, min = math.max, math.min
local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
-if not trackers then trackers = { register = function() end } end
+--~ if not trackers then trackers = { register = function() end } end
local trace_sectioning = false trackers.register("structure.sectioning", function(v) trace_sectioning = v end)
+local trace_detail = false trackers.register("structure.detail", function(v) trace_detail = v end)
local function report(...)
--~ print(...)
@@ -58,7 +65,7 @@ function documents.reset()
data.forced = { }
data.ownnumbers = { }
data.status = { }
- data.checkers = { }
+--~ data.checkers = { }
data.depth = 0
end
@@ -130,6 +137,8 @@ storage.register("structure/sections/levelmap", structure.sections.levelmap, "st
sections.verbose = true
+levelmap.block = -1
+
function sections.setlevel(name,level) -- level can be number or parent (=string)
local l = tonumber(level)
if not l then
@@ -157,6 +166,7 @@ function sections.setblock(name)
end
function sections.pushblock(name)
+ structure.counters.check(0) -- we assume sane usage of \page between blocks
local block = name or data.block
data.blocks[#data.blocks+1] = block
data.block = block
@@ -187,15 +197,18 @@ end
function sections.somelevel(given)
-- old number
local numbers, ownnumbers, forced, status, olddepth = data.numbers, data.ownnumbers, data.forced, data.status, data.depth
---~ print("old",olddepth,given.metadata.name,levelmap[given.metadata.name])
- local newdepth = tonumber(levelmap[given.metadata.name] or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
---~ print("new",newdepth)
+ local givenname = given.metadata.name
+ local mappedlevel = levelmap[givenname]
+ local newdepth = tonumber(mappedlevel or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
local directives = given.directives
local resetset = (directives and directives.resetset) or ""
- local resetter = sets.getall("structure:resets",data.block,resetset)
+ -- local resetter = sets.getall("structure:resets",data.block,resetset)
-- a trick to permits userdata to overload title, ownnumber and reference
-- normally these are passed as argument but nowadays we provide several
-- interfaces (we need this because we want to be compatible)
+ if trace_detail then
+ logs.report("structure","name '%s', mapped level '%s', old depth '%s', new depth '%s', reset set '%s'",givenname,mappedlevel,olddepth,newdepth,resetset)
+ end
local u = given.userdata
if u then
-- kind of obsolete as we can pass them directly anyway
@@ -209,7 +222,9 @@ function sections.somelevel(given)
if newdepth > olddepth then
for i=olddepth+1,newdepth do
local s = tonumber(sets.get("structure:resets",data.block,resetset,i))
---~ logs.report("structure >","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
+ if trace_detail then
+ logs.report("structure","new>old (%s>%s), reset set '%s', reset value '%s', current '%s'",olddepth,newdepth,resetset,s or "?",numbers[i] or "?")
+ end
if not s or s == 0 then
numbers[i] = numbers[i] or 0
ownnumbers[i] = ownnumbers[i] or ""
@@ -222,7 +237,9 @@ function sections.somelevel(given)
elseif newdepth < olddepth then
for i=olddepth,newdepth+1,-1 do
local s = tonumber(sets.get("structure:resets",data.block,resetset,i))
---~ logs.report("structure <","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
+ if trace_detail then
+ logs.report("structure","new<old (%s<%s), reset set '%s', reset value '%s', current '%s'",olddepth,newdepth,resetset,s or "?",numbers[i] or "?")
+ end
if not s or s == 0 then
numbers[i] = numbers[i] or 0
ownnumbers[i] = ownnumbers[i] or ""
@@ -233,13 +250,14 @@ function sections.somelevel(given)
status[i] = nil
end
end
+ structure.counters.check(newdepth)
ownnumbers[newdepth] = given.numberdata.ownnumber or ""
given.numberdata.ownnumber = nil
data.depth = newdepth
-- new number
olddepth = newdepth
if given.metadata.increment then
- local oldn, newn = numbers[newdepth], 0
+ local oldn, newn = numbers[newdepth] or 0, 0
local fd = forced[newdepth]
if fd then
if fd[1] == "add" then
@@ -251,21 +269,31 @@ function sections.somelevel(given)
newn = 1 -- maybe zero is nicer
end
forced[newdepth] = nil
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', forced '%s'",olddepth,newdepth,oldn,newn,concat(fd,""))
+ end
elseif newn then
newn = oldn + 1
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', increment",olddepth,newdepth,oldn,newn)
+ end
else
local s = tonumber(sets.get("structure:resets",data.block,resetset,newdepth))
---~ logs.report("structure =","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,","))
- if not s or s == 0 then
+ if not s then
+ newn = oldn or 0
+ elseif s == 0 then
newn = oldn or 0
else
newn = s - 1
end
+ if trace_detail then
+ logs.report("structure","old depth '%s', new depth '%s, old n '%s', new n '%s', reset",olddepth,newdepth,oldn,newn)
+ end
end
numbers[newdepth] = newn
end
status[newdepth] = given or { }
- for k, v in pairs(data.checkers) do
+ for k, v in next, data.checkers do
if v[1] == newdepth and v[2] then
v[2](k)
end
@@ -284,6 +312,9 @@ function sections.somelevel(given)
if #ownnumbers > 0 then
numberdata.ownnumbers = table.fastcopy(ownnumbers)
end
+ if trace_detail then
+ logs.report("structure","name '%s', numbers '%s', own numbers '%s'",givenname,concat(numberdata.numbers, " "),concat(numberdata.ownnumbers, " "))
+ end
given.references.section = sections.save(given)
-- given.numberdata = nil
end
@@ -293,7 +324,7 @@ function sections.writestatus()
local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth
local d = status[depth]
local o = concat(ownnumbers,".",1,depth)
- local n = (numbers and concat(numbers,".",1,depth)) or 0
+ local n = (numbers and concat(numbers,".",1,min(depth,#numbers))) or 0
local l = d.titledata.title or ""
local t = (l ~= "" and l) or d.titledata.title or "[no title]"
local m = d.metadata.name
@@ -310,7 +341,7 @@ end
function sections.setnumber(depth,n)
local forced, depth, new = data.forced, depth or data.depth, tonumber(n)
if type(n) == "string" then
- if n:find("^[%+%-]") then
+ if find(n,"^[%+%-]") then
forced[depth] = { "add", new }
else
forced[depth] = { "set", new }
@@ -324,8 +355,25 @@ function sections.number_at_depth(depth)
return data.numbers[tonumber(depth) or sections.getlevel(depth) or 0] or 0
end
-function sections.getnumber(depth)
- return texwrite(data.numbers[depth] or 0)
+function sections.numbers()
+ return data.numbers
+end
+
+function sections.matching_till_depth(depth,numbers,parentnumbers)
+ local dn = parentnumbers or data.numbers
+ local ok = false
+ for i=1,depth do
+ if dn[i] == numbers[i] then
+ ok = true
+ else
+ return false
+ end
+ end
+ return ok
+end
+
+function sections.getnumber(depth) -- redefined later ...
+ texwrite(data.numbers[depth] or 0)
end
function sections.set(key,value)
@@ -341,7 +389,7 @@ function sections.structuredata(depth,key,default,honorcatcodetable) -- todo: sp
if not depth or depth == 0 then depth = data.depth end
local data = data.status[depth]
local d = data
- for k in key:gmatch("([^.]+)") do
+ for k in gmatch(key,"([^.]+)") do
if type(d) == "table" then
d = d[k]
if not d then
@@ -383,8 +431,8 @@ function sections.userdata(depth,key,default)
end
end
-function sections.setchecker(name,level,command)
- data.checkers[name] = (name and command and level > 0 and { level, command }) or nil
+function sections.setchecker(name,level,command) -- hm, checkers are not saved
+ data.checkers[name] = (name and command and level >= 0 and { level, command }) or nil
end
function sections.current()
@@ -432,16 +480,20 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
local conversionset = ""
local conversion = ""
local stopper = ""
+ local starter = ""
local connector = ""
local set = ""
local segments = ""
local criterium = ""
- for _, data in ipairs { ... } do -- can be multiple parametersets
+ local dataset = { ... }
+ for d=1,#dataset do
+ local data = dataset[d] -- can be multiple parametersets
if data then
if separatorset == "" then separatorset = data.separatorset or "" end
if conversionset == "" then conversionset = data.conversionset or "" end
if conversion == "" then conversion = data.conversion or "" end
if stopper == "" then stopper = data.stopper or "" end
+ if starter == "" then starter = data.starter or "" end
if connector == "" then connector = data.connector or "" end
if set == "" then set = data.set or "" end
if segments == "" then segments = data.segments or "" end
@@ -449,9 +501,10 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
end
end
if separatorset == "" then separatorset = "default" end
- if conversionset == "" then conversionset = "default" end
+ if conversionset == "" then conversionset = "default" end -- not used
if conversion == "" then conversion = nil end
if stopper == "" then stopper = nil end
+ if starter == "" then starter = nil end
if connector == "" then connector = nil end
if set == "" then set = "default" end
if segments == "" then segments = nil end
@@ -466,9 +519,9 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
criterium = 0
end
--
- local firstprefix, lastprefix = 0, 100
+ local firstprefix, lastprefix = 0, 16
if segments then
- local f, l = (tostring(segments)):match("^(.-):(.+)$")
+ local f, l = match(tostring(segments),"^(.-):(.+)$")
if f and l then
-- 0:100, chapter:subsubsection
firstprefix = tonumber(f) or sections.getlevel(f) or 0
@@ -486,12 +539,13 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
if numbers then
local done, preceding = false, false
local function process(index) -- move to outer
+ -- todo: too much (100 steps)
local number = numbers and (numbers[index] or 0)
local ownnumber = ownnumbers and ownnumbers[index] or ""
if number > criterium or (ownnumber ~= "") then
- local block = entry.block
+ local block = (entry.block ~= "" and entry.block) or sections.currentblock() -- added
if preceding then
- local separator = sets.get("structure:separators",b,s,preceding,".")
+ local separator = sets.get("structure:separators",block,separatorset,preceding,".")
if separator then
processors.sprint(ctxcatcodes,separator)
end
@@ -505,7 +559,7 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
-- traditional (e.g. used in itemgroups)
texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",conversion,number))
else
- local theconversion = sets.get("structure:conversions",block,conversion,index,"numbers")
+ local theconversion = sets.get("structure:conversions",block,conversionset,index,"numbers")
processors.sprint(ctxcatcodes,theconversion,function(str)
return format("\\convertnumber{%s}{%s}",str or "numbers",number)
end)
@@ -517,6 +571,9 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
end
--
local prefixlist = set and sets.getall("structure:prefixes","",set) -- "" == block
+ if starter then
+ processors.sprint(ctxcatcodes,starter)
+ end
if prefixlist and (kind == 'section' or kind == 'prefix') then
-- find valid set (problem: for sectionnumber we should pass the level)
-- if kind == "section" then
@@ -587,17 +644,59 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref
processors.sprint(ctxcatcodes,stopper)
end
else
- report("error: no numbers")
+ -- report("error: no numbers")
end
end
end
-function sections.fullnumber(depth)
+function sections.title()
+ local sc = sections.current()
+ if sc then
+ helpers.title(sc.titledata.title,sc.metadata)
+ end
+end
+
+function sections.findnumber(depth,what)
local data = data.status[depth or data.depth]
if data then
- local sectiondata = jobsections.collected[data.references.section]
+ local index = data.references.section
+ local collected = jobsections.collected
+ local sectiondata = collected[index]
if sectiondata and sectiondata.hidenumber ~= true then -- can be nil
- sections.typesetnumber(sectiondata,'section',sectiondata)
+ if what == variables.first then
+ for i=index,1,-1 do
+ local s = collected[i]
+ local n = s.numbers
+ if #n == depth and n[depth] and n[depth] ~= 0 then
+ sectiondata = s
+ elseif #n < depth then
+ break
+ end
+ end
+ elseif what == variables.last then
+ for i=index,#collected do
+ local s = collected[i]
+ local n = s.numbers
+ if #n == depth and n[depth] and n[depth] ~= 0 then
+ sectiondata = s
+ elseif #n < depth then
+ break
+ end
+ end
+ end
+ return sectiondata
end
end
end
+
+function sections.fullnumber(depth,what,raw)
+ local sectiondata = sections.findnumber(depth,what)
+ if sectiondata then
+ sections.typesetnumber(sectiondata,'section',sectiondata)
+ end
+end
+
+function sections.getnumber(depth,what) -- redefined here
+ local sectiondata = sections.findnumber(depth,what)
+ texwrite((sectiondata and sectiondata.numbers[depth]) or 0)
+end
diff --git a/Master/texmf-dist/tex/context/base/strc-doc.mkiv b/Master/texmf-dist/tex/context/base/strc-doc.mkiv
index 4ff87b742be..e10efb3f70d 100644
--- a/Master/texmf-dist/tex/context/base/strc-doc.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-doc.mkiv
@@ -17,6 +17,8 @@
\unprotect
+\def\c!xmlsetup{xmlsetup}
+
% We operate in a \type {@@ns} namespace. All data is passed through
% variables. Of course we can built another interface on top of this
% that accepts multiple arguments. We might change this approach and
@@ -36,9 +38,10 @@
[\??ns]
[\c!number=,\c!level=,\c!name=,\c!title=,\c!bookmark=,\c!marking=,\c!list=,\c!label=,\c!coupling=,\c!ownnumber=,
\c!sectionseparatorset=\s!default,\c!sectionconversionset=\s!default,
- \c!sectionstopper=,\c!sectionsegments=,
+ \c!sectionstopper=,\c!sectionstarter,\c!sectionsegments=,
\c!sectionresetset=,\c!reference=,
\c!expansion=\v!no,
+ \c!xmlsetup=,
\s!catcodes=,
\c!saveinlist=\v!yes,
\c!command=\showstructuredata]
@@ -50,28 +53,29 @@
\def\dostructurecomponent[#1][#2]% #1=interfaced-settings, #2=optional user data (not yet supported)
{\begingroup
\getparameters[\??ns][#1]%
- \xdef\currentstructurename {\structureparameter\c!name}%
- \xdef\currentstructurecoupling {\structureparameter\c!coupling}%
- \xdef\currentstructureownnumber{\structureparameter\c!ownnumber}% optional own number
- \xdef\currentstructurelevel {\structureparameter\c!level}%
-\ifnum\catcodetable=\xmlcatcodes
- \let\currentstructureexpansion\s!xml
-\else
- \edef\currentstructureexpansion{\structureparameter\c!expansion}
-\fi
+ \xdef\currentstructurename {\structureparameter\c!name}%
+ \xdef\currentstructurecoupling {\structureparameter\c!coupling}%
+ \xdef\currentstructureownnumber {\structureparameter\c!ownnumber}% optional own number
+ \xdef\currentstructurelevel {\structureparameter\c!level}%
+ \edef\currentstructureexpansion {\structureparameter\c!expansion}%
+ \xdef\currentstructurexmlsetup {\structureparameter\c!xmlsetup}%
+ \xdef\currentstructurecatcodes {\structureparameter\s!catcodes}%
+ \xdef\currentstructurelabel {\structureparameter\c!label}%
+ \xdef\currentstructurereference {\structureparameter\c!reference}%
+ \xdef\currentstructurereferenceprefix{\structureparameter\c!referenceprefix}%
+ \xdef\currentstructureshownumber {\structureparameter\c!number}%
+ \xdef\currentstructuresaveinlist {\structureparameter\c!saveinlist}%
+ \xdef\currentstructureincrementnumber{\structureparameter\c!incrementnumber}%
\ifx\currentstructureexpansion\s!xml
- % maybe just title xml and inherit xml then in which case we have to test
- % when typesetting marks, lists, refs etc (+specific env)
- \xdef\currentstructuretitle {\detokenizedstructureparameter\c!title}% maybe xml
- \xdef\currentstructurebookmark{\detokenizedstructureparameter\c!bookmark}% no xml
- \xdef\currentstructuremarking {\detokenizedstructureparameter\c!marking}% no xml
- \xdef\currentstructurelist {\detokenizedstructureparameter\c!list}% no xml
+ \xmlstartraw
+ \xdef\currentstructuretitle {\structureparameter\c!title}%
+ \xdef\currentstructurebookmark{\structureparameter\c!bookmark}%
+ \xdef\currentstructuremarking {\structureparameter\c!marking}%
+ \xdef\currentstructurelist {\structureparameter\c!list}%
+ \xmlstopraw
\ifx\currentstructurelist\empty
- \xmlstartraw
- \xdef\currentstructurelist{\structureparameter\c!title}%
- \xmlstopraw
+ \globallet\currentstructurelist\currentstructuretitle
\fi
- %
\globallet\currentstructurecoding\s!xml
\else
\ifx\currentstructureexpansion\v!yes
@@ -96,12 +100,6 @@
\fi
\globallet\currentstructurecoding\s!tex
\fi
- \xdef\currentstructurelabel {\structureparameter\c!label}%
- \xdef\currentstructurereference {\structureparameter\c!reference}%
- \xdef\currentstructurereferenceprefix{\structureparameter\c!referenceprefix}%
- \xdef\currentstructureshownumber {\structureparameter\c!number}%
- \xdef\currentstructuresaveinlist {\structureparameter\c!saveinlist}%
- \xdef\currentstructureincrementnumber{\structureparameter\c!incrementnumber}%
\setnextinternalreference
\xdef\currentstructurenumber{\ctxlua{ % todo: combine with next call, adapt marks accordingly
structure.sections.somelevel {
@@ -115,17 +113,22 @@
resetset = "\structureparameter\c!sectionresetset",
},
metadata = {
- kind = "section",
- name = "\currentstructurename",
- catcodes = \the\catcodetable,
- coding = "\currentstructurecoding",
- xmlroot = \ifx\currentstructurecoding\s!xml "\xmldocument" \else nil \fi,
- \ifx\currentstructuresaveinlist\v!no
- nolist = true,
- \fi
- \ifx\currentstructureincrementnumber\v!yes
- increment = "\currentstructureincrementnumber",
- \fi
+ kind = "section",
+ name = "\currentstructurename",
+ catcodes = \the\ifx\currentstructurecatcodes\empty\catcodetable\else\csname\currentstructurecatcodes\endcsname\fi,
+ coding = "\currentstructurecoding",
+ \ifx\currentstructurecoding\s!xml
+ xmlroot = "\xmldocument",
+ \fi
+ \ifx\currentstructurexmlsetup\empty \else
+ xmlsetup = "\currentstructurexmlsetup",
+ \fi
+ \ifx\currentstructuresaveinlist\v!no
+ nolist = true,
+ \fi
+ \ifx\currentstructureincrementnumber\v!yes
+ increment = "\currentstructureincrementnumber",
+ \fi
},
titledata = { % we can add mark and reference
label = \!!bs\detokenize\expandafter{\currentstructurelabel }\!!es,
@@ -143,11 +146,14 @@
\fi
},
numberdata = {
-block = "\currentstructureblock",
-hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles
+ % needed ?
+ block = "\currentstructureblock",
+ hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles
+ % so far
separatorset = "\structureparameter\c!sectionseparatorset",
conversion = "\structureparameter\c!sectionconversion", % for good old times sake
conversionset = "\structureparameter\c!sectionconversionset",
+ starter = \!!bs\structureparameter\c!sectionstarter\!!es,
stopper = \!!bs\structureparameter\c!sectionstopper\!!es,
set = "\structureparameter\c!sectionset",
segments = "\structureparameter\c!sectionsegments",
diff --git a/Master/texmf-dist/tex/context/base/strc-flt.lua b/Master/texmf-dist/tex/context/base/strc-flt.lua
index f6f3e19ccc7..466fd515e04 100644
--- a/Master/texmf-dist/tex/context/base/strc-flt.lua
+++ b/Master/texmf-dist/tex/context/base/strc-flt.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-flt'] = {
version = 1.001,
- comment = "companion to strc-flt.tex",
+ comment = "companion to strc-flt.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/strc-flt.mkiv b/Master/texmf-dist/tex/context/base/strc-flt.mkiv
index bb19146a1fd..67023d701a6 100644
--- a/Master/texmf-dist/tex/context/base/strc-flt.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-flt.mkiv
@@ -20,9 +20,9 @@
%D This module needs a cleanup and will be split in
%D strc-flt.tex and page-flt.mkiv cq. page-flt.mkii.
-\ifx\addlocalbackgroundtobox\undefined \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi
+\ifdefined\addlocalbackgroundtobox\else \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi
-\def\placefloats{\doflushfloats} % keep this one
+\unexpanded\def\placefloats{\doflushfloats} % keep this one
\let\currentfloat\empty
@@ -71,8 +71,8 @@
% todo: everysetupfloat everysetupcaption for all floats
-\def\setupfloats {\dosingleargument\dosetupfloats} % was \??bk
-\def\setupcaptions{\dosingleargument\dosetupcaptions}
+\unexpanded\def\setupfloats {\dosingleargument\dosetupfloats} % was \??bk
+\unexpanded\def\setupcaptions{\dosingleargument\dosetupcaptions}
\let\alldefinedfloats\empty
@@ -110,14 +110,15 @@
\c!textcolor=,
\c!align=,
\c!number=\v!yes,
-\c!prefix=\v!no,
-\c!prefixconnector=.,
-\c!way=bychapter,
-\c!prefixsegments=2:2,
+% \c!prefix=\v!no,
+% \c!prefixconnector=.,
+% \c!way=\v!by\v!chapter,
+% \c!prefixsegments=2:2,
% \c!way=\@@nrway,
% \c!blockway=\@@nrblockway,
% \c!sectionnumber=\@@nrsectionnumber,
% \c!separator=\@@koseparator,
+% \c!starter=\@@kostarter,
% \c!stopper=\@@kostopper,
% \c!suffix=\floatcaptionsuffix, % hook
\c!distance=1em,
@@ -207,8 +208,8 @@
%D Individial settings:
-\def\setupfloat {\dodoubleargument\dosetupfloat}
-\def\setupcaption{\dodoubleargument\dosetupcaption}
+\unexpanded\def\setupfloat {\dodoubleargument\dosetupfloat}
+\unexpanded\def\setupcaption{\dodoubleargument\dosetupcaption}
\newtoks\everysetupfloat
\newtoks\everysetupcaption
@@ -221,13 +222,16 @@
{\def\docommand##1{\getparameters[\??kj##1][#2]\def\currentfloat{##1}\the\everysetupcaption}%
\processcommalist[#1]\docommand}
+\presetstructurecountersetup\setupcaptions\sharedstructurecounterparameter
+
\appendtoks
\dostructurecountersetup\currentfloat\floatcaptionparameter
+ \docheckstructurecountersetup\currentfloat
\to \everysetupcaption
%D Definitions:
-\def\definefloat
+\unexpanded\def\definefloat
{\dotripleempty\dodefinefloat}
\def\dodefinefloat[#1][#2][#3]% #1=naam #2=meervoud #3=parent
@@ -264,16 +268,16 @@
\dodefinefloatcommands[#1][#2]}
\def\dodefinefloatcommands[#1][#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}%
- \setvalue {\e!emptyone#1}{\doemptyfloatblock{#1}}%
- \setvalue {\e!emptytwo#1}{\doemptyfloatblock{#1}}}
+ {\setuvalue {\e!place\e!listof#2}{\dodoubleempty\doplacelist[#1]}%
+ \setuvalue {\e!complete\e!listof#2}{\dotripleempty\dodocompletelist[#1][#2]}%
+ \setuvalue {\e!place#1}{\dotripleempty\docomplexplacefloat[#1]}%
+ \setuvalue {\e!reserve#1}{\doquadrupleempty\docomplexreserveblock[#1]}%
+ \setuvalue {\e!start#1\e!text}{\dotripleempty\docomplexstarttextblock[#1]}%
+ \setuvalue {\e!stop#1\e!text}{\dostoptextfloat}%
+ \setuvalue{\e!start\e!reserve#1\e!text}{\doquadrupleempty\docomplexstartreservetextblock[#1]}%
+ \setuvalue {\e!stop\e!reserve#1\e!text}{\dostoptextfloat}%
+ \setuvalue {\e!emptyone#1}{\doemptyfloatblock{#1}}%
+ \setuvalue {\e!emptytwo#1}{\doemptyfloatblock{#1}}}
%D Fallback float body:
@@ -297,11 +301,18 @@
\installstructurelistprocessor{float}{\usestructurelistprocessor{number+title}}
+% \def\thecurrentfloatnumber
+% {\ifnofloatcaption \else \ifnofloatnumber \else
+% % \labeltexts\currentfloat{\convertedstructurecounter[\currentfloat]}% ! ! todo: use a lua call instead
+% \ifx\currentfloatnumber\relax\else
+% \labeltexts\currentfloat{\ctxlua{structure.lists.savednumber("\currentfloat",\currentfloatnumber)}}%
+% \fi
+% \fi \fi}
+
\def\thecurrentfloatnumber
{\ifnofloatcaption \else \ifnofloatnumber \else
- % \labeltexts\currentfloat{\convertedstructurecounter[\currentfloat]}% ! ! todo: use a lua call instead
\ifx\currentfloatnumber\relax\else
- \labeltexts\currentfloat{\ctxlua{structure.lists.savednumber("\currentfloat",\currentfloatnumber)}}%
+ \labeltexts\currentfloat{\ctxlua{structure.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}}%
\fi
\fi \fi}
@@ -326,7 +337,7 @@
% NOT YET REDONE ! ! ! ! !
- \def\placefloatcaption
+ \unexpanded\def\placefloatcaption
{\dodoubleempty\doplacefloatcaption}
\long\def\doplacefloatcaption[#1][#2]#3%
@@ -334,7 +345,7 @@
\placefloatcaptiontext[#1]%
\placefloatcaptionreference[#1]}
- \def\setfloatcaption % \dosetfloatcaption already in use
+ \unexpanded\def\setfloatcaption % \dosetfloatcaption already in use
{\dodoubleempty\dodosetfloatcaption} % beware, name clash
\long\def\dodosetfloatcaption[#1][#2]#3% to do namespace for number/ascii
@@ -370,9 +381,9 @@
{\letgvalue{@fl@r@#1}\relax
\letgvalue{@fl@t@#1}\relax}
- \def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}}
- \def\placefloatcaptionnumber [#1]{\getvalue{@fl@n@#1}}
- \def\placefloatcaptionreference[#1]{\getvalue{@fl@r@#1}}
+ \unexpanded\def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}}
+ \unexpanded\def\placefloatcaptionnumber [#1]{\getvalue{@fl@n@#1}}
+ \unexpanded\def\placefloatcaptionreference[#1]{\getvalue{@fl@r@#1}}
% still needed for uguide
@@ -439,13 +450,13 @@
% \fi
% \stopsetups
%
-% \def\setupswithbox[#1]{\dowithnextbox{\setups[#1]}\vbox}
+% \unexpanded\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 ?
+ {\doprocesslocalsetups{\floatcaptionparameter\c!setups}% expanded ?
%\advance\leftskip \floatcaptionparameter\c!leftmargin
%\advance\rightskip\floatcaptionparameter\c!rightmargin
\relax}
@@ -594,12 +605,12 @@
{\normalexpanded{\noexpand\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}%
% but which should be done before using box \floatbox
\fi
- \ifmargeblokken
+ \ifmarginblocks
\doifinset\v!margin{#2}\endgraf
\fi
\global\insidefloattrue
\begingroup % **
- \ifmargeblokken
+ \ifmarginblocks
\doifinset\v!margin{#2}{\hsize\@@mbwidth}%
\fi
\the\everyinsidefloat
@@ -608,7 +619,6 @@
\dowithnextboxcontent % better a \the\everyfloattoks
{\setlocalfloathsize
\floatparameter\c!inner
- \fuzzysnappingfalse
\postponenotes} % new
{\doifsomething{\floatparameter\c!criterium}
{\ifdim\wd\nextbox>\floatparameter\c!criterium\relax
@@ -690,13 +700,17 @@
{\global\nofloatnumbertrue}}%
% this has to change
\ConvertToConstant\doifelse{#4}{}
+% \ConvertToConstant\doifelse{\detokenize{#4}}{}
{\global\emptyfloatcaptiontrue}
{\global\emptyfloatcaptionfalse}%
+% \doifinsetelse\v!none{#2}
+% {\global\nofloatcaptiontrue}
+% {\ConvertToConstant\doifelse{#4}\v!none
+% {\global\nofloatcaptiontrue}
+% {\global\nofloatcaptionfalse}}%
\doifinsetelse\v!none{#2}
{\global\nofloatcaptiontrue}
- {\ConvertToConstant\doifelse{#4}\v!none
- {\global\nofloatcaptiontrue}
- {\global\nofloatcaptionfalse}}%
+ {\global\nofloatcaptionfalse}%
\doif{\floatcaptionparameter\c!number}\v!none % new
{\global\nofloatcaptiontrue}%
\ifemptyfloatcaption \ifnofloatnumber
@@ -734,6 +748,8 @@
% todo: optional user pars
+\let\currentfloatattribute\empty % to be checked
+
\def\floatcaptionattribute
{\iflocation \ifnofloatnumber \else \ifnofloatcaption \else
attr \destinationattribute \currentfloatattribute
@@ -797,10 +813,6 @@
\dogetfloatdata
\to \everyinsidefloat
-%\appendtoks
-% \fuzzysnappingfalse
-%\to \everyinsidefloat
-
\def\doifrightpagefloatelse
{\ifdoublesided
\ifsinglesided
@@ -961,7 +973,7 @@
{\flushsidefloats % hoort eigenlijk niet hier
\docomplexreserveblock[#1][#2][\v!text,#3,\v!left][#4]}
-\def\placefloat
+\unexpanded\def\placefloat
{\dotripleempty\docomplexplacefloat}
\installinsertion\topins
@@ -970,187 +982,60 @@
\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
+\newif\iftopofinsert
+\newif\iftestfloatbox
-\newdimen\floattextwidth
-\newdimen\floattextheight
+\newdimen\floatsideskip \floatsideskip =12pt
+\newdimen\floattopskip \floattopskip =\floattopskip
+\newdimen\floatbottomskip \floatbottomskip=\floattopskip
-\newbox\floatbox
-\newbox\savedfloatbox
+\newdimen\sidefloattopskip \sidefloattopskip =\floattopskip
+\newdimen\sidefloatbottomskip \sidefloatbottomskip=\floatbottomskip
-\newdimen\floatwidth
-\newdimen\floatheight
-
-\def\dosavefloatinfo {\showmessage\m!floatblocks2{\the\totalnoffloats}}
-\def\doinsertfloatinfo {\showmessage\m!floatblocks4{\the\totalnoffloats}}
-\def\dofloatflushedinfo{\showmessage\m!floatblocks3{\the\numexpr\totalnoffloats-\savednoffloats\relax}}
-
-\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}
+\newskip\sidefloatdownshift
+\newskip\sidefloatleftshift
+\newskip\sidefloatrightshift
-\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\sidefloattopoffset {\openstrutdepth} % {\strutdp}
-\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}}
+\newcount\noftopfloats \noftopfloats=2
+\newcount\nofbotfloats \nofbotfloats=0
-% top and bottom
+\def\docalculatefloatskip#1#2%
+ {\doifelsenothing{#2}
+ {\global#1\zeropoint}
+ {\doifelse{#2}\v!none
+ {\global#1\zeropoint}
+ {\setbox\scratchbox\vbox{\whitespace\normalexpanded{\noexpand\blank[#2]}}%
+ \global#1\ht\scratchbox}}}
-\newif\iftopofinsert
-\newif\iftestfloatbox
-\newif\ifcenterfloatbox \centerfloatboxtrue
-\newif\iflocalcenterfloatbox \localcenterfloatboxfalse
-\newif\ifglobalcenterfloatbox \globalcenterfloatboxfalse
+\def\calculatefloatskips
+ {{\docalculatefloatskip\floattopskip{\floatsharedparameter\c!spacebefore}%
+ \docalculatefloatskip\floatbottomskip{\floatsharedparameter\c!spaceafter}%
+ \docalculatefloatskip\sidefloattopskip{\floatsharedparameter\c!sidespacebefore}%
+ \docalculatefloatskip\sidefloatbottomskip{\floatsharedparameter\c!sidespaceafter}%
+ \gdef\sidefloattopoffset{\openstrutdepth}% was \def
+ \global\floatsideskip\floatsharedparameter\c!margin
+ \global\sidefloatleftshift\floatparameter\c!leftmargindistance
+ \global\sidefloatrightshift\floatparameter\c!rightmargindistance
+ \global\noftopfloats\floatsharedparameter\c!ntop\relax
+ \global\nofbotfloats\floatsharedparameter\c!nbottom\relax}}
% beter de laatste skip buiten de \insert uitvoeren,
% bovendien bij volle flush onder baseline.
-\def\betweenfloatblanko% assumes that spaceafter is present
- {\bgroup
- \setbox0\vbox{\strut\blank[\floatsharedparameter\c!spacebefore]\strut}%
- \setbox2\vbox{\strut\blank[\floatsharedparameter\c!spaceafter]\strut}%
- \ifdim\ht0>\ht2
- \blank[-\floatsharedparameter\c!spaceafter,\floatsharedparameter\c!spacebefore]%
- \fi
- \egroup}
+% \def\betweenfloatblanko% assumes that spaceafter is present
+% {\bgroup
+% \setbox0\vbox{\strut\blank[\floatsharedparameter\c!spacebefore]\strut}%
+% \setbox2\vbox{\strut\blank[\floatsharedparameter\c!spaceafter]\strut}%
+% \ifdim\ht0>\ht2
+% \blank[-\floatsharedparameter\c!spaceafter,\floatsharedparameter\c!spacebefore]%
+% \fi
+% \egroup}
+\def\betweenfloatblanko% assumes that spaceafter is present
+ {\blank[\floatsharedparameter\c!spacebefore]} % or v!back,....
+
\def\doplacefloatbox
{%\forgetall % NO
\whitespace
@@ -1158,15 +1043,12 @@
\flushfloatbox
\blank[\floatsharedparameter\c!spaceafter]}
-\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
+\ifdefined\someherefloat\else \let\someherefloat\doplacefloatbox \fi
+\ifdefined\someslotfloat\else \let\someslotfloat\doplacefloatbox \fi
+\ifdefined\somefixdfloat\else \let\somefixdfloat\doplacefloatbox \fi
+\ifdefined\sometopsfloat\else \let\sometopsfloat\doplacefloatbox \fi
+\ifdefined\somebotsfloat\else \let\somebotsfloat\doplacefloatbox \fi
+\ifdefined\somesidefloat\else \let\somesidefloat\doplacefloatbox \fi
% test case:
%
@@ -1307,51 +1189,6 @@
{\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} {plaats} {label} {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
-
-\def\docalculatefloatskip#1#2%
- {\doifelsenothing{#2}
- {\global#1\zeropoint}
- {\doifelse{#2}\v!none
- {\global#1\zeropoint}
- {\setbox\scratchbox\vbox{\whitespace\normalexpanded{\noexpand\blank[#2]}}%
- \global#1\ht\scratchbox}}}
-
-\def\calculatefloatskips
- {{\docalculatefloatskip\floattopskip{\floatsharedparameter\c!spacebefore}%
- \docalculatefloatskip\floatbottomskip{\floatsharedparameter\c!spaceafter}%
- \docalculatefloatskip\sidefloattopskip{\floatsharedparameter\c!sidespacebefore}%
- \docalculatefloatskip\sidefloatbottomskip{\floatsharedparameter\c!sidespaceafter}%
- \gdef\sidefloattopoffset{\openstrutdepth}% was \def
- \global\floatsideskip\floatsharedparameter\c!margin
- \global\sidefloatleftshift\floatparameter\c!leftmargindistance
- \global\sidefloatrightshift\floatparameter\c!rightmargindistance
- \global\noftopfloats\floatsharedparameter\c!ntop\relax
- \global\nofbotfloats\floatsharedparameter\c!nbottom\relax}}
-
\def\borderedfloatbox
{\localframed
[\??fl\currentfloat]
@@ -1362,7 +1199,7 @@
% minwidth=fit,width=max : no overshoot, as wide as graphic
-\ifx\moveboxontogrid\undefined \let\movecaptionontogrid\gobblethreearguments \fi
+\ifdefined\moveboxontogrid\else \let\movecaptionontogrid\gobblethreearguments \fi
\def\locatefloatbox
{\chardef\alignstrutmode\zerocount
@@ -1967,29 +1804,24 @@
\newif\ifparfloat
-\long\def\dosetfloatbox#1#2#3% todo : \global\setbox
+\long\def\dosetfloatbox#1#2#3% todo : \global\setbox, currently messy
{\ifvisible
\par
\edef\floatcaptiondirectives{\floatparameter\c!location,\floatcaptionparameter\c!location}%
\ifparfloat\@EA\dosetparfloat\else\@EA\dosetpagfloat\fi{#1}{#2}{#3}%
\setlocalfloatdimensions{#1}%
+ \global\advance\totalnoffloats\plusone
\setbox\floatbox\hbox{\dosavefloatdata\box\floatbox}% still needed? we will do renumbering differently
- \global\floatheight\ht\floatbox
- \global\advance\floatheight \dp\floatbox
+ \global\floatheight\htdp\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
+ \ifdim\dimexpr\floatheight+\lineheight\relax<\textheight \else
+ \global\floatheight\dimexpr\textheight-\lineheight\relax
\ht\floatbox\floatheight
\dp\floatbox\zeropoint
\showmessage\m!floatblocks{10}{\the\totalnoffloats}%
@@ -2040,7 +1872,7 @@
\@EA\aftersplitstring \floatcolumn\at*\to\floatrow
\@EA\beforesplitstring\floatcolumn\at*\to\floatcolumn
% todo: nog algemeen otr
- \ifx\OTRSETsetpreferedcolumnslot\undefined\else
+ \ifdefined\OTRSETsetpreferedcolumnslot
\OTRSETsetpreferedcolumnslot\floatcolumn\floatrow
\fi}
{\let\floatcolumn\empty
@@ -2092,16 +1924,9 @@
\installfloathandler {fxtb} \someslotfloat
\installfloathandler {fxbt} \someslotfloat
-\registerotrcommand\placesomeslotfloat % \def\placesomeslotfloat {\OTRcommand\someslotfloat}
-\registerotrcommand\placesomeherefloat % \def\placesomeherefloat {\OTRcommand\someherefloat}
-\registerotrcommand\placesomefixdfloat % \def\placesomefixdfloat {\OTRcommand\somefixdfloat}
-\registerotrcommand\placesomepagefloat % \def\placesomepagefloat {\OTRcommand\somepagefloat}
-\registerotrcommand\placesomeleftpagefloat % \def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat}
-\registerotrcommand\placesomerightpagefloat % \def\placesomerightpagefloat{\OTRcommand\somerightpagefloat}
-\registerotrcommand\placesometopsfloat % \def\placesometopsfloat {\OTRcommand\sometopsfloat}
-\registerotrcommand\placesomebotsfloat % \def\placesomebotsfloat {\OTRcommand\somebotsfloat}
-\registerotrcommand\placesomesidefloat % \def\placesomesidefloat {\OTRcommand\somesidefloat}
-\registerotrcommand\placesomefacefloat % \def\placesomefacefloat {\OTRcommand\somefacefloat}
+% no \registerotrcommand\placesome* here!, this has to be cleaned up:
+
+\def\somesidefloat{\OTRcommand\somesidefloat}
\def\someleftsidefloat [#1]{\somesidefloat[#1]\presetindentation}
\def\somerightsidefloat [#1]{\somesidefloat[#1]}
@@ -2115,10 +1940,20 @@
\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]}
+\unexpanded\def\placesomeslotfloat {\OTRcommand\someslotfloat}
+\unexpanded\def\placesomeherefloat {\OTRcommand\someherefloat}
+\unexpanded\def\placesomefixdfloat {\OTRcommand\somefixdfloat}
+\unexpanded\def\placesomepagefloat {\OTRcommand\somepagefloat}
+\unexpanded\def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat}
+\unexpanded\def\placesomerightpagefloat{\OTRcommand\somerightpagefloat}
+\unexpanded\def\placesometopsfloat {\OTRcommand\sometopsfloat}
+\unexpanded\def\placesomebotsfloat {\OTRcommand\somebotsfloat}
+\unexpanded\def\placesomesidefloat {\OTRcommand\somesidefloat}
+\unexpanded\def\placesomefacefloat {\OTRcommand\somefacefloat}
+
\def\somefixdfloat {\placesomefixdfloat}
\def\somepagefloat {\placesomepagefloat}
\def\someleftpagefloat {\placesomeleftpagefloat}
diff --git a/Master/texmf-dist/tex/context/base/strc-ini.lua b/Master/texmf-dist/tex/context/base/strc-ini.lua
index 06f5ff82f82..61c26a20eed 100644
--- a/Master/texmf-dist/tex/context/base/strc-ini.lua
+++ b/Master/texmf-dist/tex/context/base/strc-ini.lua
@@ -1,13 +1,12 @@
if not modules then modules = { } end modules ['strc-ini'] = {
version = 1.001,
- comment = "companion to strc-ini.tex",
+ comment = "companion to strc-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--[[
-
The restructuring is the (intermediate) result of quite some experiments. I started
with the basic structure, followed by lists, numbers, enumerations, itemgroups
and floats. All these have something in common, like pagenumbers and section
@@ -24,8 +23,11 @@ but it does not make sense to store all processdata.
local format, concat, match = string.format, table.concat, string.match
local count, texwrite, texprint, texsprint = tex.count, tex.write, tex.print, tex.sprint
local type, next, tonumber, tostring = type, next, tonumber, tostring
+local lpegmatch = lpeg.match
+
+local ctxcatcodes, xmlcatcodes, notcatcodes = tex.ctxcatcodes, tex.xmlcatcodes, tex.notcatcodes -- tricky as we're in notcatcodes
-local ctxcatcodes = tex.ctxcatcodes
+local trace_processors = false trackers.register("structure.processors", function(v) trace_processors = v end)
-- move this
@@ -150,16 +152,29 @@ function helpers.merged(...)
return t
end
-local tag = "ctx:tocentry"
+local tags = {
+ generic = "ctx:genericentry",
+ section = "ctx:sectionentry",
+ entry = "ctx:registerentry",
+}
-function helpers.title(title,metadata)
+function helpers.title(title,metadata) -- brrr
if title and title ~= "" then
if metadata then
if metadata.coding == "xml" then
+ tag = tags[metadata.kind] or tags.generic
buffers.set(tag,format("<?xml version='1.0'?><%s>%s</%s>",tag,title,tag))
texsprint(ctxcatcodes,format("\\xmlprocessbuffer{%s}{%s}{}",metadata.xmlroot or "main",tag))
+ elseif metadata.xmlsetup then
+ texsprint(ctxcatcodes,format("\\xmlsetup{%s}{%s}",title,metadata.xmlsetup)) -- nasty
else
- texsprint(metadata.catcodes,title)
+ local catcodes = metadata.catcodes
+--~ print(tex.ctxcatcodes,tex.xmlcatcodes,catcodes,title)
+ if catcodes == notcatcodes or catcodes == xmlcatcodes then
+ texsprint(ctxcatcodes,title) -- nasty
+ else
+ texsprint(catcodes,title)
+ end
end
else
texsprint(title) -- no catcode switch
@@ -184,7 +199,7 @@ end
local splitter = lpeg.splitat("->",true)
function processors.split(str)
- local p, s = splitter:match(str)
+ local p, s = lpegmatch(splitter,str)
if registered[p] then
return p, s
else
@@ -193,16 +208,21 @@ function processors.split(str)
end
function processors.sprint(catcodes,str,fnc,...)
- local p, s = splitter:match(str)
+ local p, s = lpegmatch(splitter,str)
+ local code
if registered[p] then
- texsprint(catcodes,format("\\applyprocessor{%s}{%s}",p,(fnc and fnc(s,...)) or s))
+ code = format("\\applyprocessor{%s}{%s}",p,(fnc and fnc(s,...)) or s)
else
- texsprint(catcodes,(fnc and fnc(str,...)) or str)
+ code = (fnc and fnc(str,...)) or str
+ end
+ if trace_processors then
+ logs.report("processors","cct: %s, seq: %s",catcodes,code)
end
+ texsprint(catcodes,code)
end
function processors.apply(str)
- local p, s = splitter:match(str)
+ local p, s = lpegmatch(splitter,str)
if registered[p] then
return format("\\applyprocessor{%s}{%s}",p,s)
else
diff --git a/Master/texmf-dist/tex/context/base/strc-ini.mkiv b/Master/texmf-dist/tex/context/base/strc-ini.mkiv
index 61944299803..5ed7b423c3a 100644
--- a/Master/texmf-dist/tex/context/base/strc-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-ini.mkiv
@@ -71,10 +71,10 @@
% level of a number in sets. This is all handles at the \LUA\ end.
% References to such sets travel with the multipass information.
-\def\definestructureresetset {\dotripleempty\dodefinestructureresetset}
-\def\definestructureseparatorset {\dotripleempty\dodefinestructureseparatorset}
-\def\definestructureconversionset{\dotripleempty\dodefinestructureconversionset}
-\def\definestructureprefixset {\dotripleempty\dodefinestructureprefixset}
+\unexpanded\def\definestructureresetset {\dotripleempty\dodefinestructureresetset}
+\unexpanded\def\definestructureseparatorset {\dotripleempty\dodefinestructureseparatorset}
+\unexpanded\def\definestructureconversionset{\dotripleempty\dodefinestructureconversionset}
+\unexpanded\def\definestructureprefixset {\dotripleempty\dodefinestructureprefixset}
\def\dodefinestructureresetset [#1][#2][#3]{\ctxlua{structure.sets.define("structure:resets", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}",true)}}
\def\dodefinestructureseparatorset [#1][#2][#3]{\ctxlua{structure.sets.define("structure:separators", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}")}}
diff --git a/Master/texmf-dist/tex/context/base/strc-itm.lua b/Master/texmf-dist/tex/context/base/strc-itm.lua
index fc609b44812..e776f326d1c 100644
--- a/Master/texmf-dist/tex/context/base/strc-itm.lua
+++ b/Master/texmf-dist/tex/context/base/strc-itm.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-itm'] = {
version = 1.001,
- comment = "companion to strc-itm.tex",
+ comment = "companion to strc-itm.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/strc-itm.mkii b/Master/texmf-dist/tex/context/base/strc-itm.mkii
index d0afd13c842..1de63c7c32b 100644
--- a/Master/texmf-dist/tex/context/base/strc-itm.mkii
+++ b/Master/texmf-dist/tex/context/base/strc-itm.mkii
@@ -409,23 +409,22 @@
\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}{0}%
- \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}
+ {\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
diff --git a/Master/texmf-dist/tex/context/base/strc-itm.mkiv b/Master/texmf-dist/tex/context/base/strc-itm.mkiv
index 6799a02a67d..7207494ed49 100644
--- a/Master/texmf-dist/tex/context/base/strc-itm.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-itm.mkiv
@@ -17,24 +17,26 @@
\unprotect
-\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
+\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
+\newconditional\indentedfirstlistitem \setfalse\indentedfirstlistitem
+\newconditional\inlinelistitem \setfalse\inlinelistitem
\newcount\noflists
\newcount\currentnoflists
@@ -64,13 +66,15 @@
{\edef\currentnofitems {\ctxlua{structure.itemgroups.nofitems("\currentitemgroup",\number\currentnoflists)}}%
\edef\currentitemmaxwidth{\ctxlua{structure.itemgroups.maxwidth("\currentitemgroup",\number\currentnoflists)}\scaledpoint}}
+% todo: \dodosetreference -> \dostructurecountercomponent (to be checked)
+
\def\dohandleitemreference % we will make a decent number helper
{\ifx\currentitemreference \empty \else
\setnextinternalreference
\ctxlua { jobreferences.setandgetattribute("\s!full", "\referenceprefix","\currentitemreference",
{
metadata = {
- kind = "list",
+ kind = "item",% ?
catcodes = \the\catcodetable,
xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text
},
@@ -78,6 +82,16 @@
internal = \nextinternalreference,
section = structure.sections.currentid(),
},
+ prefixdata = structure.helpers.simplify {
+ prefix = "\structurecounterparameter\currentitemgroupcounter\c!prefix",
+ separatorset = "\structurecounterparameter\currentitemgroupcounter\c!prefixseparatorset",
+ conversion = \!!bs\structurecounterparameter\currentitemgroupcounter\c!prefixconversion\!!es,
+ conversionset = "\structurecounterparameter\currentitemgroupcounter\c!prefixconversionset",
+ set = "\structurecounterparameter\currentitemgroupcounter\c!prefixset",
+ segments = "\structurecounterparameter\currentitemgroupcounter\c!prefixsegments",
+ % segments = "\askedprefixsegments",
+ connector = \!!bs\structurecounterparameter\currentitemgroupcounter\c!prefixconnector\!!es,
+ },
numberdata = structure.helpers.simplify {
numbers = structure.counters.compact("\currentitemgroupcounter",nil,true),
separatorset = "\structurecounterparameter\currentitemgroupcounter\c!numberseparatorset",
@@ -90,9 +104,10 @@
})
}%
\xdef\currentitemattribute{\number\lastdestinationattribute}%
- \begingroup\dosetattribute{destination}\currentitemattribute\kern\zeropoint\endgroup % todo
+ \begingroup\attribute\destinationattribute\currentitemattribute\kern\zeropoint\endgroup % todo
\fi}
+
% \startitemize[n,packed]
% \item test \item test \item test
% \stopitemize
@@ -141,26 +156,55 @@
\def\@@itemcounter{\s!itemcount\currentitemgroup}
-\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
+% \def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
+%
+% \def\allowitembreak {\doitembreak\allowbreak}
+% \def\noitembreak {\doitembreak\nobreak}
+% \def\itembreakspecial {\doitembreak\itembreak}
+% \def\noitembreakspecial{\doitembreak\itemnobreak}
+%
+% \def\itembreak {\flushnotes\penalty-5\relax} % -10
+% \def\itemnobreak{\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax} % +5
+
+\definevspacing[\v!item @0] [penalty:0] % allow
+\definevspacing[\v!item @10000] [penalty:10000] % no
+\definevspacing[\v!item @-5] [penalty:-5]
+\definevspacing[\v!item @5] [penalty:5]
+\definevspacing[\v!item @500] [penalty:500]
+
+\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else#1\fi\fi}
-\def\allowitembreak {\doitembreak\allowbreak}
-\def\noitembreak {\doitembreak\nobreak}
+\def\allowitembreak {\doitembreak\itembreakallow}
+\def\noitembreak {\doitembreak\itembreakno}
\def\itembreakspecial {\doitembreak\itembreak}
\def\noitembreakspecial{\doitembreak\itemnobreak}
-\def\itembreak {\flushnotes\penalty-5\relax} % -10
-\def\itemnobreak{\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax} % +5
+\def\itembreakallow{\vspacing[\v!item @0]}
+\def\itembreakno {\vspacing[\v!item @10000]}
+\def\itembreak {\flushnotes\vspacing[\v!item @-5]}
+\def\itemnobreak {\flushnotes\ifinsidecolumns\vspacing[\v!item @5]\else\vspacing[\v!item @500]\fi}
+
+% cool but wrong:
+%
+% \def\initializeitemgrouplevel#1%
+% {\ifcsname\??op\currentitemgroup#1\s!parent\endcsname
+% % ok
+% \else\ifnum#1>\plusone
+% \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup\the\numexpr#1-1\relax}%
+% \else
+% \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup}%
+% \fi\fi}
+%
+% so we have:
\def\initializeitemgrouplevel#1%
{\ifcsname\??op\currentitemgroup#1\s!parent\endcsname
% ok
- \else\ifnum#1>\plusone
- \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup\the\numexpr#1-1\relax}%
\else
\setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup}%
- \fi\fi}
+ \fi}
-\def\defineitemgroup
+\unexpanded\def\defineitemgroup
{\dotripleempty\dodefineitemgroup}
\def\dodefineitemgroup[#1][#2][#3]% todo: clone
@@ -181,7 +225,7 @@
\newtoks\everysetupitemgroup
-\def\setupitemgroups % [#1]
+\unexpanded\def\setupitemgroups % [#1]
{\dodoubleargument\getparameters[\??oo]} % [#1]
\def\packitems
@@ -199,17 +243,19 @@
\def\dodosetupitemgroupconstant#1%
{\edef\itemgroupconstantvalue{#1}%
\ifx\itemgroupconstantvalue\empty\else
- \splitstring\itemgroupconstantvalue\at*\to\itemgroupfirst\and\itemgroupsecond
- \ifcsname\??op:::\itemgroupfirst\endcsname\csname\??op:::\itemgroupfirst\endcsname\fi
+ \splitstring\itemgroupconstantvalue\at*\to\itemgroupfirst\and\itemgroupsecond
+ \ifx\itemgroupsecond\empty
+ \let\itemgroupsecond\itemgroupfirst
+ \let\itemgroupfirst\!!plusone
+ \fi
+ \ifcsname\??op:::\itemgroupsecond\endcsname\csname\??op:::\itemgroupsecond\endcsname\fi
\fi}
-\newconditional\inlinelistitem \setfalse\inlinelistitem
-
\setvalue{\??op:::\v!packed }{\packitems}
\setvalue{\??op:::\v!intro }{\settrue\introlistitem} % here? not set to false
\setvalue{\??op:::\v!autointro}{\settrue\autointrolistitem}
-\setvalue{\??op:::\v!broad }{\ifx\itemgroupsecond\empty\def\itemgroupsecond{1}\fi
- \letitemparameter\currentitemlevel\c!factor\itemgroupsecond}
+\setvalue{\??op:::\v!broad }{\ifx\itemgroupfirst\empty\def\itemgroupfirst{1}\fi
+ \letitemparameter\currentitemlevel\c!factor\itemgroupfirst}
\setvalue{\??op:::\v!text }{\settrue\textlistitem
\settrue\inlinelistitem
\settrue\joinedlistitem
@@ -225,12 +271,12 @@
\setvalue{\??op:::\v!loose }{\setfalse\optimizelistitem}
\setvalue{\??op:::\v!fit }{\settrue\fittinglistitems}
\setvalue{\??op:::\v!nofit }{\setfalse\fittinglistitems}
-\setvalue{\??op:v:\v!paragraph}{\settrue\paragraphlistitem
+\setvalue{\??op:::\v!paragraph}{\settrue\paragraphlistitem
\packitems}
\setvalue{\??op:::\v!joinedup }{\settrue\joinedlistitem
\packitems}
-\setvalue{\??op:::\v!serried }{\edef\itemgroupsecond{-\ifx\itemgroupsecond\empty1\else\itemgroupsecond\fi}%
- \letitemparameter\currentitemlevel\c!factor\itemgroupsecond}
+\setvalue{\??op:::\v!serried }{\edef\itemgroupfirst{-\ifx\itemgroupfirst\empty1\else\itemgroupfirst\fi}%
+ \letitemparameter\currentitemlevel\c!factor\itemgroupfirst}
\setvalue{\??op:::\v!stopper }{\letitemparameter\currentitemlevel\c!placestopper\v!yes} % keep {}
\setvalue{\??op:::\v!unpacked }{\setfalse\packlistitem}
\setvalue{\??op:::\v!repeat }{\settrue\repeatlistitem}
@@ -240,7 +286,7 @@
\def\dosetupstandarditemgroup#1%
{\getparameters
[\??op\currentitemgroup#1]
- [\c!width=1.5em,\c!factor=0,\c!distance=.5em,\c!inner=,
+ [\c!width=1.5em,\c!factor=0,\c!distance=.5em,\c!inner=,\c!factor=0,
\c!beforehead=,\c!afterhead=\blank,\c!before=\blank,\c!inbetween=\blank,\c!after=\blank]}
% \def\packeditemspacing{\empty}
@@ -356,7 +402,7 @@
{\def\docommand##1{\dodosetupitemgroup[##1][#2][#3][#4]}%
\processcommalist[#1]\docommand}
-\def\setupitemgroup
+\unexpanded\def\setupitemgroup
{\doquadrupleempty\dosetupitemgroup}
\def\doadvanceitem
@@ -385,7 +431,15 @@
{\begingroup
\setupstructurecounter
[\currentitemgroupcounter]
- [\c!prefix=\v!no,
+ [%\c!prefix=\v!no,
+ \c!prefix=\getitemparameter\currentitemlevel\c!prefix,
+ \c!prefixstopper=\getitemparameter\currentitemlevel\c!prefixstopper,
+ \c!prefixseparatorset=\getitemparameter\currentitemlevel\c!prefixseparatorset,
+ \c!prefixconversion=\getitemparameter\currentitemlevel\c!prefixconversion,
+ \c!prefixconversionset=\getitemparameter\currentitemlevel\c!prefixseparatorset,
+ \c!prefixset=\getitemparameter\currentitemlevel\c!prefixset,
+ \c!prefixsegments=\getitemparameter\currentitemlevel\c!prefixsegments,
+ \c!prefixconnector=\getitemparameter\currentitemlevel\c!prefixconnector,
\c!criterium=\getitemparameter\currentitemlevel\c!criterium,
\c!numberorder=\ifconditional\reverselistitem\v!reverse\else\v!normal\fi,
\c!numberstopper=\expdoif{\getitemparameter\currentitemlevel\c!placestopper}\v!yes{\getitemparameter\currentitemlevel\c!stopper},
@@ -429,13 +483,26 @@
\let\@@opsymbol\empty}%
{}}}
-\def\calculatelistwidth#1% distance deals with 'broad'
- {\itemgrouplistwidth\getitemparameter#1\c!distance\relax
- \ifnum\getitemparameter#1\c!factor>\zerocount
+% \def\calculatelistwidth#1% distance deals with 'broad'
+% {\itemgrouplistwidth\getitemparameter#1\c!distance\relax
+% \ifnum\getitemparameter#1\c!factor>\zerocount
+% \ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi
+% \fi
+% \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
+% \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax}
+
+\def\calculatelistwidth#1%
+ {\ifdim\currentitemmaxwidth>\zeropoint
+ \itemgrouplistwidth\currentitemmaxwidth
+ \else\ifnum\getitemparameter#1\c!factor>\zerocount
+ \itemgrouplistwidth\getitemparameter#1\c!step\relax
\ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi
- \fi
- \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
- \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax}
+ \multiply\itemgrouplistwidth \getitemparameter#1\c!factor
+ \advance\itemgrouplistwidth\getitemparameter#1\c!width\relax
+ \else
+ \itemgrouplistwidth\getitemparameter#1\c!width\relax
+ \fi\fi
+ \advance\itemgrouplistwidth\getitemparameter#1\c!distance\relax}
% The next conditionals deal with \item \startitemgroup. It
% looks like a hack to skip back, but that way we preserve
@@ -446,7 +513,7 @@
\newconditional\autoconcatnextitem \settrue \autoconcatnextitem
\newsignal \itemsignal
-\def\startitemgroup
+\unexpanded\def\startitemgroup
{\dotripleempty\dostartitemgroup}
\def\dostartitemgroup[#1][#2][#3]%
@@ -524,7 +591,7 @@
\expandafter\flushcollecteditems
\fi}
-\def\stopcollectitems
+\unexpanded\def\stopcollectitems
{\ifconditional\randomizeitems
\newcounter\itemcollectcounterdone
\ifnum\itemcollectcounter>\zerocount
@@ -532,7 +599,7 @@
\fi
\fi}
-\def\startcollectitems
+\unexpanded\def\startcollectitems
{\ifconditional\randomizeitems
\newcounter\itemcollectcounter
\letvalue{\e!start\v!item}\collectitemgroupitem
@@ -540,7 +607,7 @@
%D End of plugin.
-\ifx\startcolumns\undefined \def\startcolumns[#1]{} \fi
+\ifx\startcolumns\undefined \unexpanded\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
@@ -553,6 +620,8 @@
\v!middle=>\let\symalignleft\hfil,
\v!center=>\let\symalignleft\hfil]}
+\let\currentitemindenting\empty
+
\def\redostartitemgroup[#1][#2]%
{\setfalse\inlinelistitem % new, no indent (leftskip)
\setfalse\concatnextitem % new, concat
@@ -622,8 +691,11 @@
\fi
\dosetraggedcommand{\getitemparameter\currentitemlevel\c!align}\raggedcommand
\dosetsymalign{\getitemparameter\currentitemlevel\c!symalign}%
- \doifsomething{\getitemparameter\currentitemlevel\c!indenting}
- {\normalexpanded{\noexpand\setupindenting[\getitemparameter\currentitemlevel\c!indenting]}}%
+ %\doifsomething{\getitemparameter\currentitemlevel\c!indenting}
+ % {\normalexpanded{\noexpand\setupindenting[\v!reset,\v!yes,\getitemparameter\currentitemlevel\c!indenting]}}%
+ % {\normalexpanded{\noexpand\setupindenting[\getitemparameter\currentitemlevel\c!indenting]}}%
+ %
+ \edef\currentitemindenting{\getitemparameter\currentitemlevel\c!indenting}%
%
\setitemlevel{#1}% moved to here
\ifx\listitem\empty
@@ -689,7 +761,7 @@
% \item \input ward \item \input ward \item \input ward
% \stopitemize \blank
-\def\stopitemgroup
+\unexpanded\def\stopitemgroup
{\stopcollectitems
\ifconditional\textlistitem
\removeunwantedspaces\space\ignorespaces
@@ -734,40 +806,50 @@
\dorechecknextindentation}
\newtoks\itemgroupcommands
+\newtoks\itemgroupfinalizer
\def\itemgroupitem
- {\doitemgroupitem}
+ {\the\itemgroupfinalizer
+ \doitemgroupitem}
\def\itemgroupnoitem
- {\doitemgroupnoitem}
+ {\the\itemgroupfinalizer
+ \doitemgroupnoitem}
\def\itemgroupbutton[#1]%
- {\gdef\doitemdestination{#1}%
+ {\the\itemgroupfinalizer
+ \gdef\doitemdestination{#1}%
\itemgroupitem}
\def\itemgroupdummy
- {\itemgroupsymbol{\strut}\strut}
+ {\the\itemgroupfinalizer
+ \itemgroupsymbol{\strut}\strut}
\def\itemgroupsubitem
- {\settrue\sublistitem
+ {\the\itemgroupfinalizer
+ \settrue\sublistitem
\itemgroupitem}
\def\itemgroupsymbol#1%
- {\def\symsymbol{#1}%
+ {\the\itemgroupfinalizer
+ \def\symsymbol{#1}%
\settrue\symbollistitem
\itemgroupitem}
\def\itemgroupedge#1%
- {\itemgroupsymbol
+ {\the\itemgroupfinalizer
+ \itemgroupsymbol
{\calculatelistwidth\currentitemlevel
\hbox to \itemgrouplistwidth
{#1\hskip\getitemparameter\currentitemlevel\c!distance}}}
\def\itemgrouphead
- {\settrue\headlistitem\doitemgrouphead}
+ {\the\itemgroupfinalizer
+ \settrue\headlistitem\doitemgrouphead}
\def\itemgroupitems
- {\dosingleempty\doitemgroupitems}
+ {\the\itemgroupfinalizer
+ \dosingleempty\doitemgroupitems}
\def\doitemgroupitems[#1]%
{\itemgroupedge
@@ -775,7 +857,8 @@
\unskip}}
\def\itemgroupmargin#1%
- {\def\marsymbol
+ {\the\itemgroupfinalizer
+ \def\marsymbol
{\llap
{\dosetitemattributes\currentitemlevel\c!marstyle\c!marcolor{#1}%
\hskip\leftskip\hskip\leftmargindistance}}%
@@ -795,6 +878,16 @@
\appendtoks \letvalue\v!mar \itemgroupmargin \to \itemgroupcommands
% todo : \startitem .. \stopitem
+%
+% beware, we don't group (yet) as we want to keep the left/right skip
+%
+% \startitemize
+% \startitem \stopitem
+% some intermediate text that will properly indent
+% \startitem \stopitem
+% \stopitem
+%
+% so we need to keep that property
\appendtoks
\letvalue{\e!start\v!item}\itemgroupitem
@@ -869,7 +962,7 @@
\else
\scratchdimen\zeropoint
\fi
- \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hss}}% was: \hfill
+ \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}}% was: \hfill
\hskip\scratchdimen}
\def\optimizelistitemsbreak
@@ -897,6 +990,18 @@
\fi
\fi\fi}
+\def\dodosubitem
+ {\ifconditional\sublistitem\llap{+\enspace}\fi}
+
+\def\dodolapitem
+ {\llap
+ {\hbox to \itemgrouplistwidth
+ {\dodosubitem
+ \symalignleft
+ \box\itemgroupitembox % can already have a forced widt, only factor handled here
+ \hfil
+ \hskip\getitemparameter\currentitemlevel\c!distance}}}
+
\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
{\ifconditional\textlistitem
% begin of item
@@ -905,7 +1010,16 @@
\fi
\advance\noflistelements\plusone
\optimizelistitemsbreak
- \noindent
+ \setfalse\indentedfirstlistitem
+ \ifx\currentitemindenting\empty \else
+ \normalexpanded{\noexpand\setupindenting[\v!reset,\v!yes,\currentitemindenting]}%
+ \doifnot{\getitemparameter\currentitemlevel\c!alignsymbol}\v!yes
+ {\ifindentfirstparagraph\settrue\indentedfirstlistitem\fi}%
+ \fi
+ \dontleavehmode
+ \ifconditional\indentedfirstlistitem
+ \hskip-\parindent
+ \fi
\setbox\itemgroupitembox\hbox
{\ifconditional\headlistitem
\ifconditional\symbollistitem
@@ -920,25 +1034,34 @@
\dosetitemattributes\currentitemlevel\c!style\c!color{\listitem}%
\fi
\fi}%
- \ifconditional\fittinglistitems
- \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
- \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}%
- \fi
- \ifdim\currentitemmaxwidth>\zeropoint
- \setbox\itemgroupitembox\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\currentitemmaxwidth}{\box\itemgroupitembox}%
- \fi
- \fi
\doifsomething\doitemdestination
{\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}%
- \globallet\doitemdestination\empty
\itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax
+ \ifconditional\fittinglistitems
+ \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
+ \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}%
+ \fi
+ \ifdim\currentitemmaxwidth>\zeropoint
+ \setbox\itemgroupitembox\simplealignedbox
+ {\getitemparameter\currentitemlevel\c!itemalign}
+ {\dimexpr\currentitemmaxwidth+\getitemparameter\currentitemlevel\c!distance\relax}
+ {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}%
+ \fi
+ \else\ifdim\itemgroupaskedwidth>\zeropoint
+ \doifsomething{\getitemparameter\currentitemlevel\c!itemalign}
+ {\setbox\itemgroupitembox\simplealignedbox
+ {\getitemparameter\currentitemlevel\c!itemalign}
+ {\dimexpr\itemgroupaskedwidth+\getitemparameter\currentitemlevel\c!distance\relax}
+ {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}}%
+ \fi\fi
+ \globallet\doitemdestination\empty
% new, prevents loops when symbol is (not yet found) graphic
\ht\itemgroupitembox\strutheight
\dp\itemgroupitembox\strutdepth
% so that content differs per run (esp mp graphics afterwards)
\checkforrepeatedlistitem
\ifdim\itemgroupaskedwidth<\zeropoint\relax
- \llap{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hskip\leftmargindistance}%
+ \llap{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hskip\leftmargindistance}%
\else
\ifdim\itemgroupaskedwidth=\zeropoint\relax
\calculatelistwidth1%
@@ -946,29 +1069,25 @@
\calculatelistwidth\currentitemlevel
\fi
\ifconditional\textlistitem
- \hbox{\ifconditional\sublistitem+\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak
+ \hbox{\ifconditional\sublistitem+\enspace\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak
\else\ifconditional\inlinelistitem
- \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi\box\itemgroupitembox\hss}% was: \hfill
+ \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}% was: \hfill
\else\ifconditional\txtlistitem
\dodotxtitem
\else
- % todo: align+marge binnen de hbox
- \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+}\fi
- \symalignleft
- \box\itemgroupitembox\hfil
- \hskip\getitemparameter\currentitemlevel\c!distance% T h
- }}%
+ \dodolapitem
\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 ?
+ \ifconditional\indentedfirstlistitem
+ \hskip\parindent
+ \fi
\ignorespaces}
% For Wolfgang Schuster
@@ -995,7 +1114,7 @@
\def\checkforrepeatedlistitem
{\ifconditional\repeatlistitem
\ifx\currentrepeatstart\empty
- \edef\currentrepeatstart{\the\numexpr\currentitemlevel-1}%
+ \let\currentrepeatstart\currentitemlevel
\fi
\setbox\itemgroupitembox\hbox to \wd\itemgroupitembox{\hskip-\itemgroupaskedwidth\box\itemgroupitembox}% what a hack !
\fi}
@@ -1058,7 +1177,11 @@
\fi
\else
\ifconditional\textlistitem % was bugged: \inlinelistitem
- \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
+ \ifhmode
+ % WS: make the distance between items customizable, think about better default values -> see itemize-1.tex
+ \normalexpanded{\doassigntextitemdistance{\getitemparameter\currentitemlevel\c!textdistance}}% HH: moved out and made configurable (sort of)
+ \removeunwantedspaces\hskip\textitemdistance\relax
+ \fi
\else
\iteminbetweencommand
\fi
@@ -1076,12 +1199,33 @@
\marsymbol
\let\marsymbol\relax
\strut % added 11-08-99
-% \dohandleitemreference
\setfalse\concatnextitem % new, concat
\nobreak % else problems with intext items
\hskip\itemsignal % new, concat
\getitemparameter\currentitemlevel\c!command} % \defaultitemcommand
+% \startitemize[text][space=medium]
+% \item one \item two \item three
+% \stopitemize
+
+\setvalue{\??op:\??op:\c!textdistance:\v!none}%
+ {\def\textitemdistance{\zeropoint}}
+
+\def\doassigngiventextitemdistance#1%
+ {\assignvalue
+ {#1}%
+ \textitemdistance
+ {.5\interwordspace\!!plus.5\emwidth}%
+ {\interwordspace \!!plus \emwidth}%
+ {\emwidth \!!plus \interwordstretch\!!minus\interwordshrink}}
+
+\unexpanded\def\doassigntextitemdistance#1%
+ {\ifcsname\??op:\??op:\c!textdistance:#1\endcsname
+ \csname\??op:\??op:\c!textdistance:#1\endcsname
+ \else
+ \doassigngiventextitemdistance{#1}%
+ \fi}
+
\def\defaultitemcommand
{\EveryPar{\ignorespaces}% needed ?
\ignorespaces}
@@ -1113,6 +1257,8 @@
% the next solution accepts \head test \type{x{x}x} test ...
+\let\doenditemhead\relax
+
\def\complexdoitemgrouphead[#1]% beter in \complexdosom hangen met een if
{\ifconditional\firstlistitem\else\allowitembreak\fi
\ifconditional\packlistitem\else\itembeforeheadcommand\fi
@@ -1123,6 +1269,7 @@
\bgroup
\dosetitemattributes\currentitemlevel\c!headstyle\c!headcolor\empty
\ignorespaces
+ \itemgroupfinalizer{\enditemhead}%
\let\par\enditemhead} % brrrr but simple anyway
\def\enditemhead
@@ -1186,11 +1333,29 @@
\c!start=1,
\c!criterium=\v!all, % permits 0 and negative numbers
%\c!option=,
+ \c!textdistance=\v!big,
\c!command=\defaultitemcommand,
+ \c!indenting=\v!next,
+ %\c!alignsymbol=v!no,
\c!symbol=\currentitemlevel]
+% new:
+
+\setupitemgroups
+ [\c!step=.5em, % deals with broad
+ \c!distance=\zeropoint]
+
\setupitemgroups
- [\c!numberseparatorset=,
+ [\c!prefix=\v!no,
+% \c!prefixstopper=.,
+% \c!prefixseparatorset=,
+% \c!prefixconversion=,
+% \c!prefixconversionset=,
+% \c!prefixset=,
+% \c!prefixsegments=1:100,
+ \c!prefixconnector=.,
+ %
+ \c!numberseparatorset=,
\c!numberconversionset=,
\c!numberstopper=.,
\c!numbersegments=1]
diff --git a/Master/texmf-dist/tex/context/base/strc-lnt.mkiv b/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
index d0816cfc747..0df44294bdd 100644
--- a/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-lnt.mkiv
@@ -17,26 +17,13 @@
\unprotect
-\newcounter\linenotecounter
-\newtoks \collectedlinenotes
-\newif \iftracelinenotes
-
-\appendtoks
- \the\collectedlinenotes
-\to \everylinenumber
-
-\appendtoks
- \global\collectedlinenotes\emptytoks
-\to \beforeeverylinenumbering
+\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
- \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
- \ifnum\linenotelinenumber=\linenumber\relax
- \def\linenotelinenumber##1{#2}%
- \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]%
- \setnote[#1]{#3}%
- \fi
+ \def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
+ \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \setnote[ln:#1]{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -54,37 +41,30 @@
\def\dolinenote#1#2%
{\doglobal\increment\linenotecounter
- \doifreferencefoundelse{\??rr:\linenotecounter}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#2}\to\collectedlinenotes}
- \donothing
+ \dohandlelinenote{#1}{\linenotecounter}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\??rr:\linenotecounter]}}
+ \expanded{\someline[\linenotecounter]}}
\def\dostartlinenote#1[#2]#3%
- {\doifreferencefoundelse{\??rr:#2}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}%
- {\unknownreference{#2}}%
+ {\doglobal\increment\linenotecounter
+ \dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
- \startline[\??rr:#2]}
+ \startline[#2]}
\def\dostoplinenote#1[#2]%
- {\stopline[\??rr:#2]}
-
-% defining them
+ {\stopline[#2]}
-\def\definelinenote
+\unexpanded\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}}}
+ {\definenote[ln:#1][#2]%
+ \setuvalue {#1}{\dolinenote {#1}}%
+ \setuvalue{\e!start#1}{\dostartlinenote{#1}}%
+ \setuvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\def\setuplinenote % convenient
- {\setupnote}
+\unexpanded\def\setuplinenote[#1]% convenient
+ {\setupnote[ln:#1]}
% We predefine one, namely \type {\linenote} cum suis.
diff --git a/Master/texmf-dist/tex/context/base/strc-lst.lua b/Master/texmf-dist/tex/context/base/strc-lst.lua
index dd45e7f689d..fefbe52ce29 100644
--- a/Master/texmf-dist/tex/context/base/strc-lst.lua
+++ b/Master/texmf-dist/tex/context/base/strc-lst.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-lst'] = {
version = 1.001,
- comment = "companion to strc-lst.tex",
+ 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"
@@ -11,9 +11,13 @@ if not modules then modules = { } end modules ['strc-lst'] = {
-- section, metadata cache (internal then has to move up one level) or a
-- shared cache [we can use a fast and stupid serializer]
-local format, tonumber = string.format, tonumber
+local format, gmatch, gsub = string.format, string.gmatch, string.gsub
+local tonumber = tonumber
local texsprint, texprint, texwrite, texcount = tex.sprint, tex.print, tex.write, tex.count
-local insert, remove = table.insert, table.remove
+local concat, insert, remove = table.concat, table.insert, table.remove
+local lpegmatch = lpeg.match
+
+local trace_lists = false trackers.register("structure.lists", function(v) trace_lists = v end)
local ctxcatcodes = tex.ctxcatcodes
@@ -36,6 +40,7 @@ lists.internals = lists.internals or { }
lists.ordered = lists.ordered or { }
local variables = interfaces.variables
+local matching_till_depth, number_at_depth = sections.matching_till_depth, sections.number_at_depth
local function initializer()
-- create a cross reference between internal references
@@ -76,8 +81,7 @@ if job then
job.register('structure.lists.collected', structure.lists.tobesaved, initializer)
end
-local cached = { }
-local pushed = { }
+local cached, pushed = { }, { }
function lists.push(t)
local r = t.references
@@ -103,7 +107,7 @@ function lists.enhance(n)
if l then
--
l.directives = nil -- might change
- -- save in the right order (happen sat shipout)
+ -- save in the right order (happens at shipout)
lists.tobesaved[#lists.tobesaved+1] = l
-- default enhancer (cross referencing)
l.references.realpage = texcount.realpageno
@@ -125,7 +129,7 @@ function lists.pushnesting(i)
local name = r.metadata.name
local numberdata = r and r.numberdata
local n = (numberdata and numberdata.numbers[sections.getlevel(name)]) or 0
- insert(nesting, { number = n, name = name, result = lists.result })
+ insert(nesting, { number = n, name = name, result = lists.result, parent = r })
end
function lists.popnesting()
@@ -133,15 +137,30 @@ function lists.popnesting()
lists.result = old.result
end
-local function filter_collected(names, criterium, number, collected)
+-- will be split
+
+local function filter_collected(names, criterium, number, collected, nested)
local numbers, depth = documents.data.numbers, documents.data.depth
- local hash, result, all = { }, { }, not names or names == "" or names == variables.all
+ local hash, result, all, detail = { }, { }, not names or names == "" or names == variables.all, nil
+ names, criterium = gsub(names," ",""), gsub(criterium," ","")
+ if trace_lists then
+ logs.report("lists","filtering names: %s, criterium: %s, number: %s",names,criterium,number or "-")
+ end
if not all then
- for s in names:gmatch("[^, ]+") do
+ for s in gmatch(names,"[^, ]+") do -- sort of settings to hash
hash[s] = true
end
end
- if criterium == variables.all or criterium == variables.text then
+ if criterium == variables.intro then
+ -- special case, no structure yet
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and r.section == 0 then
+ result[#result+1] = v
+ end
+ end
+ elseif criterium == variables.all or criterium == variables.text then
for i=1,#collected do
local v = collected[i]
local r = v.references
@@ -156,26 +175,30 @@ local function filter_collected(names, criterium, number, collected)
end
end
elseif criterium == variables.current then
- for i=1,#collected do
- local v = collected[i]
- local r = v.references
- if r then
- local sectionnumber = jobsections.collected[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 hash[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
+ if depth == 0 then
+ return filter_collected(names,variables.intro,number,collected)
+ else
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then
+ local sectionnumber = jobsections.collected[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 hash[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
+ result[#result+1] = v
end
- end
- if ok then
- result[#result+1] = v
end
end
end
@@ -183,26 +206,32 @@ local function filter_collected(names, criterium, number, collected)
end
end
elseif criterium == variables.here then
- for i=1,#collected do
- local v = collected[i]
- local r = v.references
- if r then
- local sectionnumber = jobsections.collected[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 hash[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
+ -- this is quite dirty ... as cnumbers is not sparse we can misuse #cnumbers
+ if depth == 0 then
+ return filter_collected(names,variables.intro,number,collected)
+ else
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then
+ local sectionnumber = jobsections.collected[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+--~ print(#cnumbers, depth, table.concat(cnumbers))
+ if metadata and not metadata.nolist and (all or hash[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
+ result[#result+1] = v
end
- end
- if ok then
- result[#result+1] = v
end
end
end
@@ -210,26 +239,30 @@ local function filter_collected(names, criterium, number, collected)
end
end
elseif criterium == variables.previous then
- for i=1,#collected do
- local v = collected[i]
- local r = v.references
- if r then
- local sectionnumber = jobsections.collected[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 hash[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
+ if depth == 0 then
+ return filter_collected(names,variables.intro,number,collected)
+ else
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then
+ local sectionnumber = jobsections.collected[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 hash[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
+ result[#result+1] = v
end
- end
- if ok then
- result[#result+1] = v
end
end
end
@@ -239,33 +272,47 @@ local function filter_collected(names, criterium, number, collected)
elseif criterium == variables["local"] then -- not yet ok
local nested = nesting[#nesting]
if nested then
- return filter_collected(names,nested.name,nested.number,collected)
+ return filter_collected(names,nested.name,nested.number,collected,nested)
elseif sections.autodepth(documents.data.numbers) == 0 then
return filter_collected(names,variables.all,number,collected)
else
return filter_collected(names,variables.current,number,collected)
end
else -- sectionname, number
+ -- not the same as register
local depth = sections.getlevel(criterium)
- local number = tonumber(number) or 0
- for i=1,#collected do
- local v = collected[i]
- local r = v.references
- if r then
- local sectionnumber = jobsections.collected[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 hash[metadata.name or false]) and #cnumbers >= depth and cnumbers[depth] == number then
- if metadata and not metadata.nolist and (all or hash[metadata.name or false]) and #cnumbers >= depth and (number == 0 or cnumbers[depth] == number) then
- result[#result+1] = v
+ local number = tonumber(number) or number_at_depth(depth) or 0
+ if trace_lists then
+ local t = sections.numbers()
+ detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,(#t>0 and concat(t,".",1,depth)) or "?",#collected)
+ end
+ if number > 0 then
+ local parent = nested and nested.parent and nested.parent.numberdata.numbers -- so local as well as nested
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then
+ local sectionnumber = jobsections.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 matching_till_depth(depth,cnumbers,parent) then
+ result[#result+1] = v
+ end
end
end
end
end
end
end
+ if trace_lists then
+ if detail then
+ logs.report("lists","criterium: %s, %s, found: %s",criterium,detail,#result)
+ else
+ logs.report("lists","criterium: %s, found: %s",criterium,#result)
+ end
+ end
return result
end
@@ -283,6 +330,7 @@ function lists.process(...)
local r = lists.result[i]
local m = r.metadata
texsprint(ctxcatcodes,format("\\processlistofstructure{%s}{%s}{%i}",m.name,m.kind,i))
+--~ context.processlistofstructure(m.name,m.kind,i)
end
end
@@ -290,12 +338,14 @@ function lists.analyze(...)
lists.result = lists.filter(...)
end
-function lists.userdata(name,r,tag) -- to tex
- local str = lists.result[r]
- str = str and str.userdata
- str = str and str[tag]
- if str then
- texsprint(ctxcatcodes,str)
+function lists.userdata(name,r,tag) -- to tex (todo: xml)
+ local result = lists.result[r]
+ if result then
+ local userdata, metadata = result.userdata, result.metadata
+ local str = userdata and userdata[tag]
+ if str then
+ texsprint(metadata and metadata.catcodes or ctxcatcodes,str)
+ end
end
end
@@ -310,7 +360,7 @@ function lists.size()
texprint(#lists.result)
end
-function lists.location(name,n)
+function lists.location(n)
local l = lists.result[n]
texsprint(l.references.internal or n)
end
@@ -330,7 +380,6 @@ function lists.title(name,n,tag) -- tag becomes obsolete
local titledata = data.titledata
if titledata then
helpers.title(titledata[tag] or titledata.list or titledata.title or "",data.metadata)
---~ texsprint(ctxcatcodes,titledata[tag] or titledata.list or titledata.title or "")
end
end
end
@@ -362,6 +411,7 @@ function lists.savedprefixednumber(name,n)
helpers.prefix(data,data.prefixdata)
local numberdata = data.numberdata
if numberdata then
+--~ print(name,n,table.serialize(numberdata))
sections.typesetnumber(numberdata,"number",numberdata or false)
end
end
@@ -407,7 +457,30 @@ function lists.prefixednumber(name,n,prefixspec,numberspec)
helpers.prefix(data,prefixspec)
local numberdata = data.numberdata
if numberdata then
- sections.typesetnumber(numberdata,"number",spec or false,numberdata or false)
+--~ print(table.serialize(numberspec))
+ sections.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 jobreferences.specials.order(var,actions) -- jobreferences.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 jobreferences.specials.page(var,actions)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/strc-lst.mkiv b/Master/texmf-dist/tex/context/base/strc-lst.mkiv
index 440047a423a..413052882e5 100644
--- a/Master/texmf-dist/tex/context/base/strc-lst.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-lst.mkiv
@@ -91,7 +91,7 @@
\endgroup}
\def\structurelistlocation
- {\ctxlua{structure.lists.location("\currentlist",\currentlistindex)}}
+ {\ctxlua{structure.lists.location(\currentlistindex)}}
\def\structurelistpagenumber
{\ctxlua{structure.lists.prefixedpage(
@@ -107,6 +107,7 @@
{
prefix = "\listparameter\c!pageprefix",
conversionset = "\listparameter\c!pageconversionset",
+ starter = \!!bs\listparameter\c!pagestarter\!!es,
stopper = \!!bs\listparameter\c!pagestopper\!!es,
}
)}}
@@ -126,7 +127,7 @@
% \appendtoks
% \to \everystructurelist
-\def\placestructurelist#1#2#3%
+\unexpanded\def\placestructurelist#1#2#3% hm ... [][][]
{\ctxlua{structure.lists.process("#1","#2","#3")}}
\def\analysestructurelist#1#2#3%
@@ -181,16 +182,20 @@
\currentlist
\structurelistlocation
\structurelistgenericnumber
- \structurelistgenerictitle
+ \structurelistgenerictitle % hm, can end up in message (volkers test)
\structurelistpagenumber
\structurelistrealpagenumber}
% so far (todo: also recursive)
\def\listalternativeparameter#1%
- {\csname\??li\??li\listparameter\c!alternative#1\endcsname}
+ {\ifcsname\??li\??li\listparameter\c!alternative#1\endcsname
+ \csname\??li\??li\listparameter\c!alternative#1\endcsname
+ \else
+ \listparameter{#1}%
+ \fi}
-\def\setuplistalternative[#1]%
+\unexpanded\def\setuplistalternative[#1]%
{\dodoubleargument\getparameters[\??li\??li#1]}
\def\listfill {\listalternativeparameter\c!command }
@@ -208,14 +213,20 @@
\def\listdots{\leaders\hbox to .5em{\hss.\hss}\hfill}
-\setvalue{\??li\c!alternative}{\getvalue{\??li\c!alternative b}}
-\getvalue{\??li\c!alternative}
+% \setvalue{\??li\c!alternative}{\getvalue{\??li\c!alternative b}} % ?
+% \getvalue{\??li\c!alternative} % ?
+
+\def\checklistexistence#1%
+ {\ifcsname\??li#1\s!parent\endcsname \else
+ \letvalue{\??li#1\s!parent}\??li
+ \fi}
\def\dosetuplist[#1][#2]% slow -)
- {\def\docommand##1{\getparameters[\??li##1][#2]}%
+ {\checklistexistence{#1}%
+ \def\docommand##1{\getparameters[\??li##1][#2]}%
\processcommalist[#1]\docommand}
-\def\setuplist
+\unexpanded\def\setuplist
{\dodoubleargument\dosetuplist}
\def\dodefinelist[#1][#2][#3]%
@@ -226,7 +237,7 @@
{\getparameters[\??li#1][\s!parent=\??li]}
{\getparameters[\??li#1][\s!parent=\??li#2,#3]}}}
-\def\setuplists % new, but not for users (hardly handy)
+\unexpanded\def\setuplists % new, but not for users (hardly handy)
{\dodoubleargument\getparameters[\??li]}
\setuplists
@@ -266,17 +277,20 @@
\c!limittext=\@@kolimittext,
%\c!sectionseparatorset=,
%\c!sectionconversionset=,
+ %\c!sectionstarter=,
%\c!sectionstopper=,
%\c!sectionset=,
%\c!sectionsegments=,
%\c!prefix=\v!no,
%\c!prefixseparatorset=,
%\c!prefixconversionset=,
+ %\c!prefixstarter=.,
%\c!prefixstopper=.,
%\c!prefixset=,
%\c!prefixsegments=,
%\c!pageseparatorset=,
%\c!pageconversionset=,
+ %\c!pagestarter=,
%\c!pagestopper=,
%\c!expansion=,
% \c!prefixconnector=., % maybe inherit from setupheads
@@ -284,13 +298,13 @@
% \c!pageprefixconnector=\listparameter\c!prefixconnector,
]%\c!pagesegments=2:2]
-\def\definelist
+\unexpanded\def\definelist
{\dotripleempty\dodefinelist}
-\def\placelist
+\unexpanded\def\placelist
{\dodoubleempty\doplacelist}
-\def\placerawlist
+\unexpanded\def\placerawlist
{\dodoubleempty\doplacerawlist}
\def\dobeginoflist
@@ -355,11 +369,11 @@
\utilitydonetrue \setsystemmode \v!list
\fi}
-\def\systemsuppliedchapter {\getvalue{\v!chapter}} % brrr
-\def\systemsuppliedtitle {\getvalue{\v!title}} % brrr
+\unexpanded\def\systemsuppliedchapter {\getvalue{\v!chapter}} % brrr
+\unexpanded\def\systemsuppliedtitle {\getvalue{\v!title}} % brrr
\def\dodocompletelist[#1][#2][#3]% enkelvoud, meervoud, instellingen
- {\normalexpanded{\noexpand\systemsuppliedtitle[#2]{\noexpand\headtext{#2}}}% expansion needed for v! vs french !
+ {\normalexpanded{\systemsuppliedtitle[#2]{\noexpand\headtext{#2}}}% expansion needed for v! vs french !
\doplacelist[#1][#3]}
\def\docompletelist[#1][#2]%
@@ -433,6 +447,7 @@
{% prefix = no, none, yes
\strut
\doif{\listparameter\c!label}\v!yes{\leftlabeltext\currentlist}% we can use the new command that does left and right
+ \listparameter\c!starter
\currentlistnumber
\listparameter\c!stopper
\doif{\listparameter\c!label}\v!yes{\rightlabeltext\currentlist}}
@@ -444,10 +459,12 @@
\strut
\doifelse{\listparameter\c!label}\v!yes
{\leftlabeltext\currentlist
+ \listparameter\c!starter
\currentlistnumber
\listparameter\c!stopper
\rightlabeltext\currentlist}
- {\currentlistnumber
+ {\listparameter\c!starter
+ \currentlistnumber
\listparameter\c!stopper}}
\def\listsymbol@unknown
@@ -481,7 +498,7 @@
% \definelistplacement[MyListItem][none]#1#2#3%
% {(#1) (#2) (#3)}
-\def\definelistplacement
+\unexpanded\def\definelistplacement
{\dodoubleempty\dodefinelistplacement}
\def\dodefinelistplacement[#1][#2]%
@@ -531,12 +548,13 @@
{[\currentlist: #3 -- #4 -- #5]}}
\def\domakelistelement#1#2#3#4% ref internal command data
- {\dontleavehmode
- \doifnot{\listparameter\c!interaction}{#1}\locationfalse
- \iflocation
- \directgotobox{\setlocationcolor\??ia#4}[internal(#2)]%
+ {\dontleavehmode
+ \iflocation % we cannot tewak \iflocation as we nest
+ \doifelse{\listparameter\c!interaction}{#1}
+ {\directgoto{\setlocationcolor\??ia#4}[internal(#2)]}% was \directgotobox
+ {#3{#4}}%
\else
- #3{#4}%
+ #3{#4}%
\fi}
\def\dodofreelistelement#1#2#3#4#5#6#7#8%
@@ -601,11 +619,8 @@
\!!widthc\zeropoint}
{\!!widtha\listparameter\c!width}}
{\!!widtha\listparameter\c!width}}%
- \getvalue{\??li\c!alternative\listparameter\c!alternative}%
+% \getvalue{\??li\c!alternative\listparameter\c!alternative}% ?
\endgraf
- \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
\domakelistelement\v!all{#2}\hbox
{\setlocalhsize
@@ -655,6 +670,7 @@
\leavevmode
\box2\relax
\hskip\dimen2
+\domakelistelement\v!text{#2}\firstofoneargument{%
\bgroup
\donestedlistattributes\c!textstyle\c!textcolor
{\let\\=\newlineinlist
@@ -663,6 +679,7 @@
\limitatedlistentry{#4}}%
%\carryoverpar % new otherwise wrong linespacing
\egroup
+}%
\ifdim\wd4=\zeropoint\relax % \ifvoid4
% \ifdim\!!widtha<\hsize \hfill\strut \fi % spoils align
\else
@@ -711,17 +728,20 @@
\ifvmode
\noindent\leavevmode % leavevmode ? ? ?
\fi
+%% actually, the next can be supported now (will be enabled when I have time to test it)
\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}%
+%%
\setbox4\hbox
{\doif{\listparameter\c!pagenumber}\v!yes
{\doifsomething{#5}
{\domakelistelement\v!pagenumber{#2}\hbox
{\donestedlistattributes\c!pagestyle\c!pagecolor
{\listparameter\c!pagecommand{#5}}}}}}%
- \doif{\listparameter\c!headnumber}\v!yes
+%% \domakelistelement\v!all{#2}\firstofoneargument{%
+ \doif{\listparameter\c!headnumber}\v!yes
{\donetrue
\doifnothing{#3}{\doifnothing{\listparameter\c!symbol}\donefalse}%
% == \doifnothing{#3\listparameter\c!symbol}\donefalse
@@ -736,17 +756,20 @@
\nobreak
\fi}%
\tolerance3500 % niet zomaar veranderen
+%% \domakelistelement\v!text{#2}\firstofoneargument{%
\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
@@ -811,7 +834,7 @@
\def\combinedlistparameter#1{\csname\??ih\currentcombinedlist#1\endcsname}
-\def\setupcombinedlist
+\unexpanded\def\setupcombinedlist
{\dodoubleargument\dosetupcombinedlist}
\def\dosetupcombinedlist[#1][#2]%
@@ -819,7 +842,7 @@
\edef\currentcombinedlist{#1}%
\normalexpanded{\noexpand\setuplist[\combinedlistparameter\c!list]}[#2]}
-\def\definecombinedlist
+\unexpanded\def\definecombinedlist
{\dotripleempty\dodefinecombinedlist}
\def\dodefinecombinedlist[#1][#2][#3]%
@@ -830,7 +853,7 @@
\setvalue{\e!place#1}{\dodoubleempty\doplacecombinedlist[#1]}%
\setvalue{\e!complete#1}{\dodoubleempty\docompletecombinedlist[#1]}}
-\def\placecombinedlist
+\unexpanded\def\placecombinedlist
{\dodoubleempty\doplacecombinedlist}
\def\doplacecombinedlist[#1][#2]% we can move much of the analysis to lua
@@ -850,7 +873,7 @@
\dosetlistmode}
\def\docompletecombinedlist[#1][#2]%
- {\normalexpanded{\noexpand\systemsuppliedtitle[#1]{\noexpand\headtext{#1}}}% expansion due to v! vs french !
+ {\normalexpanded{\systemsuppliedtitle[#1]{\noexpand\headtext{#1}}}% expansion due to v! vs french !
\doplacecombinedlist[#1][#2]}
% lists that have a number/title are kind of generic and can share code
@@ -872,6 +895,7 @@
prefix = "\listparameter\c!prefix",
separatorset = "\listparameter\c!prefixseparatorset",
conversionset = "\listparameter\c!prefixconversionset",
+ starter = \!!bs\listparameter\c!prefixstarter\!!es,
stopper = \!!bs\listparameter\c!prefixstopper\!!es,
set = "\listparameter\c!prefixset",
segments = "\listparameter\c!prefixsegments",
@@ -880,6 +904,7 @@
{
separatorset = "\listparameter\c!numberseparatorset",
conversionset = "\listparameter\c!numberconversionset",
+ starter = \!!bs\listparameter\c!numberstarter\!!es,
stopper = \!!bs\listparameter\c!numberstopper\!!es,
segments = "\listparameter\c!numbersegments",
} )}}
@@ -900,7 +925,7 @@
%
% \definesystemvariable {ll} % ListLength
%
-% \def\setupremaininglistlength[#1]%
+% \unexpanded\def\setupremaininglistlength[#1]%
% {\getparameters[\??ll][#1]%
% \globallet\listlengthcounter\!!zerocount}
%
diff --git a/Master/texmf-dist/tex/context/base/strc-mar.lua b/Master/texmf-dist/tex/context/base/strc-mar.lua
index f0d6df314a1..8ee814d7743 100644
--- a/Master/texmf-dist/tex/context/base/strc-mar.lua
+++ b/Master/texmf-dist/tex/context/base/strc-mar.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-mar'] = {
version = 1.001,
- comment = "companion to strc-mar.tex",
+ 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"
diff --git a/Master/texmf-dist/tex/context/base/strc-mar.mkiv b/Master/texmf-dist/tex/context/base/strc-mar.mkiv
index 8dbbb232caf..bb87051e026 100644
--- a/Master/texmf-dist/tex/context/base/strc-mar.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-mar.mkiv
@@ -73,7 +73,7 @@
\clearmarks#1%
\fi}
-\def\definenewmark#1%
+\unexpanded\def\definenewmark#1%
{\ifcsname\string#1:m\endcsname\else
\@EA\@EA\@EA\newcount \markstatecs #1\global\markstatecs#1\plusone
\@EA\@EA\@EA\renewmarks\markautocs #1%
@@ -138,8 +138,10 @@
\def\checkedcurrentmarks{\markcurrentcs} % #1 shared current mark
-\let\currentsplittopmarknumber\currenttopmarknumber
-\let\normalsplittopmarks \normaltopmarks
+\let\currentsplitfirstmarknumber\currentfirstmarknumber
+\let\currentsplittopmarknumber \currenttopmarknumber
+\let\currentsplitbotmarknumber \currentbotmarknumber
+\let\normalsplittopmarks \normaltopmarks
\def\uncheckedautotopmark {\normaltopmarks \markautocs} % #1
\def\uncheckedautofirstmark {\normalfirstmarks \markautocs} % #1
@@ -223,7 +225,7 @@
\def\dowithmarkcommandtwo#1#2#3% \command {mark} {mark}
{\expandafter#1\csname\??mk:\markingcoupling{#2}\expandafter\endcsname\csname\??mk:\markingcoupling{#3}\endcsname}
-\def\setupmarking
+\unexpanded\def\setupmarking
{\dodoubleargument\dosetupmarking}
\def\dosetupmarking[#1][#2]%
@@ -243,7 +245,7 @@
\let\alldefinedmarks\empty
-\def\definemarking
+\unexpanded\def\definemarking
{\dodoubleempty\dodefinemarking}
\def\dodefinemarking[#1][#2]%
@@ -276,7 +278,7 @@
\def\relatemarking[#1]#2[#3]% define 1 as child of 2
{\dowithmarkcommandtwo\addmarkreset{#1}{#3}}
-\def\definerawmarking[#1]%
+\unexpanded\def\definerawmarking[#1]%
{\dododefinemarking[#1][#1]%
\getgparameters[\??mk#1][\c!limittext=]} % global !
diff --git a/Master/texmf-dist/tex/context/base/strc-mat.lua b/Master/texmf-dist/tex/context/base/strc-mat.lua
index ba64bf9db4c..291cc8845d6 100644
--- a/Master/texmf-dist/tex/context/base/strc-mat.lua
+++ b/Master/texmf-dist/tex/context/base/strc-mat.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-mat'] = {
version = 1.001,
- comment = "companion to strc-mat.tex",
+ comment = "companion to strc-mat.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/strc-mat.mkiv b/Master/texmf-dist/tex/context/base/strc-mat.mkiv
index 097b1d71059..2064db2c586 100644
--- a/Master/texmf-dist/tex/context/base/strc-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-mat.mkiv
@@ -15,9 +15,11 @@
\registerctxluafile{strc-mat}{1.001}
+% we have potential for captions
+
\unprotect
-\definestructureconversionset[\v!formula][number,characters]
+\definestructureconversionset[\v!formula][numbers,characters]
\setupformulas
[%\c!way=\@@nrway,
@@ -46,117 +48,208 @@
\definestructurecounter
[\v!formula]
-\setupstructurecounter
- [\v!formula]
- [\c!numberconversionset=\v!formula]
+% \setupstructurecounter
+% [\v!formula]
+% [\c!numberconversionset=\v!formula]
+
+\presetstructurecountersetup\setupformulas\sharedstructurecounterparameter
+
+\appendtoks
+% \dostructurecountersetup\currentformula\formulaparameter
+% \docheckstructurecountersetup\currentformula
+ \dostructurecountersetup\v!formula\formulaparameter
+% \docheckstructurecountersetup\v!formula
+\to \everysetupformulas
+
+\setupformulas
+ [\c!numberconversionset=\v!formula] % why forgotten
-\def\storecurrentformulanumber#1#2#3#4% ref, todo:str, \sync % todo: title etc (like float)
+\def\storecurrentformulanumber#1#2#3#4#5% ref, todo:str, \sync % todo: title etc (like float)
{\dostructurecountercomponent
{formula}%
- \getfloatparameters
- \formulaparameter
- \detokenizedformulaparameter
- \relax
- \relax
- \relax
- [\c!name=\currentformula,\s!counter=\currentformula,%
- \s!hascaption=\v!yes,\s!hasnumber=\v!yes,\s!hastitle=\v!yes,%
+ \getformulaparameters \formulaparameter \detokenizedformulaparameter
+ \relax \relax \relax
+% [\c!name=\currentformula,\s!counter=\currentformula,%
+ [\c!name=\v!formula,\s!counter=\v!formula,%
+ \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,%\s!haslevel=#6,%
+ \s!hasnumber=\v!no,%
\c!reference=#1,\c!title=,\c!bookmark=]%
[#2]%
- \globallet\currentformulanumber\laststructurecounternumber
- \globallet#3\laststructurecountersynchronize
- \globallet#4\laststructurecounterattribute}
+ \globallet#3\laststructurecounternumber
+ \globallet#4\laststructurecountersynchronize
+ \globallet#5\laststructurecounterattribute}
-\def\thecurrentformulanumber
- {%\ifnoformulacaption \else \ifnoformulanumber \else
- \labeltexts\currentformula{\convertedstructurecounter[formula]}% ! ! todo: use a lua call instead
- }%\fi \fi}
+\newif\ifnoformulanumber
-\def\placecurrentformulanumber
- {\currentformulassynchronize \currentformulasattribute % todo
- \currentformulasynchronize \currentformulasattribute % todo
- \currentsubformulasynchronize \currentsubformulaattribute % todo
- \thecurrentformulanumber}
+\newconditional\handleformulanumber
+\newconditional\incrementformulanumber
-\def\doformulanumber
- {\dotripleempty\dodoformulanumber}
+\newtoks\everyresetformulas
-\def\dodoformulanumber[#1][#2][#3]%
- {\doquadruplegroupempty\dododoformulanumber{#1}{#2}{#3}}
+\newconditional\insideplaceformula
+\newconditional\insideplacesubformula
+\newconditional\insideformulas
+\newconditional\insidesubformulas
+
+% 0=unset, 1=forced, 2=none, 3=reference
+
+\def\handleplaceformulanumbering % place formula
+ {\settrue\handleformulanumber
+ \docheckformulareference\placeformulanumbermode\currentplaceformulareference
+ \glet\doplaceformulanumber \doplaceformulanumberindeed
+ \glet\donestedformulanumber\donestedformulanumberindeed}
+
+\def\handleformulasnumbering % formulas
+ {\docheckformulareference\formulasnumbermode\currentformularesference}
+
+\def\handlesubformulasnumbering % sub formulas
+ {\docheckformulareference\subformulasnumbermode\currentsubformulasreference
+ \doincrementsubstructurecounter[\v!formula][1]% always
+ \storecurrentformulanumber
+ \currentsubformulasreference
+ \empty
+ \currentsubformulasnumber
+ \currentsubformulassynchronize
+ \currentsubformulasattribute
+ }
+
+\def\tracedformulamode
+ {\hbox{\quad\tt\txx[\number\placeformulanumbermode,\number\formulasnumbermode,\number\subformulasnumbermode,\number\nestedformulanumbermode]}}
+
+\unexpanded\def\placecurrentformulanumber
+ {\rm % nodig ?
+ \doif{\formulaparameter\c!location}\v!right{\hskip\formulaparameter\c!distance}%
+ \formulaparameter\c!numbercommand
+ {\dosetformulaattributes\c!numberstyle\c!numbercolor
+ \strut
+ \formulaparameter\c!left
+ \labeltexts\v!formula{\ignorespaces\doplacecurrentformulanumber\unskip}%
+ \formulaparameter\c!right}%
+ \doif{\formulaparameter\c!location}\v!left{\hskip\formulaparameter\c!distance}}
+
+\def\doplacecurrentformulanumber
+ {\dohandlecurrentformulareferences
+ %\currentformulasattribute % todo
+ %\currentformulasattribute % todo
+ %\currentsubformulaattribute % todo
+ \labeltexts\currentformula{\doconvertedstructurecounter[\v!formula][]}}
+
+\appendtoks
+ \glet\currentplaceformulasynchronize \relax
+ \glet\currentformulassynchronize \relax
+ \glet\currentsubformulassynchronize \relax
+ \glet\currentnestedformulasynchronize\relax
+ \let\currentformula\empty
+\to \everyresetformulas
+
+\def\dohandlecurrentformulareferences
+ {\ifnum\placeformulanumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentplaceformulareference
+ \empty
+ \currentplaceformulanumber
+ \currentplaceformulasynchronize
+ \currentplaceformulaattribute
+ \currentplaceformulasynchronize
+ \glet\currentplaceformulasynchronize\relax
+ \fi
+ \ifnum\formulasnumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentformulasreference
+ \empty
+ \currentformulasnumber
+ \currentformulassynchronize
+ \currentformulasattribute
+ \currentformulassynchronize
+ \glet\currentformulassynchronize\relax
+ \fi
+ \ifnum\subformulasnumbermode=\plusthree
+ \currentsubformulassynchronize
+ \glet\currentsubformulassynchronize\relax
+ \fi
+ \ifnum\nestedformulanumbermode=\plusthree
+ \storecurrentformulanumber
+ \currentnestedformulareference
+ \empty
+ \currentnestedformulanumber
+ \currentnestedformulasynchronize
+ \currentnestedformulaattribute
+ \currentnestedformulasynchronize
+ \glet\currentnestedformulasynchronize\relax
+ \fi}
-\let\subformulasreference\empty % temp hack
+\let\currentformulasreference \empty \let\currentformulassuffix \empty
+\let\currentformulareference \empty \let\currentformulasuffix \empty
+\let\currentsubformulareference \empty \let\currentsubformulasuffix \empty
+\let\currentnestedformulareference\empty \let\currentnestedformulasuffix\empty
\let\currentformulasynchronize \relax \let\currentformulaattribute \relax
\let\currentsubformulasynchronize\relax \let\currentsubformulaattribute\relax
\let\currentformulassynchronize \relax \let\currentformulasattribute \relax
-\def\dododoformulanumber#1#2#3#4% (#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub)
- {\hbox\bgroup
- \ifconditional\handleformulanumber
- \ifconditional\incrementformulanumber
+\def\dohandleformulanumbering
+ {\doincrementsubstructurecounter[\v!formula][1]%
+ \doiftext\currentplaceformulasuffix{\setsubstructurecounterown[\v!formula][2]{\currentplaceformulasuffix}}%
+ \placecurrentformulanumber}
+
+\def\dohandlesubformulanumbering
+ {\doiftextelse\currentsubformulasuffix
+ {\setsubstructurecounterown[\v!formula][2]{\currentsubformulasuffix}}
+ {\doincrementsubstructurecounter[\v!formula][2]}%
+ \placecurrentformulanumber}
+
+\def\dododoformulanumber
+ {\ifconditional\handleformulanumber
+ \hbox\bgroup
+ % main counter
\ifconditional\insidesubformulas
- \incrementsubstructurecounter[\v!formula][2]%
+ % nothing
\else
- \incrementstructurecounter[\v!formula]%
+ \ifcase\formulasnumbermode
+ \ifcase\placeformulanumbermode
+ \dohandleformulanumbering
+ \or
+ \dohandleformulanumbering
+ \or
+ % nothing
+ \or
+ \dohandleformulanumbering
+ \fi
+ \or
+ \dohandleformulanumbering
+ \or
+ % nothing
+ \or
+ \dohandleformulanumbering
+ \fi
\fi
- \fi
- %
- % main counter
- \setbox0\hbox{\ignorespaces#2\unskip}%
- \ifdim\wd0>\zeropoint
- \setsubstructurecounterown[\v!formula][2]{#2}% \detokenize?
- \fi
- \edef\currentformulareference{#1}%
- \ifx\currentformulareference\empty
- \glet\currentformulasynchronize\relax
- \glet\currentformulaattribute \relax
- \else
- \storecurrentformulanumber\currentformulareference\empty\currentformulasynchronize\currentformulaattribute
- \fi
- % subcounter
- \setbox0\hbox{\ignorespaces#4\unskip}%
- \ifdim\wd0>\zeropoint
- \setsubstructurecounterown[\v!formula][2]{#4}% \detokenize?
- \fi
- \edef\currentsubformulareference{#3}%
- \ifx\currentsubformulareference\empty
- \glet\currentsubformulasynchronize\relax
- \glet\currentsubformulaattribute \relax
- \else
- \storecurrentformulanumber\currentsubformulareference\empty\currentsubformulasynchronize\currentsubformulaattribute
- \fi
- %
- \rm % nodig ?
- \doif{\formulaparameter\c!location}\v!right{\hskip\formulaparameter\c!distance}%
- \formulaparameter\c!numbercommand
- {\dosetformulaattributes\c!numberstyle\c!numbercolor
- \strut
- \formulaparameter\c!left
- \labeltexts\v!formula{\ignorespaces\placecurrentformulanumber\unskip}%
- \formulaparameter\c!right}%
- \doif{\formulaparameter\c!location}\v!left{\hskip\formulaparameter\c!distance}%
- \fi
- \egroup}
-
-\let\donestedformulanumber\gobbletwoarguments
+ % subcounter
+ \ifconditional\insidesubformulas
+ \ifcase\subformulasnumbermode
+ % nothing
+ \or
+ \dohandlesubformulanumbering
+ \or
+ % nothing
+ \or
+ \dohandlesubformulanumbering
+ \fi
+ \fi
+ %\rlap{\tracedformulamode}%
+ \egroup
+ \fi}
\definelist[\v!formula]
-\global\let\doflushformulalistentry\gobbleoneargument
-
-\def\setformulalistentry#1%
- {\gdef\doflushformulalistentry##1%
- {\normalexpanded{\noexpand\writetolist[\v!formula]{##1}}{#1}%
- \global\let\doflushformulalistentry\gobbleoneargument}}
-
-\newconditional\handleformulanumber
-\newconditional\incrementformulanumber
-\newconditional\insidesubformulas
+\appendtoks
+ \global\setfalse\insideplaceformula
+ \global\setfalse\insideplacesubformula
+% \global\setfalse\insideformulas
+% \global\setfalse\insidesubformulas
+\to \everyresetformulas
\newif\ifinformula
-\let\doplaceformulanumber\empty
-
%D We need a hook into the plain math alignment macros
%D
%D \starttyping
@@ -168,13 +261,13 @@
%D Otherwise we get a missing \type {$$} error reported.
\def\resetdisplaymatheq
- {\let\normalleqno\relax \let\leqno\relax
- \let\normalreqno\relax \let\eqno \relax
+ {\let\normalleqno\gobbleoneargument \let\leqno\gobbleoneargument
+ \let\normalreqno\gobbleoneargument \let\eqno \gobbleoneargument
\let\doplaceformulanumber\empty}
%D
-\def\defineformula
+\unexpanded\def\defineformula
{\dodoubleempty\dodefineformula}
\def\dodefineformula[#1][#2]%
@@ -184,7 +277,7 @@
\setvalue{\e!start#1\v!formula}{\dostartformula{#1}}%
\setvalue{\e!stop #1\v!formula}{\dostopformula}}}
-\def\defineformulaalternative
+\unexpanded\def\defineformulaalternative
{\dotripleargument\dodefineformulaalternative}
\def\dodefineformulaalternative[#1][#2][#3]%
@@ -227,7 +320,7 @@
\def\subformulaparameter#1{\ifcname\??fn#1\endcsname\cname\??fn#1\endcsname\fi}
-\def\setupsubformulas
+\unexpanded\def\setupsubformulas
{\dodoubleargument\getparameters[\??fn]}
\setupsubformulas
@@ -255,27 +348,6 @@
\newdimen\lastlinewidth
-% 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}
-
\abovedisplayskip \zeropoint
\abovedisplayshortskip \zeropoint % evt. 0pt minus 3pt
\belowdisplayskip \zeropoint
@@ -286,13 +358,6 @@
% 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\forgetdisplayskips % to do
{\abovedisplayskip \zeropoint
\belowdisplayskip \zeropoint
@@ -308,7 +373,6 @@
\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]}}
@@ -316,26 +380,26 @@
\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\setpredisplaysize
+% {\predisplaysize\lastlinewidth\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
+ %\setlocalhsize
+ %\displaywidth\localhsize
\ifdim\hangindent>\zeropoint
\advance\displayindent\hangindent
\else
@@ -344,8 +408,6 @@
\advance\displaywidth\dimexpr-\displayindent-\rightdisplayskip-\rightdisplaymargin\relax
\hsize\displaywidth} % new, else overfull in itemize
-\newif\ifoptimizedisplayspacing
-
\def\dostartformula#1%
{\dodoubleempty\dodostartformula[#1]}
@@ -353,8 +415,6 @@
\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
@@ -363,12 +423,7 @@
%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
+ {\bgroup % HERE
\def\currentformula{#1}%
\the\everybeforedisplayformula
\formulaparskip\parskip
@@ -391,13 +446,6 @@
\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}
@@ -414,100 +462,52 @@
\def\dostopformula
{\doplaceformulanumber
\getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
- \resetlastlinewidth
\nonoindentation
\checknextindentation[\formulaparameter\c!indentnext]%
\egroup
\hangafter\minusone % added for side floats
\hangindent\zeropoint % added for side floats
\setfalse\handleformulanumber
+ \the\everyresetformulas
\dorechecknextindentation} % here ?
-\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
- \prevdepth-\maxdimen % texbook pagina 79-80
- % otherwise problems at the top of a page
- \verticalstrut
- \vskip-\struttotal
- \vskip-\baselineskip
- \fi
+%D \starttyping
+%D % test \par % no preceding hlist
+%D % $$x$$ % preceding hlist
+%D % \noindent $$x$$ % no preceding hlist
+%D \startformula x \stopformula % now has \noindent (in mkii we messed with baselineskip)
+%D \stoptyping
+
+\unexpanded\def\startdisplaymath
+ {\bgroup
+ \par
+ \informulatrue
+ \beforedisplayspace
+ \par
+ \ifvmode
+ \prevdepth-\maxdimen % texbook pagina 79-80
\fi
- $$\setdisplaydimensions
- \setpredisplaysize\lastlinewidth
+ \noindent % else funny hlist with funny baselineskip
+ $$% \Ustartdisplaymath
+ \setdisplaydimensions
+ %\setpredisplaysize
\startinnermath}
-\def\stopdisplaymath
+\unexpanded\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}}
+ $$% \Ustopdisplaymath
+ \par
+ \afterdisplayspace
+ \par
+ \egroup}
\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
+% already defined
+%
+% \let\startinnermath\empty
+% \let\stopinnermath \empty
% \defineformulaalternative[multi][\begindmath][\enddmath]
%
@@ -530,47 +530,31 @@
% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \fakewords{20}{40}
-\def\placeformula
- {\settrue\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
-\def\placesubformula
- {\setfalse\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
-\def\startsubformulas
+\unexpanded\def\startsubformulas
{\dosingleempty\dostartsubformulas}
\def\dostartsubformulas[#1]%
- {\ifconditional\incrementformulanumber
- \incrementstructurecounter[\v!formula]%
- \edef\subformulasreference{#1}% messy
- \ifx\subformulasreference\empty
- \glet\currentformulassynchronize\relax
- \glet\currentformulasattribute \relax
- \else
- \storecurrentformulanumber\subformulasreference\empty\currentformulassynchronize\currentformulasattribute
- \fi
- \fi
- \settrue\insidesubformulas}
+ {\edef\currentsubformulasreference{#1}%
+ \global\settrue\insidesubformulas
+ \handlesubformulasnumbering}
-\def\stopsubformulas
- {\setfalse\insidesubformulas
- \resetlastlinewidth
- \nonoindentation
+\unexpanded\def\stopsubformulas
+ {\nonoindentation
\checknextindentation[\formulaparameter\c!indentnext]%
+ \the\everyresetformulas % to be checked
+ \global\setfalse\insidesubformulas
\dorechecknextindentation} % here ?
-%D Named subformulas
+%D Named subformulas (to be redone)
-\def\startnamedsubformulas
+\unexpanded\def\startnamedsubformulas
{\dosingleempty\dostartnamedsubformulas}
\def\dostartnamedsubformulas[#1]#2%
{\setformulalistentry{#2}%
\startsubformulas[#1]}
-\def\stopnamedsubformulas
+\unexpanded\def\stopnamedsubformulas
{\stopsubformulas}
%D Experimental goodie:
@@ -584,339 +568,191 @@
%D
%D \typebuffer \getbuffer
-\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
+\unexpanded\def\startformulas
+ {\dosingleempty\dostartformulas}
-\def\startformulas#1\stopformulas % new / to be internationalized
+\def\dostartformulas[#1]#2\stopformulas % new / to be internationalized
{\bgroup
+ \global\settrue\insideformulas
+ \edef\currentformulasreference{#1}%
+ \handleformulasnumbering
\let\currentformula\empty
\forgetdisplayskips
\startdisplaymath
\setlocalhsize
- \long\def\startformula##1\stopformula
+ \long\unexpanded\def\startformula##1\stopformula
{\advance\scratchcounter\plusone}%
\scratchcounter\zerocount
- #1% preroll
+ #2% 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%
+ \def\normalstartformula{\vskip-\strutdepth\Ustartdisplaymath}% i hate this
+ \def\normalstopformula {\Ustopdisplaymath}%
+ \unexpanded\def\startformula {\Ustartmath\vcenter\bgroup\normalstartformula}%
+ \unexpanded\def\stopformula {\normalstopformula\egroup\Ustopmath\hss}%
+ #2%
\egroup
\stopdisplaymath
+ \global\setfalse\insideformulas
\egroup
+ \the\everyresetformulas
\hangafter\minusone % added for side floats
\hangindent\zeropoint} % added for side floats
-\def\dispplaceformula[#1]#2$$#3$$%
- {\dodoplaceformula[#1]{#2}\dostartformula{}#3\dostopformula}
-
-\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{\formulaparameter\c!location}\v!left
- {\normalleqno{\doformulanumber[#1][#2][]{}}}
- {\normalreqno{\doformulanumber[#1][#2][]{}}}}%
+% place
+
+% 0=unset, 1=forced, 2=none, 3=reference
+
+\chardef\placeformulanumbermode \zerocount
+\chardef\formulanumbermode \zerocount
+\chardef\formulasnumbermode \zerocount
+\chardef\subformulasnumbermode \zerocount
+\chardef\nestedformulanumbermode\zerocount
+
+\def\inhibitformulanumberflag{-}
+\def\forceformulanumberflag {+}
+
+\def\docheckformulareference#1#2%
+ {\chardef#1\ifx#2\empty
+ \zerocount
+ \else\ifx#2\forceformulanumberflag
+ \plusone
+ \else\ifx#2\inhibitformulanumberflag
+ \plustwo
\else
- \def\formulanumber{\doformulanumber[#1][#2]}%
- \let\donestedformulanumber\gobbletwoarguments
- \let\subformulanumber\doformulanumber % was \global
- \global\let\doplaceformulanumber\empty
- \fi}
-
-%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}
+ \plusthree
+ \fi\fi\fi}
+
+\def\formulanumber{\doformulanumber} % for the moment
-\def\rlappedmathno
- {\ifcase\mathraggedstatus\or
- \rlap{\@leqno}%
+\def\doformulanumber
+ {\dosingleempty\dodoformulanumber}
+
+\def\dodoformulanumber[#1]%
+ {\def\currentformulareference{#1}%
+ \dosinglegroupempty\dododoformulanumber}
+
+\def\redoformulanumber#1%
+ {\def\currentformulasuffix{#1}%
+ \dododoformulanumber}
+
+\unexpanded\def\placeformula
+ {\doglobal\settrue\insideplaceformula
+ \settrue\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+\unexpanded\def\placesubformula
+ {\doglobal\settrue\insideplacesubformula
+ \setfalse\incrementformulanumber
+ \dodoubleempty\doplaceformula}
+
+% \def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
+% {\def\currentplaceformulareference{#1}%
+% \let\currentplaceformulasuffix\empty
+% \futurelet\next\redoplaceformulaone}
+%
+% \let\mathdollarsign$ % no def
+%
+% \def\redoplaceformulaone % use doifnextcharelse
+% {\ifx\next\bgroup
+% \@EA\moreplaceformula % [ref]{}
+% \else
+% \@EA\redoplaceformulatwo
+% \fi}
+%
+% \long\def\moreplaceformula#1#2% #1 dummy #1 gobbles spaces
+% {\def\currentplaceformulasuffix{#1}%
+% \futurelet\next\redoplaceformulatwo#2}
+%
+% \def\redoplaceformulatwo
+% {\ifx\next\mathdollarsign
+% \@EA\dispplaceformula % [ref]$$
+% \else
+% \@EA\dodoplaceformula % [ref]\start
+% \fi}%
+
+\def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
+ {\def\currentplaceformulareference{#1}%
+ \let\currentplaceformulasuffix\empty
+ \doifnextbgroupelse\moreplaceformula\redoplaceformula} % [ref]{}
+
+\long\def\moreplaceformula#1%
+ {\def\currentplaceformulasuffix{#1}%
+ \redoplaceformula}
+
+\long\def\redoplaceformula
+ {\doifnextcharelse$\dispplaceformula\dodoplaceformula} % [ref]$$ [ref]\start
+
+\def\dodoplaceformula
+ {\handleplaceformulanumbering}
+
+\def\dispplaceformula$$#1$$%
+ {\handleplaceformulanumbering
+ \dostartformula{}#1\dostopformula}
+
+\let\startplaceformula\placeformula
+\let\stopplaceformula \relax
+
+% to be checked
+
+\def\doformulanumber
+ {\dosingleempty\dodoformulanumber}
+
+\def\dodoformulanumber[#1]%
+ {\def\currentformulareference{#1}%
+ \dosinglegroupempty\dododoformulanumber}
+
+\def\redoformulanumber#1%
+ {\def\currentformulasuffix{#1}%
+ \dododoformulanumber}
+
+\glet\doplaceformulanumber \relax
+\glet\donestedformulanumber\gobbletwoarguments
+
+\def\donestedformulanumberindeed#1#2%
+ {\def\currentnestedformulareference{#1}%
+ \def\currentnestedformulasuffix{#2}%
+ \glet\doplaceformulanumber\relax
+ \docheckformulareference\nestedformulanumbermode\currentnestedformulareference
+ \ifcase\nestedformulanumbermode
+ % nothing
\or
- \rlap{\@leqno}%
+ \doformulanumber
\or
- \@leqno
+ % nothing
+ \or
+ \doformulanumber
\fi}
-\def\stopmathbox
- {$%
- \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
- \egroup
- \setbox0\hbox{\unhcopy\scratchbox}%
- \scratchdimen\wd0
- \ifdim\scratchdimen>\displaywidth
- \donetrue
+\def\doplaceformulanumberindeed
+ {\glet\doplaceformulanumber\relax
+ \doifelse{\formulaparameter\c!location}\v!left
+ {\normalleqno{\dododoformulanumber}}
+ {\normalreqno{\dododoformulanumber}}}
+
+% todo
+
+\unexpanded\def\placenamedformula
+ {\dosingleempty\doplacenamedformula}
+
+\def\doplacenamedformula[#1]#2%
+ {\iffirstargument
+ \def\next{\placeformula[#1]}%
\else
- \donefalse
+ \let\next\placeformula
\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}
+ \setformulalistentry{#2}%
+ \next}
-\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}
+\global\let\doflushformulalistentry\gobbleoneargument
-%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}
+\def\setformulalistentry#1%
+ {\gdef\doflushformulalistentry##1%
+ {\normalexpanded{\noexpand\writetolist[\v!formula]{##1}}{#1}%
+ \global\let\doflushformulalistentry\gobbleoneargument}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/strc-not.lua b/Master/texmf-dist/tex/context/base/strc-not.lua
index 32a836ba86c..be883af57eb 100644
--- a/Master/texmf-dist/tex/context/base/strc-not.lua
+++ b/Master/texmf-dist/tex/context/base/strc-not.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-not'] = {
version = 1.001,
- comment = "companion to strc-not.tex",
+ 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"
@@ -52,14 +52,14 @@ function notes.store(tag,n)
end
state.start = state.start or nnd
end
- tex.write(#nd)
+ texwrite(#nd)
end
-function notes.get(tag,n)
+local function get(tag,n)
local nd = notedata[tag]
if nd then
- n = n or #notedata
- nd = nd[n or n]
+ n = n or #nd
+ nd = nd[n]
if nd then
if trace_notes then
logs.report("notes","getting %s of %s",n,tag)
@@ -69,6 +69,20 @@ function notes.get(tag,n)
end
end
+local function getn(tag)
+ local nd = notedata[tag]
+ return (nd and #nd) or 0
+end
+
+nodes.get = get
+nodes.getn = getn
+
+-- we could make a special enhancer
+
+function notes.listindex(tag,n)
+ return notedata[tag][n]
+end
+
function notes.define(tag,kind,number)
local state = notes.setstate(tag,kind)
state.number = number
@@ -77,6 +91,9 @@ end
function notes.save(tag,newkind)
local state = notestates[tag]
if state and not state.saved then
+ if trace_notes then
+ logs.report("notes","saving state of %s: %s -> %s",tag,state.kind,newkind or state.kind)
+ end
state.saved = notedata[tag]
state.savedkind = state.kind
state.kind = newkind or state.kind
@@ -84,11 +101,14 @@ function notes.save(tag,newkind)
end
end
-function notes.restore(tag)
+function notes.restore(tag,forcedstate)
local state = notestates[tag]
if state and state.saved then
+ if trace_notes then
+ logs.report("notes","restoring state of %s: %s -> %s",tag,state.kind,state.savedkind)
+ end
state.saved = nil
- state.kind = state.savedkind
+ state.kind = forcedstate or state.savedkind
notedata[tag] = state.saved
end
end
@@ -136,7 +156,7 @@ function notes.doifcontent(tag)
end
local function internal(tag,n)
- local nd = notes.get(tag,n)
+ local nd = get(tag,n)
if nd then
local r = nd.references
if r then
@@ -154,6 +174,20 @@ local function ordered(kind,name,n)
return o and o[n]
end
+notes.internal = internal
+notes.ordered = ordered
+
+function notes.doifonsamepageasprevious(tag)
+ local same = false
+ local n = getn(tag,n)
+ local current, previous = get(tag,n), get(tag,n-1)
+ if current and previous then
+ local cr, pr = current.references, previous.references
+ same = cr and pr and cr.realpage == pr.realpage
+ end
+ commands.doifelse(same)
+end
+
function notes.checkpagechange(tag) -- called before increment !
local nd = notedata[tag] -- can be unset at first entry
if nd then
@@ -197,7 +231,7 @@ function notes.deltapage(tag,n)
what = 3
end
end
- tex.write(what)
+ texwrite(what)
end
function notes.postpone()
@@ -212,14 +246,14 @@ function notes.postpone()
end
function notes.setsymbolpage(tag,n)
- local nd = notes.get(tag,n)
+ local nd = get(tag,n)
if nd then
nd.metadata.symbolpage = texcount.realpageno
end
end
function notes.getsymbolpage(tag,n)
- local nd = notes.get(tag,n)
+ local nd = get(tag,n)
nd = nd and nd.metadata.symbolpage
texwrite(nd or 0)
end
@@ -236,9 +270,9 @@ function notes.flush(tag,whatkind) -- 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
- local nd = notedata[tag]
- local ns = state.start -- first index
if nd and ns then
if trace_notes then
logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd)
@@ -250,17 +284,22 @@ function notes.flush(tag,whatkind) -- store and postpone
state.start = nil
state.kind = "insert"
elseif kind == "store" then
- local nd = notedata[tag]
- local ns = state.start -- first index
- if trace_notes then
- logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd)
- end
if nd and ns then
+ if trace_notes then
+ logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd)
+ end
for i=ns,#nd do
texsprint(ctxcatcodes,format("\\handlenoteitself{%s}{%s}",tag,i))
end
end
state.start = nil
+ elseif kind == "reset" then
+ if nd and ns then
+ if trace_notes then
+ logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd)
+ end
+ end
+ state.start = nil
elseif trace_notes then
logs.report("notes","not flushing state %s of %s",whatkind,tag)
end
diff --git a/Master/texmf-dist/tex/context/base/strc-not.mkii b/Master/texmf-dist/tex/context/base/strc-not.mkii
index 40e06c9a49a..f6fae3378ce 100644
--- a/Master/texmf-dist/tex/context/base/strc-not.mkii
+++ b/Master/texmf-dist/tex/context/base/strc-not.mkii
@@ -589,6 +589,38 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/strc-not.mkiv b/Master/texmf-dist/tex/context/base/strc-not.mkiv
index 4b033cbf9e7..45e37b276f5 100644
--- a/Master/texmf-dist/tex/context/base/strc-not.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-not.mkiv
@@ -17,6 +17,12 @@
\unprotect
+% this needs a further cleanup ...
+%
+% -- set breakpoin in descriptions
+% -- reset after trialtypesetting
+% -- that way we can trick the symbol space
+
% obsolete
\let\autopostponenotes\relax
@@ -97,7 +103,7 @@
\newtoks\tobeprocessednotes
-\def\processnotes#1% #1: \macro that uses \currentnote
+\unexpanded\def\processnotes#1% #1: \macro that uses \currentnote
{\def\doprocesssomenote##1{\edef\currentnote{##1}\let\currentdescription\currentnote#1}%
\the\tobeprocessednotes}
@@ -150,13 +156,12 @@
%D Are quite ligitimate, we default to a simple one 20\% of the
%D text width.
-\def\setupnotes
+\unexpanded\def\setupnotes
{\dodoubleargument\getparameters[\??vn]}
\setupnotes
[\c!location=\v!page,
\c!way=\v!by\v!part,
- \c!sectionnumber=\v!no,
%\c!conversion=,
\c!rule=\v!on,
\c!before=\blank,
@@ -186,34 +191,29 @@
\c!interaction=\v!yes,
%\c!factor=,
%\c!scope=, % \v!text \v!page
-\c!prefixconnector=.,
-\c!prefix=\v!no,
- \c!next=\autoinsertnextspace, % new, experimental with startnotes
+ \c!prefixconnector=.,
+ %\c!next=\autoinsertnextspace
+ \c!prefix=\v!no,
+ %\c!continue=\v!no,
\c!n=1]
+\setupnotes
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
\def\@@defaultnotedefloc{\v!inleft}
\def\@@defaultnotedefdis{\!!zeropoint}
-% also s!root
-%
-% \definedescription
-% [\??vn\??vn]
-% [\c!location=\@@defaultnotedefloc,
-% \c!distance=\@@defaultnotedefdis,
-% \c!width=\v!fit,
-% \c!headstyle=\noteparameter\c!style,
-% \c!headcolor=\noteparameter\c!color,
-% \c!before=,
-% \c!after=]
-
-\def\startnotedef{\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname}
-\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname}
+\unexpanded\def\startnotedef{\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname}
+\unexpanded\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname}
\def\currentnoteins{\csname\??vn:\currentnote\endcsname}
\newtoks \everysetupnote
-\def\definenote
+\unexpanded\def\definenote
{\dodoubleempty\dodefinenote}
\def\dodefinenote[#1][#2]%
@@ -227,12 +227,13 @@
[\c!location=\@@defaultnotedefloc,
\c!distance=\@@defaultnotedefdis,
\c!width=\v!fit,
- \c!headstyle=\noteparameter\c!style,
- \c!headcolor=\noteparameter\c!color,
-\s!handler=\v!note,
+ \c!headstyle=\noteparameter\c!style, % hm
+ \c!headcolor=\noteparameter\c!color, % hm
+ \s!handler=\v!note,
\c!text=,
\c!before=,
\c!after=]%
+ \doredefinenotecommands\currentnote
\setupenumerations
[\currentnote]
[\s!parent=\??vn\currentnote,
@@ -242,12 +243,35 @@
\getparameters
[\??vn\currentnote]
[\s!parent=\??vn,#2]%
- \definestructurecounter
- [\currentnote]%
+% \definestructurecounter
+% [\currentnote]%
\ctxlua{structure.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}%
\the\everysetupnote
\dochecknote}
+% \starttext
+% text \startfootnote Test.\stopfootnote
+% test \footnote{xxxx} \subfootnote{xxxx}
+% test \footnote{xxxx} \subfootnote{xxxx}
+% \stoptext
+
+\def\dodoredefinenotecommands#1#2#3%
+ {\unexpanded\expandafter\def\csname\e!start#3#1\expandafter\endcsname\expandafter
+ {\expandafter\dosingleempty\csname\s!do\e!start#3#1\endcsname}%
+ \unexpanded\expandafter\def\csname\s!do\e!start#3#1\expandafter\endcsname
+ \expandafter[\expandafter##\expandafter1\expandafter]\expandafter##\expandafter2\csname\e!stop#3#1\endcsname
+ {\begingroup
+ \doenumerationinit{#1}{#2}{#3}%
+ \@@notemakedescription[##1]{}{##2}%
+ \endgroup}}
+
+\def\doredefinenotecommands#1%
+ {\normalexpanded{\noexpand\dodoredefinenotecommands{#1}{1}{}}%
+ \let\@@subslevel\empty
+ \dostepwiserecurse{2}{\descriptionparameter\c!levels}{1}
+ {\normalexpanded{\noexpand\dodoredefinenotecommands{#1}{\recurselevel}{\@@subslevel\v!sub}}%
+ \edef\@@subslevel{\@@subslevel\v!sub}}}
+
\let\setupnotedefinition\setupenumerations
\appendtoks
@@ -258,8 +282,7 @@
% \dochecknote
% \to \everysetupnote
-
-\def\setupnote
+\unexpanded\def\setupnote
{\dodoubleempty\dosetupnote}
\def\dosetupnote[#1][#2]%
@@ -271,16 +294,20 @@
\dochecknote}
\appendtoks
- \letvalue{\??vn\c!rule:\currentnote}\normalnoterule % hm
+ \setvalue{\??vn\c!rule:c:\currentnote}{\normalnoterule}% hm
+ \letvalue{\??vn\c!rule:a:\currentnote}\v!left
\to \everysetupnote
\appendtoks
- \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}]%
+ \expanded{\processallactionsinset
+ [\noteparameter\c!rule]}
+ [ \v!on=>\setvalue{\??vn\c!rule:c:\currentnote}{\normalnoterule}, % no let as it can be changed afterwards
+ \v!normal=>\setvalue{\??vn\c!rule:c:\currentnote}{\normalnoterule},
+ \v!left=>\setvalue{\??vn\c!rule:a:\currentnote}{l2r},
+ \v!right=>\setvalue{\??vn\c!rule:a:\currentnote}{r2l},
+ \v!off=>\letvalue{\??vn\c!rule:c:\currentnote}\relax,
+ \s!default=>\letvalue{\??vn\c!rule:c:\currentnote}\relax,
+ \s!unknown=>\setvalue{\??vn\c!rule:c:\currentnote}{\noteparameter\c!rule}]%
\to \everysetupnote
\appendtoks
@@ -333,8 +360,8 @@
\setvalue{\??vn @\v!page }{\setnotelocation\plusone}
\setvalue{\??vn @\v!columns }{\setnotelocation\plustwo}
-\setvalue{\??vn @\v!firstcolumn}{\setnotelocation\plusthree}
-\setvalue{\??vn @\v!lastcolumn }{\setnotelocation\plusfour}
+\setvalue{\??vn @\v!lastcolumn }{\setnotelocation\plusthree}
+\setvalue{\??vn @\v!firstcolumn}{\setnotelocation\plusfour}
\setvalue{\??vn @\v!none }{\setnotelocation\plusfive}
\setvalue{\??vn @\v!text }{\setnotelocation\plusfive \setnoteformatting\plusone} % test
\setvalue{\??vn @\v!high }{\setnoteposition\plusone}
@@ -378,15 +405,8 @@
\ifnotelimit
\global\dimen\currentnoteins\dimexpr\noteparameter\c!height*\scratchcounter\relax
\fi
- % distance
- \begingroup
- \setbox\scratchbox\vbox
- {\forgetall
- \noteparameter\c!before
- \placenoterule
- \noteparameter\c!after}%
- \global\skip\currentnoteins\ht\scratchbox
- \endgroup
+ % distance -> tricky as this might depend on a font switch so we need a fast checker
+ \dosetnotedistance
% play safe
\ifnum\noteparameter\s!noteloc=\plusfive
\ctxlua{structure.notes.setstate("\currentnote","store")}%
@@ -396,10 +416,28 @@
\global\skip \currentnoteins\zeropoint
\fi}
-% \def\checknotes
-% {\processnotes\dochecknote}
+\def\dosetnotedistance
+ {\begingroup
+ \setbox\scratchbox\vbox
+ {\forgetall
+ \dontcomplain
+ \noteparameter\c!before
+ \placenoterule
+ \noteparameter\c!after}%
+ \global\skip\currentnoteins\ht\scratchbox
+ \endgroup}
-\let\checknotes\relax % experiment, avoiding this saves a lot of time
+% \def\checknotes % no longer needed
+% {\processnotes\dochecknote}
+%
+% \def\checknotedistances
+% {\processnotes\dosetnotedistance}
+%
+% fails but not that much needed anyway:
+%
+% \appendtoks
+% \checknotedistances
+% \to \everyglobalbodyfont
% D When \type{n} exceeds~1, footnotes are typeset in
% D multi||columns, using the algoritm presented on page~397
@@ -423,20 +461,30 @@
%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}}
+%D A bit messy:
-\def\normalnoterule
+\unexpanded\def\placenoterule
+ {\bgroup
+ \setupalign[\getvalue{\??vn\c!rule:a:\currentnote}]%
+ \righttoleft
+ \getvalue{\??vn\c!rule:c:\currentnote}%
+ \par
+ \egroup}
+
+\unexpanded\def\normalnoterule
{\ifvmode
- \color
- [\noteparameter\c!rulecolor]
- {\hrule\!!width .2\hsize\!!height\noteparameter\c!rulethickness\!!depth \zeropoint}%
+ \dontleavehmode \blackrule
+ [ \c!color=\noteparameter\c!rulecolor,
+ \c!width=.2\hsize,
+ \c!height=\noteparameter\c!rulethickness,
+ \c!depth=\zeropoint]%
+ \endgraf
\kern\strutdepth
\fi}
\ifx\setnotehsize\undefined
- \def\setnotehsize{\hsize\noteparameter\c!width\relax} % can be overloaded
+ \unexpanded\def\setnotehsize{\hsize\noteparameter\c!width\relax} % can be overloaded
\fi
@@ -499,68 +547,105 @@
%D functionality.
%D The next implementation runs on top of enumerations (only in \MKIV).
+%D
+%D \starttyping
+%D \setupenumerations
+%D [footnote]
+%D [ style=\type{(es)},
+%D headstyle=\type{(hs)}]
+%D
+%D \setupnote
+%D [footnote]
+%D [ style=\type{(s)},
+%D command=\type{(c)},
+%D textcommand=\type{(tc)},
+%D textstyle=\type{(ts)},
+%D numberstyle=\type{(ns)},
+%D numbercommand=\type{(nc)}]
+%D
+%D \setuplayout[backspace=6cm,marginwidth=cm,width=middle]
+%D
+%D \starttext
+%D \dorecurse{9}{This\footnote{Hello World #1} is a test.\par }
+%D \stoptext
+%D \stoptyping
% TODO: \ifnotesenabled
\newif\ifnotesymbol \notesymboltrue
-\def\setnote [#1]{\getvalue{#1}}
-\def\setnotetext[#1]{\global\settrue\skipnoteplacement\getvalue{#1}}
+\newconditional\skipnoteplacement
+
+\unexpanded\def\setnote [#1]{\getvalue{#1}}
+\unexpanded\def\setnotetext[#1]{\global\settrue\skipnoteplacement\getvalue{#1}}
\def\domovednote#1#2#3#4%
{\ifcase\ctxlua{structure.notes.deltapage("#1",#2)}\or\symbol[#3]\or\symbol[#4]\fi}
-\setvalue{\??dd:\v!note:\s!handler }{\@@doenumerationhandler}
-\setvalue{\??dd:\v!note:\s!handler:\s!do }{\@@somenotedescription}
-\setvalue{\??dd:\v!note:\s!handler:\s!start}{\@@startsomenotedescription}
+\setvalue{\??dd:\v!note:\s!handler:\s!text }{\@@donotetext}
+\setvalue{\??dd:\v!note:\s!handler:\s!number}{\@@donotenumber}
+\setvalue{\??dd:\v!note:\s!handler }{\@@donotehandler}
+\setvalue{\??dd:\v!note:\s!handler:\s!do }{\@@somenotedescription}
+\setvalue{\??dd:\v!note:\s!handler:\s!start }{\@@startsomenotedescription}
+
+\let\@@donotehandler\@@dodescriptionhandler
\def\@@somenotedescription {\@@notemakedescription}
\def\@@startsomenotedescription{\@@notemakedescription}
-\newconditional\skipnoteplacement
-
-\def\@@notemakedescription[#1]#2#3% todo ... proper [key=value] etc
+\def\@@notemakedescription[#1]#2#3%
{\ifnotesenabled
- \begingroup
- \doenumerationcheckconditions
- \let\currentnote\currentdescriptionmain
- \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!bookmark=,][]%
- \xdef\currentnotenumber{\ctxlua{structure.notes.store("\currentnote",\currentdescriptionnumberentry)}}%
- \settrue\processingnote
- \ifconditional\skipnoteplacement
- \globallet\lastnotesymbol\dolastnotesymbol
+ \edef\currentdescriptionreference{#1}%
+ \iftrialtypesetting
+ \doenumerationcheckconditions
+ \let\currentnote\currentdescriptionmain
+ \typesetdummynotesymbol
\else
- \iftypesettinglines % otherwise problems with \type <crlf> {xxx}
- \ignorelines % makes footnotes work in \startlines ... \stoplines
- \fi
- \ifnotesymbol
- \dolastnotesymbol
- \else
- \unskip\unskip
+ \begingroup
+ \doenumerationcheckconditions
+ \let\currentnote\currentdescriptionmain
+ \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!list=,\c!bookmark=,][]%
+ \xdef\currentnotenumber{\ctxlua{structure.notes.store("\currentnote",\currentdescriptionnumberentry)}}%
+ \settrue\processingnote
+ \ifconditional\skipnoteplacement
\globallet\lastnotesymbol\dolastnotesymbol
+ \else
+ \iftypesettinglines % otherwise problems with \type <crlf> {xxx}
+ \ignorelines % makes footnotes work in \startlines ... \stoplines
+ \fi
+ \ifnotesymbol
+ \dolastnotesymbol
+ \else
+ \unskip\unskip
+ \globallet\lastnotesymbol\dolastnotesymbol
+ \fi
\fi
+ \ifconditional\postponingnotes % todo: per note class
+ \global\settrue\postponednote
+ \else\ifconditional\inlocalnotes % todo: per note class
+ \global\settrue\postponednote
+ \else
+ \handlenoteinsert\currentnote\currentnotenumber
+ \fi\fi
+ \endgroup
\fi
- \ifconditional\postponingnotes
- \global\settrue\postponednote
- \else
- \handlenoteinsert\currentnote\currentnotenumber
- \fi
- \ifconditional\skipnoteplacement \else
- \kern\notesignal\relax % \relax is needed to honor spaces
- \iftrialtypesetting \else \global\setfalse\skipnoteplacement \fi
- \fi
- \endgroup
+ \fi
+ \ifconditional\skipnoteplacement
+ \global\setfalse\skipnoteplacement
+ \else
+ \kern\notesignal\relax % \relax is needed to honor spaces
\fi}
-\def\dolastnotesymbol{\typesetsomenotesymbol\currentnote\currentnotenumber}
+\def\dolastnotesymbol
+ {\typesetsomenotesymbol\currentnote\currentnotenumber}
-\def\dotypesetsomenotesymbol#1#2%
+\def\dotypesetsomenotesymbol#1#2% running text
{\dodonotesymbol
{\synchronizesomenotesymbol{#1}{#2}%
\ctxlua{structure.notes.number("\currentnote",\currentnotenumber)}% \currentdescriptionnumberentry
\domovednote{#1}{#2}\v!previouspage\v!nextpage}}
-\def\typesetsomenotesymbol#1#2%
+\unexpanded\def\typesetsomenotesymbol#1#2% running text
{\removeunwantedspaces
\doifitalicelse\/\donothing % Charles IV \footnote{the fourth}
\ifdim\lastkern=\notesignal
@@ -572,10 +657,35 @@
{\directgotobox{\dotypesetsomenotesymbol{#1}{#2}}[page(\ctxlua{structure.notes.getnumberpage("#1",\number#2)})]}% f:
\globallet\lastnotesymbol\relax}
+\unexpanded\def\typesetdummynotesymbol % temp hack
+ {\removeunwantedspaces
+ \doifitalicelse\/\donothing % Charles IV \footnote{the fourth}
+ \ifdim\lastkern=\notesignal
+ \dodonotesymbol{\kern\noteparameter\c!distance}% gets the font right, hack !
+ \fi
+ \nobreak
+ \hbox to .5em{}%
+ \globallet\lastnotesymbol\relax}
+
\def\currentnotedescriptiontext % todo: can be other number
{\ctxlua{structure.notes.title("\currentnote",\currentdescriptionnumberentry)}}
-\def\currentnoteenumerationfullnumber
+\def\@@donotetext
+ {\ifconditional\enumerationnumberenabled
+ \iftrialtypesetting
+ \doenumerationfullnumber\showdntext
+ \doenumerationcouplingsymbol
+ \else
+ \doenumerationregistercoupling
+ \doenumerationfullnumber\showdntext
+ \doenumerationcouplingsymbol
+ \fi
+ \else
+ \doenumerationfullnumber\showdnpuretext
+ \fi}
+
+% \def\currentnoteenumerationfullnumber
+\def\@@donotenumber
{\doifelse{\noteparameter\c!interaction}\v!no
{\docurrentnoteenumerationfullnumber}%
{\directgotobox
@@ -584,7 +694,8 @@
\def\docurrentnoteenumerationfullnumber
{\noteparameter\c!numbercommand
- {\ctxlua{structure.notes.number("\currentnote",\currentdescriptionnumberentry)}%
+ {\dosetnoteattributes\c!numberstyle\c!numbercolor
+ \ctxlua{structure.notes.number("\currentnote",\currentdescriptionnumberentry)}%
\domovednote\currentdescription\currentdescriptionnumberentry\v!nextpage\v!previouspage}}
\def\synchronizesomenotesymbol#1#2% called more often than needed
@@ -596,6 +707,7 @@
\the\everybeforenoteinsert
\insert\currentnoteins\bgroup
\the\everyinsidenoteinsert
+ \doprocesslocalsetups{\noteparameter\c!setups}% experimental
\handlenoteitself{#1}{#2}%
\egroup
\the\everyafternoteinsert
@@ -605,8 +717,12 @@
{\edef\currentdescription{#1}%
\edef\currentnote{#1}%
\edef\currentdescriptionnumberentry{#2}%
- \let\currentdescriptiontext\currentnotedescriptiontext
- \let\currentenumerationfullnumber\currentnoteenumerationfullnumber
+ \edef\currentdescriptionlistentry{\ctxlua{tex.write(structure.notes.listindex("#1",#2))}}%
+ % as we can have collected notes (e.g. in tables) we need to recover
+ % \currentdescriptionattribute and \currentdescriptionsynchronize
+ \reinstatedescriptionnumberentry\currentdescriptionlistentry % we could store the number in the entry
+ %
+ \dontcomplain % should be done in startstoreddescription instead
\dostartstoreddescription\begstrut\currentnotedescriptiontext\endstrut\dostopstoreddescription}
\def\dostartstoreddescription
@@ -669,6 +785,8 @@
\fi
\to \everyinsidenoteinsert
+% not: \appendtoks \setnotehsize \to \everyinsidenoteinsert (spoils columns)
+
\let\lastnotesymbol\relax
%D \macros
@@ -681,7 +799,7 @@
%D
%D This command is implemented rather straightforward as:
-\def\notesymbol
+\unexpanded\def\notesymbol
{\dodoubleempty\donotesymbol}
\def\donotesymbol[#1][#2]%
@@ -709,29 +827,33 @@
%
% \dorecurse{6}{\input tufte\footnote{\input ward \input tufte \relax}}
-\def\placenoteinserts
+\unexpanded\def\placenoteinserts
{\processnotes\doplacenoteinserts}
-\def\unvboxed {\ifvmode\unvbox \else\box \fi}
-\def\unvcopied{\ifvmode\unvcopy\else\copy\fi}
+\unexpanded\def\unvboxed {\ifvmode\unvbox \else\box \fi}
+\unexpanded\def\unvcopied{\ifvmode\unvcopy\else\copy\fi}
\def\doplacenoteinserts
{\relax\ifdim\ht\currentnoteins>\zeropoint\relax
\ifnum\noteparameter\s!noteloc=\plusfive
\else
- \endgraf
- \ifvmode
- \whitespace
- \noteparameter\c!before
- \fi
+ \endgraf
+ \ifvmode
+ \whitespace
+ \noteparameter\c!before
+ \fi
+% \bgroup
+% \setupalign[\noteparameter\c!align]%
\placenoterule % alleen in ..mode
+% \par
+% \egroup
\bgroup
\setnotebodyfont
\setbox\scratchbox\hbox
{% 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\unvcopied\else\unvboxed\fi\currentnoteins
+ \iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteins % is this needed?
\or
\iftrialtypesetting\copy\else\box\fi\currentnoteins
\obeydepth % (a) added , since split footnotes will not align properly
@@ -834,26 +956,32 @@
\def\defaultnotewidth{\makeupwidth} % {\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}
-\def\startlocalnotes
+\newconditional\inlocalnotes
+
+\unexpanded\def\startlocalnotes
{\dosingleempty\dostartlocalnotes}
\def\dostartlocalnotes[#1]%
{\def\localnoteslist{#1}%
+ \settrue\inlocalnotes
\processcommacommand[\localnoteslist]\dodostartlocalnotes}
-\def\stoplocalnotes
- {\processcommacommand[\localnoteslist]\dodostoplocalnotes}
+\unexpanded\def\stoplocalnotes
+ {\processcommacommand[\localnoteslist]\dodostoplocalnotes
+ \setfalse\inlocalnotes}
\def\dodostartlocalnotes#1%
- {\savestructurecounter[#1]%
- \resetstructurecounter[#1]%
+ {\doifnot{\noteparameter\c!continue}\v!yes
+ {\savestructurecounter[#1]%
+ \resetstructurecounter[#1]}%
\ctxlua{structure.notes.save("#1","store")}}
\def\dodostoplocalnotes#1%
- {\restorestructurecounter[#1]%
+ {\doifnot{\noteparameter\c!continue}\v!yes
+ {\restorestructurecounter[#1]}%
\ctxlua{structure.notes.restore("#1")}}
-\def\placelocalnotes
+\unexpanded\def\placelocalnotes
{\dodoubleempty\doplacelocalnotes}
\def\doplacelocalnotes[#1][#2]%
@@ -903,10 +1031,10 @@
%D
%D \showsetup{placefootnotes}
-\def\placebottomnotes
+\unexpanded\def\placebottomnotes
{\processnotes\placenoteinserts}
-\def\placenotes
+\unexpanded\def\placenotes
{\dodoubleempty\doplacenotes}
\def\doplacenotes[#1][#2]%
@@ -990,13 +1118,13 @@
% is this ok? endnotes and such
- \def\fakenotes
+ \unexpanded\def\fakenotes
{\ifhmode\endgraf\fi\ifvmode
\calculatetotalclevernoteheight
\ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi
\fi}
- \def\fakepagenotes
+ \unexpanded\def\fakepagenotes
{\ifhmode\endgraf\fi\ifvmode
\calculatetotalpagenoteheight
\ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi
@@ -1006,15 +1134,18 @@
\def\doaddtototalnoteheight#1%
{\ifdim\ht#1>\zeropoint
- \advance\totalnoteheight\ht #1%
- \advance\totalnoteheight\skip#1%
+ \ifcase\count#1\else
+ % todo: divide by count
+ \advance\totalnoteheight\ht #1%
+ \advance\totalnoteheight\skip#1%
+ \fi
\fi}
\def\docalculatetotalnoteheight
{\ifcase\clevernotes % tricky here ! ! ! to be sorted out ! ! !
\doaddtototalnoteheight\currentnoteins
\else
- \doaddtototalnoteheight\currentbackupnoteins
+% \doaddtototalnoteheight\currentbackupnoteins
\fi}
\def\docalculatetotalclevernoteheight
@@ -1101,34 +1232,44 @@
%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 [\v!footnote]} % alleen footnote
- \def\stoplocalfootnotes {\stoplocalnotes }
+\unexpanded\def\setupfootnotedefinition{\setupnotedefinition [\v!footnote]}
+\unexpanded\def\setupfootnotes {\setupnote [\v!footnote]}
+%unexpanded\def\footnote {\setnote [\v!footnote]}
+\def\footnotetext {\setnotetext [\v!footnote]}
+%unexpanded\def\note {\dodoubleempty\notesymbol [\v!footnote]} % alleen footnote
+\unexpanded\def\placefootnotes {\dodoubleempty\doplacefootnotes [\v!footnote]}
+\unexpanded\def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!footnote]}
+\unexpanded\def\startlocalfootnotes {\startlocalnotes [\v!footnote]} % alleen footnote
+\unexpanded\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}
-\def\note{\dodoubleempty\donote}
+\unexpanded\def\note{\dodoubleempty\donote}
\def\donote[#1][#2]{\ifsecondargument\donotesymbol[#1][#2]\else\secondargumenttrue\donotesymbol[\v!footnote][#1]\fi}
+%D Goodies:
+%D
+%D \starttyping
+%D \dorecurse {100} {
+%D test \footnote{\doifnoteonsamepageelse[footnote]{ibidem}{aaa}}
+%D }
+%D \stoptyping
+
+\def\doifnoteonsamepageelse[#1]{\ctxlua{structure.notes.doifonsamepageasprevious("#1")}}
+
%D New trickery:
\def\ownnotesymbol#1% #1 gets number passed
{\executeifdefined{\??vn::\currentnote}\empty}
-\def\setnotesymbol[#1]#2#3%
+\unexpanded\def\setnotesymbol[#1]#2#3%
{\prewordbreak % prevent lookback
\setgvalue{\??vn::#1}{#3}
\dolastnotesymbol}
-\def\ownnote[#1]#2#3#4%
+\unexpanded\def\ownnote[#1]#2#3#4%
{\setnotesymbol[#1]{#2}{#3}%
\setnotetext [#1]{#4}}
diff --git a/Master/texmf-dist/tex/context/base/strc-num.lua b/Master/texmf-dist/tex/context/base/strc-num.lua
index 431200b3993..8165d078617 100644
--- a/Master/texmf-dist/tex/context/base/strc-num.lua
+++ b/Master/texmf-dist/tex/context/base/strc-num.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-num'] = {
version = 1.001,
- comment = "companion to strc-num.tex",
+ comment = "companion to strc-num.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -11,14 +11,17 @@ local next, type = next, type
local min, max = math.min, math.max
local texsprint, texcount = tex.sprint, tex.count
+local trace_counters = false trackers.register("structure.counters", function(v) trace_counters = v end)
+
structure = structure or { }
structure.helpers = structure.helpers or { }
structure.sections = structure.sections or { }
structure.counters = structure.counters or { }
structure.documents = structure.documents or { }
-structure.counters = structure.counters or { }
-structure.counters.data = structure.counters.data or { }
+structure.counters = structure.counters or { }
+structure.counters.data = structure.counters.data or { }
+structure.counters.specials = structure.counters.specials or { }
local helpers = structure.helpers
local sections = structure.sections
@@ -31,6 +34,7 @@ local variables = interfaces.variables
local counterdata = counters.data
local counterranges, tbs = { }, 0
+local counterspecials = counters.specials
counters.collected = counters.collected or { }
counters.tobesaved = counters.tobesaved or { }
@@ -120,6 +124,7 @@ local function allocate(name,i)
if not cd then
cd = {
level = 1,
+--~ block = "", -- todo
numbers = nil,
state = variables.start, -- true
data = { }
@@ -154,14 +159,18 @@ function counters.record(name,i)
end
local function savevalue(name,i)
- local cd = counterdata[name].data[i]
- local cs = tobesaved[name][i]
- local cc = collected[name]
- local cr = cd.range
- local old = (cc and cc[i] and cc[i][cr]) or 0
- cs[cr] = cd.number
- cd.range = cr + 1
- return old
+ if name then
+ local cd = counterdata[name].data[i]
+ local cs = tobesaved[name][i]
+ local cc = collected[name]
+ local cr = cd.range
+ local old = (cc and cc[i] and cc[i][cr]) or 0
+ cs[cr] = cd.number
+ cd.range = cr + 1
+ return old
+ else
+ return 0
+ end
end
function counters.define(name, start, counter) -- todo: step
@@ -197,10 +206,12 @@ function counters.compact(name,level,onlynumbers)
local compact = { }
for i=1,level or #data do
local d = data[i]
+--~ print(name,i,d.number)
if d.number ~= 0 then
compact[i] = (onlynumbers and d.number) or d
end
end
+--~ print(table.serialize(compact))
return compact
end
end
@@ -259,6 +270,24 @@ function counters.setoffset(name,value)
counters.setvalue(name,"offset",value)
end
+
+local function synchronize(name,d)
+ local dc = d.counter
+ if dc then
+ if trace_counters then
+ logs.report("counters","setting counter %s with name %s to %s",dc,name,d.number)
+ end
+ tex.setcount("global",dc,d.number)
+ end
+ local cs = counterspecials[name]
+ if cs then
+ if trace_counters then
+ logs.report("counters","invoking special for name %s",name)
+ end
+ cs()
+ end
+end
+
function counters.reset(name,n)
local cd = counterdata[name]
if cd then
@@ -267,7 +296,7 @@ function counters.reset(name,n)
savevalue(name,i)
d.number = d.start or 0
d.own = nil
- if d.counter then texcount[d.counter] = d.number end
+ synchronize(name,d)
end
cd.numbers = nil
end
@@ -279,7 +308,7 @@ function counters.set(name,n,value)
local d = allocate(name,n)
d.number = value or 0
d.own = nil
- if d.counter then texcount[d.counter] = d.number end
+ synchronize(name,d)
end
end
@@ -289,7 +318,7 @@ local function check(name,data,start,stop)
savevalue(name,i)
d.number = d.start or 0
d.own = nil
- if d.counter then texcount[d.counter] = d.number end
+ synchronize(name,d)
end
end
@@ -299,10 +328,15 @@ function counters.setown(name,n,value)
local d = allocate(name,n)
d.own = value
d.number = (d.number or d.start or 0) + (d.step or 0)
- if cd.level and cd.level > 0 then -- 0 is signal that we reset manually
- check(name,data,n+1) -- where is check defined
+ local level = cd.level
+ if not level or level == -1 then
+ -- -1 is signal that we reset manually
+ elseif level > 0 then
+ check(name,d,n+1)
+ elseif level == 0 then
+ -- happens elsewhere
end
- if d.counter then texcount[d.counter] = d.number end
+ synchronize(name,d)
end
end
@@ -339,20 +373,29 @@ function counters.add(name,n,delta)
local data = cd.data
local d = allocate(name,n)
d.number = (d.number or d.start or 0) + delta*(d.step or 0)
- if cd.level and cd.level > 0 then -- 0 is signal that we reset manually
+ local level = cd.level
+ if not level or level == -1 then
+ -- -1 is signal that we reset manually
+ elseif level > 0 then
+ -- within countergroup
check(name,data,n+1)
+ elseif level == 0 then
+ -- happens elsewhere
end
- if d.counter then texcount[d.counter] = d.number end
- return d.number
+ synchronize(name,d)
+ return d.number -- not needed
end
return 0
end
-function counters.check(level)
- for _, v in next, counterdata do
- if v.level == level then -- is level for whole counter!
- local data = v.data
- check(name,data)
+function counters.check(level) -- not used (yet)
+ for name, cd in next, counterdata do
+ -- logs.report("counters","%s %s %s",name,cd.level,level)
+ if cd.level == level then
+ if trace_counters then
+ logs.report("counters","resetting %s at level %s",name,level)
+ end
+ counters.reset(name)
end
end
end
@@ -384,7 +427,7 @@ function counters.converted(name,spec) -- name can be number and reference to st
if cd then
local spec = spec or { }
local numbers, ownnumbers = { }, { }
- local reverse = spec.order == variables["reverse"]
+ local reverse = spec.order == variables.reverse
local kind = spec.type or "number"
local v_first, v_next, v_previous, v_last = variables.first, variables.next, variables.previous, variables.last
local data = cd.data
@@ -409,7 +452,8 @@ function counters.converted(name,spec) -- name can be number and reference to st
local vf = v.first
local vl = v.last
if vl > 0 then
- vn = vl - vn + 1 + vf
+ -- vn = vl - vn + 1 + vf
+ vn = vl - vn + vf -- see testbed for test
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/strc-num.mkiv b/Master/texmf-dist/tex/context/base/strc-num.mkiv
index 9f6733a6cbd..5b5aebe7dc8 100644
--- a/Master/texmf-dist/tex/context/base/strc-num.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-num.mkiv
@@ -39,21 +39,26 @@
% todo: better inheritane system
-\definesystemvariable {nn}
-
-\def\setupstructurecountering{\dodoubleempty\getparameters[\??nn]}
+\unexpanded\def\setupstructurecountering{\dodoubleempty\getparameters[\??nn]}
\setupstructurecountering
[\c!way=\v!by\v!chapter,
-% \c!blockway=,
-% \c!prefixstopper=,
-\c!prefixconnector=.,
-\c!prefixsegments=\thenamedstructurecounterlevel\currentstructurecounter,
-\c!start=0,
-\c!state=\v!start,
+% \c!blockway=,
+% \c!prefixstarter=,
+% \c!prefixstopper=,
+ \c!prefixconnector=.,
+ \c!prefixsegments=\thenamedstructurecounterlevel\currentstructurecounter,
+ \c!start=0,
+ \c!state=\v!start,
\c!prefix=\v!yes,
\c!state=\v!start]
+\setupstructurecountering
+ [\c!prefixsegments=\autostructureprefixsegments\sharedstructurecounterparameter]
+
+\def\autostructureprefixsegments#1% todo: \c!prefixsegments=\v!auto
+ {2:\thenamedstructureheadlevel{\ctxlua{structure.sections.way("#1\c!way","\v!by")}}}
+
% \letvalue{\??nn\s!empty}\empty
\def\structurecounterparameter#1#2%
@@ -76,13 +81,22 @@
#1%
\fi}
+\def\sharedstructurecounterparameter#1%
+ {\csname
+ \ifcsname\??nn#1\endcsname
+ \??nn#1%
+ \else
+ \s!empty
+ \fi
+ \endcsname}
+
+\let\numberingparameter\sharedstructurecounterparameter
+
% \def\structurecounterparameter #1#2{\csname\dostructurecounterparameter{\??nn#1}#2\endcsname}
% \def\dostructurecounterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dostructurecounterparentparameter\csname#1\s!number\endcsname#2\fi}
% \def\dostructurecounterparentparameter#1#2{\ifx#1\relax\s!empty\else\dostructurecounterparameter#1#2\fi}
-%
-
-\def\definestructurecounter
+\unexpanded\def\definestructurecounter
{\dodoubleempty\dodefinestructurecounter}
\def\dodefinestructurecounter[#1][#2]%
@@ -101,7 +115,7 @@
{\getparameters[\??nn#1][\c!number=#2]%
\docheckstructurecountersetup{#1}}
-\def\setupstructurecounter
+\unexpanded\def\setupstructurecounter
{\dodoubleargument\dosetupstructurecounter}
\def\dosetupstructurecounter[#1][#2]%
@@ -189,7 +203,7 @@
\ctxlua{structure.counters.add("\@@thestructurecounter{#1}",1,1)}}
\def\doincrementsubstructurecounter[#1][#2]%
- {\docheckstructurecounterbypage{#1}
+ {\docheckstructurecounterbypage{#1}%
\ctxlua{structure.counters.add("\@@thestructurecounter{#1}",#2,1)}}
\def\convertedstructurecounter
@@ -205,6 +219,7 @@
separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset",
conversion = "\structurecounterparameter{#1}\c!prefixconversion",
conversionset = "\structurecounterparameter{#1}\c!prefixconversionset",
+ starter = \!!bs\structurecounterparameter{#1}\c!prefixstarter\!!es,
stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es,
set = "\structurecounterparameter{#1}\c!prefixset",
segments = "\structurecounterparameter{#1}\c!prefixsegments",
@@ -215,6 +230,7 @@
separatorset = "\structurecounterparameter{#1}\c!numberseparatorset",
conversion = \!!bs\structurecounterparameter{#1}\c!numberconversion\!!es,
conversionset = "\structurecounterparameter{#1}\c!numberconversionset",
+ starter = \!!bs\structurecounterparameter{#1}\c!numberstarter\!!es,
stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es,
segments = "\structurecounterparameter{#1}\c!numbersegments",
type = "\structurecounterparameter{#1}\c!type",
@@ -232,7 +248,8 @@
separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset",
conversion = "\structurecounterparameter{#1}\c!prefixconversion",
conversionset = "\structurecounterparameter{#1}\c!prefixconversionset",
- stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es,
+ % starter = \!!bs\structurecounterparameter{#1}\c!prefixstarter\!!es,
+ % stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es,
set = "\structurecounterparameter{#1}\c!prefixset",
segments = "\structurecounterparameter{#1}\c!prefixsegments",
connector = \!!bs\structurecounterparameter{#1}\c!prefixconnector\!!es,
@@ -242,6 +259,7 @@
separatorset = "\structurecounterparameter{#1}\c!numberseparatorset",
conversion = \!!bs\structurecounterparameter{#1}\c!numberconversion\!!es,
conversionset = "\structurecounterparameter{#1}\c!numberconversionset",
+ starter = \!!bs\structurecounterparameter{#1}\c!numberstarter\!!es,
stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es,
segments = "\structurecounterparameter{#1}\c!numbersegments",
type = "#2",
@@ -249,7 +267,7 @@
)}%
\endgroup}
-\def\convertedsubstructurecounter
+\unexpanded\def\convertedsubstructurecounter
{\dotripleempty\doconvertedsubstructurecounter}
\def\doconvertedsubstructurecounter[#1][#2][#3]% #2 can be n or n:m
@@ -306,7 +324,7 @@
% funny, here, todo: these are the defaults
-\def\setupnumbering
+\unexpanded\def\setupnumbering
{\dodoubleempty\getparameters[\??nr]}
\setupnumbering
@@ -314,17 +332,6 @@
\c!blockway=,
\c!state=\v!start]
-\def\numberingparameter#1{\csname\??nr#1\endcsname}
-
-% \c!prefixconnector=.,
-% \c!stopper=,
-
-% \c!prefix=\v!no,
-% \c!prefixconnector=.,
-% \c!way=bychapter,
-% \c!prefixsegments=2:2,
-
-
%D Helpers:
% call:
@@ -347,10 +354,16 @@
\def\dostructurecountercomponent#1#2#3#4#5#6#7[#8][#9]%
{\begingroup
%
- #2[#8]%
+ #2[\s!haslevel=1,#8]%
\edef\hasstructurecountercaption{#3\s!hascaption}%
- \edef\hasstructurecountertitle{#3\s!hastitle}%
- \edef\hasstructurecounternumber{#3\s!hasnumber}%
+ \edef\hasstructurecountertitle {#3\s!hastitle}%
+ \edef\hasstructurecounternumber {#3\s!hasnumber}%
+ \edef\hasstructurecounterlevel {#3\s!haslevel}%
+ %
+ \edef\askedprefixsegments{#3\c!prefixsegments}%
+ \ifx\askedprefixsegments\v!auto
+ \edef\askedprefixsegments{\autostructureprefixsegments#3}%
+ \fi
%
\edef\currentname{#3\c!name}%
\ifx\currentname\empty
@@ -363,8 +376,8 @@
%
\doif{#3\c!title}\v!none{\setfalse\hasstructurecountercaption\setfalse\hasstructurecounternumber}% will become obsolete
%
- \ifx\hasstructurecounternumber\v!yes
- \incrementstructurecounter[\currentcounter]%
+ \ifx\hasstructurecounternumber\v!yes % here due to previous test but best in callers
+ \doincrementsubstructurecounter[\currentcounter][\hasstructurecounterlevel]%
\fi
%
\ifx\hasstructurecountercaption\v!yes
@@ -421,7 +434,8 @@
conversion = \!!bs#3\c!prefixconversion\!!es,
conversionset = "#3\c!prefixconversionset",
set = "#3\c!prefixset",
- segments = "#3\c!prefixsegments",
+ % segments = "#3\c!prefixsegments",
+ segments = "\askedprefixsegments",
connector = \!!bs#3\c!prefixconnector\!!es,
},
numberdata = {
@@ -429,6 +443,7 @@
separatorset = "#3\c!numberseparatorset",
conversion = \!!bs#3\c!numberconversion\!!es,
conversionset = "#3\c!numberconversionset",
+ starter = \!!bs#3\c!numberstarter\!!es,
stopper = \!!bs#3\c!numberstopper\!!es,
segments = "#3\c!numbersegments",
},
@@ -440,11 +455,15 @@
\xdef\laststructurecountersynchronize{\ctxlatelua{structure.lists.enhance(\laststructurecounternumber)}}%
\else
\glet\laststructurecounternumber \relax
- \glet\laststructurecounterattribute \relax
+ \glet\laststructurecounterattribute \attributeunsetvalue
\glet\laststructurecountersynchronize\relax
\fi
\endgroup}
+\let\laststructurecounternumber \relax
+\let\laststructurecounterattribute \relax
+\let\laststructurecountersynchronize\relax
+
\def\dostructurecountersetup#1#2% name \someparameter
{\setupstructurecounter
[#1]
@@ -456,6 +475,7 @@
\c!prefixseparatorset=#2\c!prefixseparatorset,
\c!prefixconversion=#2\c!prefixconversion,
\c!prefixconversionset=#2\c!prefixconversionset,
+ \c!prefixstarter=#2\c!prefixstarter,
\c!prefixstopper=#2\c!prefixstopper,
\c!prefixset=#2\c!prefixset,
\c!prefixsegments=#2\c!prefixsegments,
@@ -465,7 +485,27 @@
\c!numberseparatorset=#2\c!numberseparatorset,
\c!numberconversion=#2\c!numberconversion,
\c!numberconversionset=#2\c!numberconversionset,
+ \c!numberstarter=#2\c!numberstarter,
\c!numberstopper=#2\c!numberstopper,
\c!numbersegments=#2\c!numbersegments]}
+\def\presetstructurecountersetup#1#2% \setupcommand \someparameter
+ {#1%
+ [\c!way =#2\c!way,
+ \c!prefix =#2\c!prefix,
+ \c!prefixseparatorset =#2\c!prefixseparatorset,
+ \c!prefixconversion =#2\c!prefixconversion,
+ \c!prefixconversionset=#2\c!prefixconversionset,
+ \c!prefixstarter =#2\c!prefixstarter,
+ \c!prefixstopper =#2\c!prefixstopper,
+ \c!prefixsegments =#2\c!prefixsegments,
+ \c!prefixset =#2\c!prefixset,
+ \c!prefixconnector =#2\c!prefixconnector,
+ \c!numberseparatorset =#2\c!numberseparatorset,
+ \c!numberconversion =#2\c!numberconversion,
+ \c!numberconversionset=#2\c!numberconversionset,
+ \c!numberstarter =#2\c!numberstarter,
+ \c!numberstopper =#2\c!numberstopper,
+ \c!numbersegments =#2\c!numbersegments]}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/strc-pag.lua b/Master/texmf-dist/tex/context/base/strc-pag.lua
index b95f0842ac6..2610595872a 100644
--- a/Master/texmf-dist/tex/context/base/strc-pag.lua
+++ b/Master/texmf-dist/tex/context/base/strc-pag.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-pag'] = {
version = 1.001,
- comment = "companion to strc-pag.tex",
+ comment = "companion to strc-pag.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -11,6 +11,8 @@ local texcount, format = tex.count, string.format
local ctxcatcodes = tex.ctxcatcodes
local texsprint, texwrite = tex.sprint, tex.write
+local trace_pages = false trackers.register("structure.pages", function(v) trace_pages = v end)
+
structure.pages = structure.pages or { }
local helpers = structure.helpers or { }
@@ -35,51 +37,75 @@ end
job.register('jobpages.collected', jobpages.tobesaved, initializer)
-local specification = { }
+local specification = { } -- to be checked
-function pages.save(userspec)
+function pages.save(prefixdata,numberdata)
local realpage, userpage = texcount.realpageno, texcount.userpageno
- local data = {
- number = userpage,
- specification = helpers.simplify(userspec or specification),
- block = sections.currentblock(),
- }
- tobesaved[realpage] = data
- if not collected[realpage] then
- collected[realpage] = data
+ if realpage > 0 then
+ if trace_pages then
+ logs.report("pages","saving page %s.%s",realpage,userpage)
+ end
+ local data = {
+ number = userpage,
+ block = sections.currentblock(),
+ prefixdata = prefixdata and helpers.simplify(prefixdata),
+ numberdata = numberdata and helpers.simplify(numberdata),
+ }
+ tobesaved[realpage] = data
+ if not collected[realpage] then
+ collected[realpage] = data
+ end
+ elseif trace_pages then
+ logs.report("pages","not saving page %s.%s",realpage,userpage)
end
end
-function pages.pagenumber(localspec)
- local deltaspec
- if localspec then
- for k,v in next, localspec do
- if v ~= "" and v ~= specification[k] then
- if not deltaspec then deltaspec = { } end
- deltaspec[k] = v
+function structure.counters.specials.userpage()
+ local r = texcount.realpageno
+ if r > 0 then
+ local t = tobesaved[r]
+ if t then
+ t.number = texcount.userpageno
+ if trace_pages then
+ logs.report("pages","forcing pagenumber of realpage %s to %s",r,t.number)
end
end
end
- if deltaspec then
- return { realpage = texcount.realpageno, specification = deltaspec }
- else
- return { realpage = texcount.realpageno }
- end
end
---
+--~ function pages.pagenumber(localspec)
+--~ local deltaspec
+--~ if localspec then
+--~ for k,v in next, localspec do
+--~ if v ~= "" and v ~= specification[k] then
+--~ if not deltaspec then deltaspec = { } end
+--~ deltaspec[k] = v
+--~ end
+--~ end
+--~ end
+--~ if deltaspec then
+--~ return { realpage = texcount.realpageno, specification = deltaspec }
+--~ else
+--~ return { realpage = texcount.realpageno }
+--~ end
+--~ end
local function convertnumber(str,n)
return format("\\convertnumber{%s}{%s}",str or "numbers",n)
end
-function pages.number(realdata,pagespecification)
- local userpage, block = realdata.number, realdata.block or ""
- local conversionset = (pagespecification and pagespecification.conversionset) or realdata.conversionset or ""
- local conversion = (pagespecification and pagespecification.conversion ) or realdata.conversion or ""
- local stopper = (pagespecification and pagespecification.stopper ) or realdata.stopper or ""
+function pages.number(realdata,pagespec)
+ local userpage, block = realdata.number, realdata.block or "" -- sections.currentblock()
+ local numberspec = realdata.numberdata
+ local conversionset = (pagespec and pagespec.conversionset ~= "" and pagespec.conversionset) or (numberspec and numberspec.conversionset ~= "" and numberspec.conversionset) or ""
+ local conversion = (pagespec and pagespec.conversion ~= "" and pagespec.conversion ) or (numberspec and numberspec.conversion ~= "" and numberspec.conversion ) or ""
+ local starter = (pagespec and pagespec.starter ~= "" and pagespec.starter ) or (numberspec and numberspec.starter ~= "" and numberspec.starter ) or ""
+ local stopper = (pagespec and pagespec.stopper ~= "" and pagespec.stopper ) or (numberspec and numberspec.stopper ~= "" and numberspec.stopper ) or ""
+ if starter ~= "" then
+ processors.sprint(ctxcatcodes,starter)
+ end
if conversion ~= "" then
- texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",conversion,number))
+ texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",conversion,userpage))
else
if conversionset == "" then conversionset = "default" end
local theconversion = sets.get("structure:conversions",block,conversionset,index,"numbers")
@@ -119,11 +145,11 @@ function pages.analyse(entry,pagespecification)
return pagedata, false, "current spec blocks prefix"
end
-- stored preferences
- if entry.prefix == no then
- return pagedata, false, "entry blocks prefix"
- end
+--~ if entry.prefix == no then
+--~ return pagedata, false, "entry blocks prefix"
+--~ end
-- stored page state
- pagespecification = pagedata.specification
+ pagespecification = pagedata.prefixdata
if pagespecification and pagespecification.prefix == no then
return pagedata, false, "pagedata blocks prefix"
end
@@ -143,10 +169,9 @@ end
function helpers.prefixpage(data,prefixspec,pagespec)
if data then
local pagedata, prefixdata, e = pages.analyse(data,pagespec)
---~ tex.write(e)
if pagedata then
if prefixdata then
- sections.typesetnumber(prefixdata,"prefix",prefixspec or false,prefixdata or false,pagedata.specification or false)
+ sections.typesetnumber(prefixdata,"prefix",prefixspec or false,prefixdata or false,pagedata.prefixdata or false)
end
pages.number(pagedata,pagespec)
end
@@ -170,7 +195,7 @@ function helpers.analyse(entry,specification)
if not entry then
return false, false, "no entry"
end
- local no = variables.no
+ local yes, no = variables.yes, variables.no
-- section data
local references = entry.references
if not references then
@@ -199,9 +224,18 @@ end
function helpers.prefix(data,prefixspec)
if data then
- local _, prefixdata = helpers.analyse(data,prefixspec)
+ local _, prefixdata, status = helpers.analyse(data,prefixspec)
if prefixdata then
sections.typesetnumber(prefixdata,"prefix",prefixspec or false,data.prefixdata or false,prefixdata or false)
end
end
end
+
+function pages.is_odd(n)
+ n = n or texcount.realpageno
+ if texcount.pagenoshift % 2 == 0 then
+ return n % 2 == 0
+ else
+ return n % 2 ~= 0
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/strc-pag.mkiv b/Master/texmf-dist/tex/context/base/strc-pag.mkiv
index 276cf8b78b6..0f3d7ba3b07 100644
--- a/Master/texmf-dist/tex/context/base/strc-pag.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-pag.mkiv
@@ -23,10 +23,11 @@
% Allocation:
-\countdef\realpageno = 0 \realpageno = 1
-\countdef\userpageno = 1 \userpageno = 1
-\countdef\subpageno = 2 \subpageno = 0 % !!
-\countdef\arrangeno = 3 \arrangeno = 0 % !!
+\countdef\realpageno = 0 \realpageno = 1
+\countdef\userpageno = 1 \userpageno = 1
+\countdef\subpageno = 2 \subpageno = 0 % !!
+\countdef\arrangeno = 3 \arrangeno = 0 % !!
+\countdef\pagenoshift = 4 \pagenoshift = 0 % !!
\let\pageno\userpageno
@@ -55,17 +56,37 @@
% prefixset=mine,
% prefixseparatorset=mine]
-\definestructurecounter[\s!realpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=realpage
-\definestructurecounter[\s!userpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=userpage
-\definestructurecounter[\s!subpage] [\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=subpage
+% \definestructureconversionset[frontpart:pagenumber][][romannumerals]
+% \definestructureconversionset[bodypart:pagenumber] [][numbers]
+%
+% \setupuserpagenumber[way=byblock]
+% \setupuserpagenumber[way=bychapter]
+% \setupuserpagenumber[numberconversionset=pagenumber]
+%
+% \starttext
+% \startfrontmatter
+% \completecontent[criterium=all]
+% \chapter{tufte} \section{one} \input tufte \page \section{two} \input tufte \page
+% \chapter{tufte} \section{one} \input tufte \page \section{two} \input tufte \page
+% \stopfrontmatter
+% \startbodymatter
+% \chapter{knuth} \section{one} \input knuth \page \section{two} \input knuth \page \section{three} \input knuth \page
+% \chapter{knuth} \section{one} \input knuth \page \section{two} \input knuth \page \section{three} \input knuth \page
+% \stopbodymatter
+% \stoptext
+
+
+\definestructurecounter[\s!realpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=,\s!counter=realpageno]
+\definestructurecounter[\s!userpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=,\s!counter=userpageno]
+\definestructurecounter[\s!subpage] [\c!prefix=\v!no,\c!start=1,\c!prefixsegments=,\s!counter=subpageno]
\newtoks\everysetuprealpagenumber % todo: set state: none, start, stop, reset
\newtoks\everysetupuserpagenumber % todo: set state: none, start, stop, reset
\newtoks\everysetupsubpagenumber % todo: set state: none, start, stop, reset
-\def\setuprealpagenumber{\dosingleargument\dosetuprealpagenumber}
-\def\setupuserpagenumber{\dosingleargument\dosetupuserpagenumber}
-\def\setupsubpagenumber {\dosingleargument\dosetupsubpagenumber}
+\unexpanded\def\setuprealpagenumber{\dosingleargument\dosetuprealpagenumber}
+\unexpanded\def\setupuserpagenumber{\dosingleargument\dosetupuserpagenumber}
+\unexpanded\def\setupsubpagenumber {\dosingleargument\dosetupsubpagenumber}
\def\dosavepagenumberstate#1{\edef\oldpagenumberstate{\structurecounterparameter#1\c!state}}
@@ -86,17 +107,22 @@
\let\setuppagenumber\setupuserpagenumber
\let\resetpagenumber\resetuserpagenumber
-\def\savecurrentpagestate
- {\ctxlua{structure.pages.save {
+\def\savecurrentpagestate % \normalexpanded?
+ {\ctxlua{structure.pages.save({
prefix = "\structurecounterparameter\s!userpage\c!prefix",
separatorset = "\structurecounterparameter\s!userpage\c!prefixseparatorset",
conversion = "\structurecounterparameter\s!userpage\c!prefixconversion",
conversionset = "\structurecounterparameter\s!userpage\c!prefixconversionset",
set = "\structurecounterparameter\s!userpage\c!prefixset",
- stopper = \!!bs\structurecounterparameter\s!userpage\c!prefixstopper\!!es,
segments = "\structurecounterparameter\s!userpage\c!prefixsegments",
connector = \!!bs\structurecounterparameter\s!userpage\c!prefixconnector\!!es,
- }}}
+ },{
+ conversion = "\structurecounterparameter\s!userpage\c!numberconversion",
+ conversionset = "\structurecounterparameter\s!userpage\c!numberconversionset",
+ starter = \!!bs\structurecounterparameter\s!userpage\c!numberstarter\!!es,
+ stopper = \!!bs\structurecounterparameter\s!userpage\c!numberstopper\!!es,
+ }
+ )}}
\prependtoks
\savecurrentpagestate
@@ -216,8 +242,9 @@
% Hooks:
+\def\currentpage{\the\realpageno}% rather useless
+
\appendtoks
- \xdef\currentpage{\the\realpageno}%
\ifnum\realpageno>\lastpage \globallet\lastpage\lastrealpage \fi
\to \everyinitializepagecounters
@@ -232,10 +259,13 @@
\def\setnextrealpageno{\global\realpageno\incrementedstructurecounter[\s!realpage]\relax}
\def\setnextsubpageno {\global\subpageno \incrementedstructurecounter[\s!subpage ]\relax}
-% Page numbers:
+% Page numbers: (can move to lua)
-\def\dodecrementpagenumber{\global\userpageno\decrementedstructurecounter[\s!userpage]\relax}
-\def\doincrementpagenumber{\global\userpageno\incrementedstructurecounter[\s!userpage]\relax}
+\def\dodecrementpagenumber {\global\userpageno\decrementedstructurecounter[\s!userpage]\relax}
+\def\doincrementpagenumber {\global\userpageno\incrementedstructurecounter[\s!userpage]\relax}
+
+\def\decrementsubpagenumber{\global\subpageno \decrementedstructurecounter[\s!subpage ]\relax}
+\def\incrementsubpagenumber{\global\subpageno \incrementedstructurecounter[\s!subpage ]\relax}
\def\dosynchronizepagenumber{\global\let\@@pnstate\v!start}
@@ -251,8 +281,6 @@
\setvalue{\??pn+\v!empty}{\doincrementpagenumber\dosynchronizepagenumber}
\letvalue{\??pn+\v!keep }\dosynchronizepagenumber
-% todo: check if number set, and reset it after testing; also take care of \global\shiftedrealpagenotrue
-
% Control:
\def\getpagestatus % hierboven gebruiken
@@ -267,7 +295,7 @@
\newtoks\everysetuppagenumbering
-\def\setuppagenumbering
+\unexpanded\def\setuppagenumbering
{\dosingleempty\dosetuppagenumbering}
\def\dosetuppagenumbering[#1]%
@@ -293,6 +321,9 @@
\ifdefined \recalculatebackgrounds \recalculatebackgrounds \fi
\to \everysetuppagenumbering
+\def\flushfinallayoutpage
+ {\doifsomething\@@nmpage{\doifnot\@@nmpage\v!no{\page[\@@nmpage]}}}
+
% The numbered location handler is there because we need to be downward
% compatible. So, in fact there can be multiple handlers active at the
% same time, but only the current one does something.
@@ -395,13 +426,6 @@
{\chardef\overallpagenumberstate\zerocount}%
\to \everysetuppagenumbering
-% \appendtoks % todo: set state: none, start, stop, reset
-% % this makes starting at an even page possible
-% \ifnum\realpageno=1 \ifodd\pageno \else
-% \global\shiftedrealpagenotrue
-% \fi \fi
-% \to \everysetupuserpagenumber
-
% Done
% \c!way=\v!by\v!part
@@ -417,6 +441,7 @@
\c!width=, % in geval van \v!marginedge
\c!left=,
\c!right=,
+ \c!page=\v!last,
\c!textseparator=\tfskip,
\c!state=\v!start,
\c!command=,
@@ -434,6 +459,14 @@
\fi
\to \everysetupuserpagenumber % todo: set state: none, start, stop, reset
+\appendtoks
+ \edef\askedsubpagenumber{\structurecounterparameter\s!subpage\c!number}%
+ \ifx\askedsubpagenumber\empty \else
+ \normalexpanded{\noexpand\setupsubpagenumber[\c!start=\structurecounterparameter\s!subpage\c!number,\c!number=]}%
+ \subpageno\rawstructurecounter[\s!subpage]%
+ \fi
+\to \everysetupsubpagenumber % todo: set state: none, start, stop, reset
+
% \setuplayout[width=300pt,backspace=4cm]
% \setuppagenumbering [alternative=doublesided]
% \setupuserpagenumber[start=2]
@@ -442,10 +475,10 @@
\def\checkpagenumbershift
{\userpageno\rawstructurecounter[\s!userpage]\relax
\ifnum\realpageno=\plusone
- \ifodd\userpageno
- \else
- \global\shiftedrealpagenotrue
- \fi
+ \ifodd\userpageno
+ \else
+ \global\pagenoshift\plusone
+ \fi
\fi}
\appendtoks % todo: set state: none, start, stop, reset
diff --git a/Master/texmf-dist/tex/context/base/strc-prc.lua b/Master/texmf-dist/tex/context/base/strc-prc.lua
index 35e7000db1f..b1a1fb0a966 100644
--- a/Master/texmf-dist/tex/context/base/strc-prc.lua
+++ b/Master/texmf-dist/tex/context/base/strc-prc.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-prc'] = {
version = 1.001,
- comment = "companion to strc-prc.tex",
+ comment = "companion to strc-prc.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/strc-prc.mkiv b/Master/texmf-dist/tex/context/base/strc-prc.mkiv
index a81cfddd15e..2955a396b5a 100644
--- a/Master/texmf-dist/tex/context/base/strc-prc.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-prc.mkiv
@@ -44,7 +44,7 @@
%D Valid keys for defining a processor are \type {style}, \type {color}, \type {left},
%D \type {right}, and \type {command} (the given command takes one argument).
-\def\defineprocessor
+\unexpanded\def\defineprocessor
{\dodoubleargument\dodefineprocessor}
\def\dodefineprocessor[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/strc-ref.lua b/Master/texmf-dist/tex/context/base/strc-ref.lua
index eb4f74ce86f..475ab318a8a 100644
--- a/Master/texmf-dist/tex/context/base/strc-ref.lua
+++ b/Master/texmf-dist/tex/context/base/strc-ref.lua
@@ -1,13 +1,14 @@
if not modules then modules = { } end modules ['strc-ref'] = {
version = 1.001,
- comment = "companion to strc-ref.tex",
+ 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"
}
-local format, find, gmatch, match = string.format, string.find, string.gmatch, string.match
-local texsprint, texwrite, texcount = tex.sprint, tex.write, tex.count
+local format, find, gmatch, match, concat = string.format, string.find, string.gmatch, string.match, table.concat
+local lpegmatch = lpeg.match
+local texsprint, texwrite, texcount, texsetcount = tex.sprint, tex.write, tex.count, tex.setcount
local trace_referencing = false trackers.register("structure.referencing", function(v) trace_referencing = v end)
@@ -18,42 +19,84 @@ local constants = interfaces.constants
-- 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
+
jobreferences = jobreferences or { }
jobreferences.tobesaved = jobreferences.tobesaved or { }
jobreferences.collected = jobreferences.collected or { }
-jobreferences.documents = jobreferences.documents or { }
jobreferences.defined = jobreferences.defined or { } -- indirect ones
jobreferences.derived = jobreferences.derived or { } -- taken from lists
jobreferences.specials = jobreferences.specials or { } -- system references
jobreferences.runners = jobreferences.runners or { }
jobreferences.internals = jobreferences.internals or { }
+jobreferences.exporters = jobreferences.exporters or { }
+jobreferences.imported = jobreferences.imported or { }
storage.register("jobreferences/defined", jobreferences.defined, "jobreferences.defined")
local tobesaved, collected = jobreferences.tobesaved, jobreferences.collected
-local defined, derived, specials, runners = jobreferences.defined, jobreferences.derived, jobreferences.specials, jobreferences.runners
+local defined, derived, specials = jobreferences.defined, jobreferences.derived, jobreferences.specials
+local exporters, runners = jobreferences.exporters, jobreferences.runners
local currentreference = nil
-jobreferences.initializers = jobreferences.initializers or { }
+local initializers = { }
+local finalizers = { }
function jobreferences.registerinitializer(func) -- we could use a token register instead
- jobreferences.initializers[#jobreferences.initializers+1] = func
+ initializers[#initializers+1] = func
+end
+function jobreferences.registerfinalizer(func) -- we could use a token register instead
+ finalizers[#finalizers+1] = func
end
local function initializer()
tobesaved, collected = jobreferences.tobesaved, jobreferences.collected
- for k,v in ipairs(jobreferences.initializers) do
- v(tobesaved,collected)
+ for i=1,#initializers do
+ initializers[i](tobesaved,collected)
+ end
+end
+local function finalizer()
+ tobesaved = jobreferences.tobesaved
+ for i=1,#finalizers do
+ finalizers[i](tobesaved)
end
end
if job then
- job.register('jobreferences.collected', jobreferences.tobesaved, initializer)
+ job.register('jobreferences.collected', jobreferences.tobesaved, initializer, finalizer)
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","locationorder",lastorder)
+end
+
+jobreferences.setnextorder = setnextorder
+
+function jobreferences.setnextinternal(kind,name)
+ setnextorder(kind,name) -- always incremented with internal
+ texsetcount("global","locationcount",texcount.locationcount + 1)
+end
+
+function jobreferences.currentorder(kind,name)
+ texwrite((orders[kind] and orders[kind][name]) or lastorder)
+end
+
function jobreferences.set(kind,prefix,tag,data)
for ref in gmatch(tag,"[^,]+") do
local p, r = match(ref,"^(%-):(.-)$")
@@ -74,9 +117,9 @@ function jobreferences.set(kind,prefix,tag,data)
end
end
-function jobreferences.setandgetattribute(kind,prefix,tag,data) -- maybe do internal automatically here
+function jobreferences.setandgetattribute(kind,prefix,tag,data,view) -- maybe do internal automatically here
jobreferences.set(kind,prefix,tag,data)
- texcount.lastdestinationattribute = jobreferences.setinternalreference(prefix,tag) or -0x7FFFFFFF
+ texcount.lastdestinationattribute = jobreferences.setinternalreference(prefix,tag,nil,view) or -0x7FFFFFFF
end
function jobreferences.enhance(prefix,tag,spec)
@@ -117,12 +160,12 @@ local special_reference = special * lparent * (operation * optional_arguments +
local scanner = (reset * outer_reference * (special_reference + inner_reference)^-1 * -1) / function() return result end
-function jobreferences.analyse(str)
- return scanner:match(str)
-end
+--~ function jobreferences.analyse(str) -- overloaded
+--~ return lpegmatch(scanner,str)
+--~ end
function jobreferences.split(str)
- return scanner:match(str or "")
+ return lpegmatch(scanner,str or "")
end
--~ print(table.serialize(jobreferences.analyse("")))
@@ -147,7 +190,7 @@ function jobreferences.resolvers.section(var)
local vi = structure.lists.collected[var.i[2]]
if vi then
var.i = vi
- var.r = (vi.references and vi.references.realpage) or 1
+ var.r = (vi.references and vi.references.realpage) or (vi.pagedata and vi.pagedata.realpage) or 1
else
var.i = nil
var.r = 1
@@ -163,7 +206,7 @@ function jobreferences.resolvers.reference(var)
local vi = var.i[2]
if vi then
var.i = vi
- var.r = (vi.references and vi.references.realpage) or 1
+ var.r = (vi.references and vi.references.realpage) or (vi.pagedata and vi.pagedata.realpage) or 1
else
var.i = nil
var.r = 1
@@ -180,10 +223,13 @@ local function register_from_lists(collected,derived)
local kind, realpage = m.kind, r.realpage
if kind and realpage then
local d = derived[prefix] if not d then d = { } derived[prefix] = d end
---~ d[reference] = { kind, i }
-for s in gmatch(reference,"[^,]+") do
- d[s] = { kind, i }
-end
+ local t = { kind, i }
+ for s in gmatch(reference,"%s*([^,]+)") do
+ if trace_referencing then
+ logs.report("referencing","list entry %s provides %s reference '%s' on realpage %s",i,kind,s,realpage)
+ end
+ d[s] = t -- share them
+ end
end
end
end
@@ -217,6 +263,10 @@ function jobreferences.urls.get(name,method,space) -- method: none, before, afte
end
end
+function commands.doifurldefinedelse(name)
+ commands.doifelse(urls[name])
+end
+
-- files
jobreferences.files = jobreferences.files or { }
@@ -237,6 +287,59 @@ function jobreferences.files.get(name,method,space) -- method: none, before, aft
end
end
+function commands.doiffiledefinedelse(name)
+ commands.doifelse(files[name])
+end
+
+-- helpers
+
+function jobreferences.checkedfile(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = files[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
+function jobreferences.checkedurl(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = urls[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 jobreferences.checkedfileorurl(whatever,default) -- return nil, nil if not resolved
+ if whatever then
+ local w = files[whatever]
+ if w then
+ return w[1], nil
+ else
+ local w = urls[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
jobreferences.programs = jobreferences.programs or { }
@@ -257,72 +360,213 @@ function jobreferences.programs.get(name)
end
end
+function jobreferences.checkedprogram(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = programs[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
-- shared by urls and files
function jobreferences.whatfrom(name)
texsprint(ctxcatcodes,(urls[name] and variables.url) or (files[name] and variables.file) or variables.unknown)
end
-function jobreferences.from(name,method,space)
+--~ function jobreferences.from(name)
+--~ local u = urls[name]
+--~ if u then
+--~ local url, file, description = u[1], u[2], u[3]
+--~ if description ~= "" then
+--~ texsprint(ctxcatcodes,format("\\dofromurldescription{%s}",description))
+--~ -- ok
+--~ elseif file and file ~= "" then
+--~ texsprint(ctxcatcodes,format("\\dofromurlliteral{%s}",url .. "/" .. file))
+--~ else
+--~ texsprint(ctxcatcodes,format("\\dofromurlliteral{%s}",url))
+--~ end
+--~ else
+--~ local f = files[name]
+--~ if f then
+--~ local description, file = f[1], f[2]
+--~ if description ~= "" then
+--~ texsprint(ctxcatcodes,format("\\dofromfiledescription{%s}",description))
+--~ else
+--~ texsprint(ctxcatcodes,format("\\dofromfileliteral{%s}",file))
+--~ end
+--~ end
+--~ end
+--~ end
+
+function jobreferences.from(name)
local u = urls[name]
if u then
local url, file, description = u[1], u[2], u[3]
if description ~= "" then
+ context.dofromurldescription(description)
-- ok
elseif file and file ~= "" then
- description = url .. "/" .. file
+ context.dofromurlliteral(url .. "/" .. file)
else
- description = url
+ context.dofromurlliteral(url)
end
- texsprint(ctxcatcodes,description)
else
local f = files[name]
if f then
local description, file = f[1], f[2]
if description ~= "" then
- --
+ context.dofromfiledescription(description)
else
- description = file
+ context.dofromfileliteral(file)
+ end
+ end
+ end
+end
+
+-- export
+
+exporters.references = exporters.references or { }
+exporters.lists = exporters.lists or { }
+
+function exporters.references.generic(data)
+ local useddata = {}
+ local entries, userdata = data.entries, data.userdata
+ if entries then
+ for k, v in next, entries do
+ useddata[k] = v
+ end
+ end
+ if userdata then
+ for k, v in next, userdata do
+ useddata[k] = v
+ end
+ end
+ return useddata
+end
+
+function exporters.lists.generic(data)
+ local useddata = { }
+ local titledata, numberdata = data.titledata, data.numberdata
+ if titledata then
+ useddata.title = titledata.title
+ end
+ if numberdata then
+ local numbers = numberdata.numbers
+ local t = { }
+ for i=1,#numbers do
+ local n = numbers[i]
+ if n ~= 0 then
+ t[#t+1] = n
+ end
+ end
+ useddata.number = concat(t,".")
+ end
+ return useddata
+end
+
+local function referencer(data)
+ local references = data.references
+ local realpage = references.realpage
+ local numberdata = jobpages.tobesaved[realpage]
+ local specification = numberdata.specification
+ return {
+ realpage = references.realpage,
+ number = numberdata.number,
+ conversion = specification.conversion,
+ -- prefix = only makes sense when bywhatever
+ }
+end
+
+function jobreferences.export(usedname)
+ local exported = { }
+ local e_references, e_lists = exporters.references, exporters.lists
+ local g_references, g_lists = e_references.generic, e_lists.generic
+ -- todo: pagenumbers
+ -- todo: some packing
+ for prefix, references in next, jobreferences.tobesaved do
+ local pe = exported[prefix] if not pe then pe = { } exported[prefix] = pe end
+ for key, data in next, references do
+ local metadata = data.metadata
+ local exporter = e_references[metadata.kind] or g_references
+ if exporter then
+ pe[key] = {
+ metadata = {
+ kind = metadata.kind,
+ catcodes = metadata.catcodes,
+ coding = metadata.coding, -- we can omit "tex"
+ },
+ useddata = exporter(data),
+ pagedata = referencer(data),
+ }
end
- texsprint(ctxcatcodes,description)
end
end
+ local pe = exported[""] if not pe then pe = { } exported[""] = pe end
+ for n, data in next, structure.lists.tobesaved do
+ local metadata = data.metadata
+ local exporter = e_lists[metadata.kind] or g_lists
+ if exporter then
+ local result = {
+ metadata = {
+ kind = metadata.kind,
+ catcodes = metadata.catcodes,
+ coding = metadata.coding, -- we can omit "tex"
+ },
+ useddata = exporter(data),
+ pagedata = referencer(data),
+ }
+ for key in gmatch(data.references.reference,"[^,]+") do
+ pe[key] = result
+ end
+ end
+ end
+ local e = {
+ references = exported,
+ version = 1.00,
+ }
+ io.savedata(file.replacesuffix(usedname or tex.jobname,"tue"),table.serialize(e,true))
end
-function jobreferences.load(name)
- if name then
- local jdn = jobreferences.documents[name]
+function jobreferences.import(usedname)
+ if usedname then
+ local imported = jobreferences.imported
+ local jdn = imported[usedname]
if not jdn then
- jdn = { }
- local fn = files[name]
- if fn then
- jdn.filename = fn[1]
- local data = io.loaddata(file.replacesuffix(fn[1],"tuc")) or ""
- if data ~= "" then
- -- quick and dirty, assume sane { } usage inside strings
- local lists = data:match("structure%.lists%.collected=({.-[\n\r]+})[\n\r]")
- if lists and lists ~= "" then
- lists = loadstring("return" .. lists)
- if lists then
- jdn.lists = lists()
- jdn.derived = { }
- register_from_lists(jdn.lists,jdn.derived)
- else
- commands.writestatus("error","invalid structure data in %s",filename)
- end
- end
- local references = data:match("jobreferences%.collected=({.-[\n\r]+})[\n\r]")
- if references and references ~= "" then
- references = loadstring("return" .. references)
- if references then
- jdn.references = references()
- else
- commands.writestatus("error","invalid reference data in %s",filename)
- end
- end
+ local filename = files[usedname]
+ if filename then -- only registered files
+ filename = filename[1]
+ else
+ filename = usedname
+ end
+ local data = io.loaddata(file.replacesuffix(filename,"tue")) or ""
+ if data == "" then
+ interfaces.showmessage("references",24,filename)
+ data = nil
+ else
+ data = loadstring(data)
+ if data then
+ data = data()
+ end
+ if data then
+ -- version check
+ end
+ if not data then
+ interfaces.showmessage("references",25,filename)
end
end
- jobreferences.documents[name] = jdn
+ if data then
+ interfaces.showmessage("references",26,filename)
+ jdn = data
+ jdn.filename = filename
+ else
+ jdn = { filename = filename, references = { }, version = 1.00 }
+ end
+ imported[usedname] = jdn
+ imported[filename] = jdn
end
return jdn
else
@@ -330,6 +574,10 @@ function jobreferences.load(name)
end
end
+function jobreferences.load(usedname)
+ -- gone
+end
+
function jobreferences.define(prefix,reference,list)
local d = defined[prefix] if not d then d = { } defined[prefix] = d end
d[reference] = { "defined", list }
@@ -366,7 +614,7 @@ local function resolve(prefix,reference,args,set) -- we start with prefix,refere
if d then
resolve(prefix,d[2],nil,set)
else
- local var = scanner:match(ri)
+ local var = lpegmatch(scanner,ri)
if var then
var.reference = ri
if not var.outer and var.inner then
@@ -438,6 +686,16 @@ function jobreferences.expandcurrent() -- todo: two booleans: o_has_tex& a_has_t
end
end
+--~ local uo = urls[outer]
+--~ if uo then
+--~ special, operation, argument = "url", uo[1], inner or uo[2] -- maybe more is needed
+--~ else
+--~ local fo = files[outer]
+--~ if fo then
+--~ special, operation, argument = "file", fo[1], inner -- maybe more is needed
+--~ end
+--~ end
+
local function identify(prefix,reference)
local set = resolve(prefix,reference)
local bug = false
@@ -455,6 +713,7 @@ local function identify(prefix,reference)
-- special()
var.kind = "special outer"
end
+ var.f = outer
elseif operation then
if arguments then
-- special(operation{argument,argument})
@@ -471,17 +730,37 @@ local function identify(prefix,reference)
var.error = "unknown special"
end
elseif outer then
- local e = jobreferences.load(outer)
+ local e = jobreferences.import(outer)
if e then
- local f = e.filename
- if f then
- if inner then
- local r = e.references
+ if inner then
+ local r = e.references
+ if r then
+ r = r[prefix]
+ if r then
+ r = r[inner]
+ if r then
+ if arguments then
+ -- outer::inner{argument}
+ var.kind = "outer with inner with arguments"
+ else
+ -- outer::inner
+ var.kind = "outer with inner"
+ end
+ var.i = { "reference", r }
+ jobreferences.resolvers.reference(var)
+ var.f = outer
+ var.e = true -- external
+ end
+ end
+ end
+ if not r then
+ r = e.derived
if r then
r = r[prefix]
if r then
r = r[inner]
if r then
+ -- outer::inner
if arguments then
-- outer::inner{argument}
var.kind = "outer with inner with arguments"
@@ -489,66 +768,76 @@ local function identify(prefix,reference)
-- outer::inner
var.kind = "outer with inner"
end
- var.i = { "reference", r }
- jobreferences.resolvers.reference(var)
- var.f = f
+ var.i = r
+ jobreferences.resolvers[r[1]](var)
+ var.f = outer
end
end
end
- if not r then
- r = e.derived
- if r then
- r = r[prefix]
- if r then
- r = r[inner]
- if r then
- -- outer::inner
- if arguments then
- -- outer::inner{argument}
- var.kind = "outer with inner with arguments"
- else
- -- outer::inner
- var.kind = "outer with inner"
- end
- var.i = r
- jobreferences.resolvers[r[1]](var)
- var.f = f
- end
- end
+ end
+ if not r then
+ var.error = "unknown outer"
+ 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
- if not r then
- var.error = "unknown outer"
- 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
+ var.f = outer
+ else
+ var.error = "unknown outer with special"
+ end
+ else
+ -- outer::
+ var.kind = "outer"
+ var.f = outer
+ end
+ else
+ if inner then
+ if arguments then
+ -- outer::inner{argument}
+ var.kind = "outer with inner with arguments"
+ else
+ -- outer::inner
+ var.kind = "outer with inner"
+ end
+ var.i = { "reference", inner }
+ jobreferences.resolvers.reference(var)
+ var.f = outer
+ 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()
- var.kind = "outer with special"
+ -- outer::special(operation)
+ var.kind = "outer with special and operation"
end
- var.f = f
else
- var.error = "unknown outer with special"
+ -- outer::special()
+ var.kind = "outer with special"
end
+ var.f = outer
else
- -- outer::
- var.kind = "outer"
- var.f = f
+ var.error = "unknown outer with special"
end
else
- var.error = "unknown outer"
+ -- outer::
+ var.kind = "outer"
+ var.f = outer
end
- else
- var.error = "unknown outer"
end
else
if arguments then
@@ -611,6 +900,7 @@ local function identify(prefix,reference)
set[i] = var
end
jobreferences.currentset = set
+-- print(bug,table.serialize(set))
return set, bug
end
@@ -651,6 +941,36 @@ function jobreferences.setinternalreference(prefix,tag,internal,view)
return destination
end
+function jobreferences.getinternalreference(n) -- n points into list
+ local l = structure.lists.collected[n]
+ texsprint(ctxcatcodes,(l and l.references.internal) or n)
+end
+
+
+--
+
+function jobreferences.get_current_metadata(tag)
+ local data = currentreference and currentreference.i
+ data = data and data.metadata and data.metadata[tag]
+ if data then
+ texsprint(ctxcatcodes,data)
+ end
+end
+local function current_metadata(tag)
+ local data = currentreference and currentreference.i
+ return data and data.metadata and data.metadata[tag]
+end
+jobreferences.current_metadata = current_metadata
+
+function jobreferences.get_current_prefixspec(default) -- todo: message
+ texsprint(ctxcatcodes,"\\getreferencestructureprefix{",
+ current_metadata("kind") or "?", "}{", current_metadata("name") or "?", "}{", default or "?", "}")
+end
+
+--~ function jobreferences.get_current_prefixspec(default) -- we can consider storing the data at the lua end
+--~ context.getreferencestructureprefix(current_metadata("kind"),current_metadata("name"),default)
+--~ end
+
--
jobreferences.filters = jobreferences.filters or { }
@@ -659,23 +979,26 @@ local filters = jobreferences.filters
local helpers = structure.helpers
local sections = structure.sections
-function jobreferences.filter(name) -- number page title ...
+function jobreferences.filter(name,...) -- number page title ...
local data = currentreference and currentreference.i
if data then
local kind = data.metadata and data.metadata.kind
if kind then
local filter = filters[kind] or filters.generic
- filter = filter and (filter[name] or filters.generic[name])
+ filter = filter and (filter[name] or filter.unknown or filters.generic[name] or filters.generic.unknown)
if filter then
- filter(data)
+ if trace_referencing then
+ logs.report("referencing","name '%s', kind '%s', using dedicated filter",name,kind)
+ end
+ filter(data,name,...)
elseif trace_referencing then
- logs.report("referencing","no (generic) filter.name for '%s'",name)
+ logs.report("referencing","name '%s', kind '%s', using generic filter",name,kind)
end
elseif trace_referencing then
- logs.report("referencing","no metadata.kind for '%s'",name)
+ logs.report("referencing","name '%s', unknown kind",name)
end
elseif trace_referencing then
- logs.report("referencing","no current reference for '%s'",name)
+ logs.report("referencing","name '%s', no reference",name)
end
end
@@ -683,7 +1006,7 @@ filters.generic = { }
function filters.generic.title(data)
if data then
- local titledata = data.titledata
+ local titledata = data.titledata or data.useddata
if titledata then
helpers.title(titledata.title or "?",data.metadata)
end
@@ -692,25 +1015,66 @@ end
function filters.generic.text(data)
if data then
- local entries = data.entries
+ local entries = data.entries or data.useddata
if entries then
helpers.title(entries.text or "?",data.metadata)
end
end
end
-function filters.generic.number(data) -- todo: spec and then no stopper
+function filters.generic.number(data,what,prefixspec) -- todo: spec and then no stopper
if data then
- helpers.prefix(data)
local numberdata = data.numberdata
if numberdata then
- sections.typesetnumber(numberdata,"number",numberdata or false)
+--~ print(table.serialize(prefixspec))
+ helpers.prefix(data,prefixspec)
+ sections.typesetnumber(numberdata,"number",numberdata)
+ else
+ local useddata = data.useddata
+ if useddata and useddsta.number then
+ tex.sprint(tex.ctxcatcodes,useddata.number)
+ end
end
end
end
+filters.generic.default = filters.generic.text
+
function filters.generic.page(data,prefixspec,pagespec)
- helpers.prefixpage(data,prefixspec,pagespec)
+ local pagedata = data.pagedata
+ if pagedata then -- imported
+ local number, conversion = pagedata.number, pagedata.conversion
+ if not number then
+ -- error
+ elseif conversion then
+ tex.sprint(tex.ctxcatcodes,format("\\convertnumber{%s}{%s}",conversion,number))
+ else
+ tex.sprint(tex.ctxcatcodes,number)
+ end
+ else
+ helpers.prefixpage(data,prefixspec,pagespec)
+ end
+end
+
+filters.user = { }
+
+function filters.user.unknown(data,name)
+ if data then
+ local userdata = data.userdata
+ local userkind = userdata and userdata.kind
+ if userkind then
+ local filter = filters[userkind] or filters.generic
+ 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
+ texsprint(ctxcatcodes,namedata)
+ end
+ end
end
filters.text = { }
@@ -731,23 +1095,29 @@ end
filters.section = { }
-filters.section.title = filters.generic.title
-filters.section.page = filters.generic.page
-
-function filters.section.number(data) -- todo: spec and then no stopper
+function filters.section.number(data,what,prefixspec)
if data then
local numberdata = data.numberdata
if numberdata then
- sections.typesetnumber(numberdata,"number",numberdata or false)
+ sections.typesetnumber(numberdata,"number",prefixspec,numberdata)
+ else
+ local useddata = data.useddata
+ if useddata and useddata.number then
+ tex.sprint(tex.ctxcatcodes,useddata.number)
+ end
end
end
end
---~ filters.float = { }
+filters.section.title = filters.generic.title
+filters.section.page = filters.generic.page
+filters.section.default = filters.section.number
---~ filters.float.title = filters.generic.title
---~ filters.float.number = filters.generic.number
---~ filters.float.page = filters.generic.page
+filters.note = { default = filters.generic.number }
+filters.formula = { default = filters.generic.number }
+filters.float = { default = filters.generic.number }
+filters.description = { default = filters.generic.number }
+filters.item = { default = filters.generic.number }
structure.references = structure.references or { }
structure.helpers = structure.helpers or { }
@@ -810,7 +1180,6 @@ function jobreferences.analyse(actions)
return actions
end
-
function jobreferences.realpage() -- special case, we always want result
local cs = jobreferences.analyse()
texwrite(cs.realpage or 0)
@@ -863,7 +1232,7 @@ end
specials.i = specials.internal
-function specials.page(var,actions)
+function specials.page(var,actions) -- is this ok?
local p = pages[var.operation]
if type(p) == "function" then
p = p()
diff --git a/Master/texmf-dist/tex/context/base/strc-ref.mkii b/Master/texmf-dist/tex/context/base/strc-ref.mkii
index d06319d0744..1df5d09d826 100644
--- a/Master/texmf-dist/tex/context/base/strc-ref.mkii
+++ b/Master/texmf-dist/tex/context/base/strc-ref.mkii
@@ -2296,6 +2296,9 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/strc-ref.mkiv b/Master/texmf-dist/tex/context/base/strc-ref.mkiv
index 5db3d0013f9..8290a1b1380 100644
--- a/Master/texmf-dist/tex/context/base/strc-ref.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-ref.mkiv
@@ -13,14 +13,17 @@
% todo: (1) configure references, (2) rendering => with presets
%
-% \starttext
-% \definestructureconversionset[default][Character,number,Romannumerals,Character][number]
-% \definestructureseparatorset [default][.,.,--][.]
-% \setupstructurehead[subsection][sectionstopper=),sectionsegments=4:4]
-
-% \setupreferencing[sectionsegments=3:4]
-% \section {One} \subsection[sec:test]{Two} See \in[sec:test]
-% \stoptext
+% \definestructureconversionset[default][Character,number,Romannumerals,Character][number]
+% \definestructureseparatorset [default][.,.,--][.]
+% \setupstructurehead[subsection][sectionstopper=),sectionsegments=4:4]
+% \setupreferencestructureprefix[default][prefixsegments=2:4]
+% \setupreferencestructureprefix[figure][default][prefixsegments=3:4]
+% \chapter {One}
+% \section {One}
+% \subsection[sec:test]{Two}
+% See \in[sec:test] and \in[fig:xx] and \in[fig:yy]
+% \placefigure[here][fig:xx]{}{}
+% \placefigure[here][fig:yy]{}{}
\writestatus{loading}{ConTeXt Structure Macros / Cross Referencing}
@@ -46,6 +49,7 @@
\let\setexecutecommandcheck\gobbletwoarguments
\def\s!full{full}
+\def\s!user{user}
\def\s!text{text}
\def\s!page{page}
@@ -89,15 +93,17 @@
%D \reference[here]{some text}
%D \stoptyping
-\def\textreference {\dosingleargument\dotextreference}
-\def\pagereference {\dosingleargument\dopagereference}
-\def\reference {\dosingleargument\doreference }
+\unexpanded\def\textreference {\dosingleargument\dotextreference}
+\unexpanded\def\pagereference {\dosingleargument\dopagereference}
+\unexpanded\def\reference {\dosingleargument\doreference }
+\unexpanded\def\setreference {\dodoubleargument\dosetreference }
%D These are implemented in a low level form as:
-\def\dotextreference[#1]{\dosetreference\s!text{#1}}
-\def\dopagereference[#1]{\dosetreference\s!page{#1}{}}
-\def\doreference [#1]{\dosetreference\s!full{#1}}
+\def\dotextreference [#1]{\dodosetreference\s!text{#1}{}}
+\def\dopagereference [#1]{\dodosetreference\s!page{#1}{}{}}
+\def\doreference [#1]{\dodosetreference\s!full{#1}{}}
+\def\dosetreference[#1][#2]{\dodosetreference\s!user{#1}{#2}{}}
%D Actually there is not much difference between a text and a
%D full reference, but it's the concept that counts. The low
@@ -110,8 +116,9 @@
\def\dofinishtextreference#1#2{\normalexpanded{\ctxlatelua{jobreferences.enhance("#1","#2",{})}}}
\let\dofinishpagereference\dofinishfullreference
+\let\dofinishuserreference\dofinishfullreference
-\def\dosetreference#1#2#3% kind labels text -> todo: userdata
+\def\dodosetreference#1#2#3#4% kind labels userdata text -> todo: userdata
{\ifreferencing
\edef\currentreferencekind{#1}%
\edef\currentreferencelabels{#2}%
@@ -119,14 +126,14 @@
\ifx\currentreferencelabels\empty \else
\ifx\currentreferenceexpansion\s!xml
\xmlstartraw
- \xdef\currentreferencetext{#3}%
+ \xdef\currentreferencedata{#4}% data, no text else conflict
\xmlstopraw
\globallet\currentreferencecoding\s!xml
\else
\ifx\currentreferenceexpansion\v!yes
- \xdef\currentreferencetext{#3}%
+ \xdef\currentreferencedata{#4}%
\else
- \xdef\currentreferencetext{\detokenize{#3}}%
+ \xdef\currentreferencedata{\detokenize{#4}}%
\fi
\globallet\currentreferencecoding\s!tex
\fi
@@ -144,13 +151,16 @@
catcodes = \the\catcodetable,
xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text
},
- entries = {
- text = \!!bs\currentreferencetext\!!es
- }
- })
+ \ifx\currentreferencedata\empty\else
+ entries = {
+ text = \!!bs\currentreferencedata\!!es
+ },
+ \fi
+ userdata = structure.helpers.touserdata(\!!bs\detokenize{#3}\!!es)
+ },"\@@iafocus")
}%
\xdef\currentdestinationattribute{\number\lastdestinationattribute}%
- \begingroup\dosetattribute{destination}\currentdestinationattribute\hbox{}\endgroup % todo
+ \begingroup\attribute\destinationattribute\currentdestinationattribute\hbox{}\endgroup % todo
\fi
\fi}
@@ -357,7 +367,7 @@
%D We can trace references by setting the next switch to
%D true.
-\def\definereference
+\unexpanded\def\definereference
{\dodoubleempty\dodefinereference}
\def\dodefinereference[#1][#2]%
@@ -504,18 +514,27 @@
%D \gotosomeinternal {tag}{identifier}{pagenumber}{text}
%D \stoptyping
+%D We could do this in lua ...
+
\newif \iflocation
\newcount\locationcount
+\newcount\locationorder
\newbox \locationbox
-\def\nextinternalreference
- {\the\locationcount}
+\def\nextinternalreference {\the\locationcount}
+\def\nextinternalorderreference{\the\locationorder}
\def\setnextinternalreference
{\global\advance\locationcount\plusone}
+\def\setnextinternalreferences#1#2% plural
+ {\ctxlua{jobreferences.setnextinternal("#1","#2")}}
+
+\def\getinternalorderreference#1#2%
+ {\ctxlua{jobreferences.currentorder("#1","#2")}}
+
\def\thisissomeinternal#1#2% tag reference (only for old time sake)
- {\begingroup\dosetattribute{destination}{\ctxlua{jobreferences.mark("#1:#2")}}\hbox{}\endgroup}
+ {\begingroup\attribute\destinationattribute\ctxlua{jobreferences.mark("#1:#2")}\hbox{}\endgroup}
\def\gotosomeinternal#1#2#3#4%
{\ifinternalnamedreferences
@@ -570,7 +589,7 @@
\chardef\autocrossfilereferences=0
-\def\setupreferencing
+\unexpanded\def\setupreferencing
{\dosingleargument\dosetupreferencing}
\def\dosetupreferencing[#1]%
@@ -602,10 +621,25 @@
{\settrue \autoglobalfilereferences}
{\setfalse\autoglobalfilereferences}}
+% \appendtoks\ctxlua{jobreferences.export("whatever")}\to\everystoptext
+% \starttext
+% \chapter[test]{test}
+% test \in{IN}[more] and \in{IN}[test] or \at{AT}[more] and \at{AT}[test]\par
+% test \in{IN}[whatever::more] and \in{IN}[whatever::test] or \at{AT}[whatever::more] and \at{AT}[whatever::test] \page
+% reference\reference[more]{oeps}
+% \stoptext
+
+\def\exportreferences
+ {\doif\@@rfexport\v!yes{\ctxlua{jobreferences.export()}}}
+
+\appendtoks
+ \exportreferences
+\to \everygoodbye
+
\def\incrementreferenceprefix{+}
\def\decrementreferenceprefix{-}
-\def\setupreferenceprefix[#1]%
+\unexpanded\def\setupreferenceprefix[#1]%
{\edef\@@rfprefix{#1}%
\ifx\@@rfprefix\empty
\let\referenceprefix\empty
@@ -731,8 +765,11 @@
\def\currentreferencepage {\ctxlua{jobreferences.filter("page")}}
\def\currentreferencetitle {\ctxlua{jobreferences.filter("title")}}
\def\currentreferencetext {\ctxlua{jobreferences.filter("text")}}
+\def\currentreferencedefault {\ctxlua{jobreferences.filter("default")}}
\def\currentreferencerealpage{\ctxlua{jobreferences.realpage()}}
+\def\getreferenceentry#1{\ctxlua{jobreferences.filter("#1")}} % user entry
+
\unexpanded\def\dospecialabout[#1]%
{\dontleavehmode
\begingroup
@@ -762,35 +799,62 @@
% Yet untested:
\unexpanded\def\somewhere#1#2#3[#4]% #3 gobbles space around #2 % todo
- {\goto{\ifcase\referencepagestate#1/#2\or#2\or#1\or#2\fi}[#4]}
+ {\doifreferencefoundelse{#4}% kind of inefficient as \goto also analyses
+ {\goto{\analyzecurrentreference\ifcase\referencepagestate\relax#1/#2\or#2\or#1\or#2\fi}[#4]}
+ {[#1/#2]}}
\unexpanded\def\atpage[#1]% todo
- {\goto{\ifcase\referencepagestate
- \labeltexts\v!page\dummyreference
- \or
- \labeltexts\v!atpage\currentreferencepage
- \or
- \labeltexts\v!atpage\currentreferencepage
- \or
- \labeltexts\v!atpage\currentreferencepage
- \or
- \labeltext\v!hereafter
- \or
- \labeltext\v!hencefore
- \fi}[#1]}
+ {\doifreferencefoundelse{#1}% kind of inefficient as \goto also analyses
+ {\goto{\analyzecurrentreference\ifcase\referencepagestate
+ \labeltexts\v!page\dummyreference
+ \or
+ \labeltexts\v!atpage\currentreferencepage
+ \or
+ \labeltexts\v!atpage\currentreferencepage
+ \or
+ \labeltexts\v!atpage\currentreferencepage
+ \or
+ \labeltext\v!hereafter
+ \or
+ \labeltext\v!hencefore
+ \fi}[#1]}
+ {[?]}}
+
+\unexpanded\def\referencesymbol
+ {\hbox{\strut\high
+ {\setupsymbolset[\@@iasymbolset]%
+ \symbol
+ [\ifcase\referencepagestate
+ \v!somewhere
+ \or % same
+ \v!nowhere
+ \or % before
+ \v!previous
+ \or % after
+ \v!next%
+ \fi]}}}
+
+% \def\dosymbolreference#1#2[#3]%
+% {\removeunwantedspaces
+% \goto{\setupsymbolset[\@@iasymbolset]\high{\symbol
+% [\ifcase\referencepagestate
+% \v!somewhere
+% \or % same
+% \v!nowhere
+% \or % before
+% \v!previous
+% \or % after
+% \v!next%
+% \fi]}}[#3]}
\def\dosymbolreference#1#2[#3]%
{\removeunwantedspaces
- \goto{\setupsymbolset[\@@iasymbolset]\high{\symbol
- [\ifcase\referencepagestate
- \v!somewhere
- \or % same
- \v!nowhere
- \or % before
- \v!previous
- \or % after
- \v!next%
- \fi]}}[#3]}
+ \goto{\referencesymbol}[#3]}
+
+\def\symbolreference[#1]%
+ {\removeunwantedspaces
+ \goto{\referencesymbol}[#1]}
+
%D The other alternatives just conform their names: only the
%D label, only the text, or the label and the text.
@@ -841,7 +905,7 @@
% todo: inherit; probably not yet mkiv okay
-\def\definereferenceformat
+\unexpanded\def\definereferenceformat
{\dodoubleargument\dodefinereferenceformat}
\def\dodefinereferenceformat[#1][#2]%
@@ -853,7 +917,7 @@
\c!label=, % can be {left}{right}
\c!command=\in,
#2]%
- \unexpanded\setvalue{#1}%
+ \setuvalue{#1}%
{\dontleavehmode\doexecutereferenceformat{#1}}%
\fi}
@@ -906,8 +970,8 @@
% [\inxx{a}{b}[one]]
% \stoptext
-\unexpanded\def\dospecialin{\let\currentreferencecontent\currentreferencenumber\doinatreference}
-\unexpanded\def\dospecialat{\let\currentreferencecontent\currentreferencepage \doinatreference}
+\unexpanded\def\dospecialin{\let\currentreferencecontent\currentreferencedefault\doinatreference}
+\unexpanded\def\dospecialat{\let\currentreferencecontent\currentreferencepage \doinatreference}
\newtoks\leftreferencetoks
\newtoks\rightreferencetoks
@@ -988,8 +1052,8 @@
\def\extrareferencearguments{\luaconditional\highlighthyperlinks,\luaconditional\gotonewwindow,"\currentviewerlayer"}
-\unexpanded\def\directgoto {\ifconditional\uselocationstrut\expandafter\dodirectgoto\else\expandafter\directgotohtdp\fi}
-\unexpanded\def\goto {\ifconditional\uselocationstrut\expandafter\dogoto \else\expandafter\gotohtdp \fi}
+\unexpanded\def\directgoto{\ifconditional\uselocationstrut\expandafter\dodirectgoto\else\expandafter\directgotohtdp\fi}
+\unexpanded\def\goto {\ifconditional\uselocationstrut\expandafter\dogoto \else\expandafter\gotohtdp \fi}
% The unbox trick is needed in order to permit \par inside a reference. Otherwise
% the reference attribute migrates to the outer boxes.
@@ -1169,6 +1233,9 @@
\def\dousefile[#1][#2][#3]%
{\ctxlua{jobreferences.files.define("#1",\!!bs\detokenize{#2}\!!es,\!!bs\detokenize{#3}\!!es)}}
+\def\doifurldefinedelse #1{\ctxlua{commands.doifurldefinedelse ("#1")}}
+\def\doiffiledefinedelse#1{\ctxlua{commands.doiffiledefinedelse("#1")}}
+
%D \macros
%D {url,setupurl}
%D
@@ -1186,7 +1253,7 @@
%D
%D \showsetup{setupurl}
-\def\setupurl
+\unexpanded\def\setupurl
{\dodoubleargument\getparameters[\??ur]}
\unexpanded\def\url[#1]%
@@ -1194,16 +1261,18 @@
\begingroup
\dosetfontattribute\??ur\c!style
\dosetcolorattribute\??ur\c!color
- \ctxlua{jobreferences.urls.get("#1","\@@uralternative","\@@urspace")}%
+ \hyphenatedurl{\ctxlua{jobreferences.urls.get("#1","\@@uralternative","\@@urspace")}}%
\endgroup}
+% # fails
+
%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 [sentence_sentence~sentence//sentence:sentence.sentence]
%D \stopbuffer
%D
%D \typebuffer
@@ -1235,11 +1304,25 @@
%D
%D \showsetup{from}
-\def\dospecialfrom
+%D We keep this for compatibility reasons, hence the hackery.
+
+\unexpanded\def\dospecialfrom
{\dosingleempty\dodospecialfrom}
\def\dodospecialfrom[#1]%
- {\dontleavehmode\goto{\ctxlua{jobreferences.from("#1")}}[url(#1)]}
+ {\dontleavehmode
+ \goto{\ctxlua{jobreferences.from("#1")}}[fileorurl(#1)]}
+
+\def\dofromurldescription#1%
+ {#1}
+
+\def\dofromurlliteral#1%
+ {\dosetfontattribute \??ur\c!style
+ \dosetcolorattribute\??ur\c!color
+ \hyphenatedurl{#1}}
+
+\let\dofromfiledescription\dofromurldescription
+\let\dofromfileliteral \dofromurlliteral % maybe some day setupfile that inherits from url
%D We also support:
%D
@@ -1266,10 +1349,10 @@
% also lua, like urls and files
-\def\setupprograms
+\unexpanded\def\setupprograms
{\dodoubleargument\getparameters[\??pr]}
-\def\defineprogram
+\unexpanded\def\defineprogram
{\dotripleargument\dodefineprogram}
\def\dodefineprogram[#1][#2][#3]%
@@ -1316,7 +1399,7 @@
%D
%D \showsetup{gotopage}
-\def\definepage
+\unexpanded\def\definepage
{\dodoubleargument\dodefinepage}
\def\dodefinepage[#1][#2]%
@@ -1400,7 +1483,7 @@
%D
%D \showsetup{setupbuttons}
-\def\setupbuttons
+\unexpanded\def\setupbuttons
{\dodoubleargument\getparameters[\??bt]}
\definecomplexorsimpleempty\button
@@ -1572,7 +1655,7 @@
\setbox\scratchbox\hbox{#1}% to be solved some day
\ifdim\wd\scratchbox>\zeropoint
\unhbox\scratchbox
- \@@rfseparator
+ \doifsomething\@@rfseparator{\removeunwantedspaces\@@rfseparator}% remove is new
\else
\unhbox\scratchbox
\fi
@@ -1596,7 +1679,8 @@
\c!right=\egroup,
\c!global=\v!no,
\c!expansion=\v!no,
- \c!separator=\nonbreakablespace]
+ \c!separator=\nonbreakablespace,
+ \c!export=\v!no]
\setupurl
[\c!alternative=\v!both,
@@ -1678,6 +1762,72 @@
%D We cannot set up buttons (not yet, this one calls a menu macro):
+%D New (and experimental):
+
+% \starttext
+% \chapter{test}
+% \placefigure[here][xx:1]{}{\framed{one}} \placefigure[here][xx:2]{}{\framed{three}}
+% \placetable [here][xx:3]{}{\framed{two}} \placetable [here][xx:4]{}{\framed{four}}
+% \start
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[float][default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[figure][default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank
+% \stoptext
+
+\unexpanded\def\setupreferencestructureprefix
+ {\dotripleargument\dosetupreferencestructureprefix}
+
+\def\getreferencestructureprefix#1#2#3%
+ {{
+ prefix = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefix",
+ separatorset = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixseparatorset",
+ conversion = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconversion",
+ conversionset = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconversionset",
+ set = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixset",
+ segments = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixsegments",
+ connector = \!!bs\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconnector\!!es,
+ }}
+
+\unexpanded\def\setupreferencestructureprefix
+ {\dotripleempty\dosetupreferencestructureprefix}
+
+\def\dosetupreferencestructureprefix[#1][#2][#3]%
+ {\ifthirdargument
+ \getparameters[\??rf:\c!prefix:#1:#2][#3]%
+ \else\ifsecondargument
+ \getparameters[\??rf:\c!prefix::#1][#2]%
+ \fi\fi}
+
+\def\referencestructureprefixparameter#1#2#3#4% kind name category parameter
+ {\ifcsname\??rf:\c!prefix:#2:#3#4\endcsname
+ \csname\??rf:\c!prefix:#2:#3#4\endcsname
+ \else\ifcsname\??rf:\c!prefix:#1:#3#4\endcsname
+ \csname\??rf:\c!prefix:#1:#3#4\endcsname
+ \else\ifcsname\??rf:\c!prefix::#3#4\endcsname
+ \csname\??rf:\c!prefix::#3#4\endcsname
+ \fi\fi\fi}
+
+% \def\getreferencestructureprefixspec#1% we can save one call by moving this to the lua end
+% {\getreferencestructureprefix
+% {\ctxlua{jobreferences.get_current_metadata("kind")}}
+% {\ctxlua{jobreferences.get_current_metadata("name")}}
+% {#1}}
+% \def\currentreferencedefault
+% {\ctxlua{jobreferences.filter("default",\getreferencestructureprefixspec\v!default)}}
+%
+% this is shortcut for:
+
+\def\currentreferencedefault
+ {\ctxlua{jobreferences.filter("default",\ctxlua{jobreferences.get_current_prefixspec("\v!default")})}}
+
\protect \endinput
% tricky:
diff --git a/Master/texmf-dist/tex/context/base/strc-reg.lua b/Master/texmf-dist/tex/context/base/strc-reg.lua
index b406ea1b057..c5b2c93741c 100644
--- a/Master/texmf-dist/tex/context/base/strc-reg.lua
+++ b/Master/texmf-dist/tex/context/base/strc-reg.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['strc-reg'] = {
version = 1.001,
- comment = "companion to strc-reg.tex",
+ 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"
@@ -8,25 +8,38 @@ if not modules then modules = { } end modules ['strc-reg'] = {
local next, type = next, type
local texwrite, texsprint, texcount = tex.write, tex.sprint, tex.count
-local format, gmatch = string.format, string.gmatch
+local format, gmatch, concat = string.format, string.gmatch, table.concat
local utfchar = utf.char
+local lpegmatch = lpeg.match
+
+local trace_registers = false trackers.register("structure.registers", function(v) trace_registers = v end)
local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
-local helpers = structure.helpers
-local sections = structure.sections
-local documents = structure.documents
-local pages = structure.pages
+local helpers = structure.helpers
+local sections = structure.sections
+local documents = structure.documents
+local pages = structure.pages
+local processors = structure.processors
+
+local mappings = sorters.mappings
+local entries = sorters.entries
+local replacements = sorters.replacements
+
+local processor_split = processors.split
+
+local matching_till_depth, number_at_depth = sections.matching_till_depth, sections.number_at_depth
--- to be shared, but tested first
+-- some day we will share registers and lists (although there are some conceptual
+-- differences in the application of keywords)
local function filter_collected(names,criterium,number,collected,prevmode)
if not criterium or criterium == "" then criterium = variables.all end
local data = documents.data
local numbers, depth = data.numbers, data.depth
- local hash, result, all = { }, { }, not names or names == "" or names == variables.all
+ local hash, result, all, detail = { }, { }, not names or names == "" or names == variables.all, nil
if not all then
for s in gmatch(names,"[^, ]+") do
hash[s] = true
@@ -117,38 +130,51 @@ local function filter_collected(names,criterium,number,collected,prevmode)
return filter_collected(names,variables.current,number,collected,prevmode)
end
else -- sectionname, number
+ -- beware, this works ok for registers
local depth = sections.getlevel(criterium)
- local number = tonumber(number) or 0
- for i=1,#collected do
- local v = collected[i]
- local r = v.references
- if r then
- local sectionnumber = jobsections.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 (number == 0 or cnumbers[depth] == number) then
- result[#result+1] = v
+ local number = tonumber(number) or number_at_depth(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 = jobsections.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 matching_till_depth(depth,cnumbers) then
+ result[#result+1] = v
+ end
end
end
end
end
end
end
+ if trace_registers then
+ if detail then
+ logs.report("registers","criterium: %s, %s, found: %s",criterium,detail,#result)
+ else
+ logs.report("registers","criterium: %s, found: %s",criterium,#result)
+ end
+ end
return result
end
-structure.filter_collected = filter_collected
+jobregisters = jobregisters or { }
+jobregisters.collected = jobregisters.collected or { }
+jobregisters.tobesaved = jobregisters.tobesaved or { }
+
+jobregisters.filter_collected = filter_collected
-- 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
-jobregisters = jobregisters or { }
-jobregisters.collected = jobregisters.collected or { }
-jobregisters.tobesaved = jobregisters.tobesaved or { }
-
local tobesaved, collected = jobregisters.tobesaved, jobregisters.collected
local function initializer()
@@ -189,23 +215,45 @@ end
jobregisters.define = allocate
-local entrysplitter = lpeg.Ct(lpeg.splitat('+'))
+local entrysplitter = lpeg.Ct(lpeg.splitat('+')) -- & obsolete in mkiv
local tagged = { }
local function preprocessentries(rawdata)
local entries = rawdata.entries
if entries then
- local et = entrysplitter:match(entries[1]) -- alse &
- local kt = entrysplitter:match(entries[2]) -- alse &
+ local e, k = entries[1] or "", entries[2] or ""
+ local et, kt, entryproc, pageproc
+ if type(e) == "table" then
+ et = e
+ else
+ entryproc, e = processor_split(e)
+ et = lpegmatch(entrysplitter,e)
+ end
+ if type(k) == "table" then
+ kt = e
+ else
+ pageproc, k = processor_split(k)
+ kt = lpegmatch(entrysplitter,k)
+ end
entries = { }
for k=1,#et do
entries[k] = { et[k] or "", kt[k] or "" }
end
+ for k=#et,1,-1 do
+ if entries[k][1] ~= "" then
+ break
+ else
+ entries[k] = nil
+ end
+ end
rawdata.list = entries
+ if pageproc or entryproc then
+ rawdata.processors = { entryproc, pageproc }
+ end
rawdata.entries = nil
else
- rawdata.list = { "", "" } -- br
+ rawdata.list = { { "", "" } } -- br
end
end
@@ -239,12 +287,12 @@ function jobregisters.extend(name,tag,rawdata) -- maybe do lastsection internall
rr.lastsection = structure.sections.currentid()
if rawdata then
preprocessentries(rawdata)
- for k,v in pairs(rawdata) do
+ for k,v in next, rawdata do
if not r[k] then
r[k] = v
else
local rk = r[k]
- for kk,vv in pairs(v) do
+ for kk,vv in next, v do
if vv ~= "" then
rk[kk] = vv
end
@@ -258,43 +306,27 @@ end
-- sorting and rendering
+local compare = sorters.comparers.basic
+
function jobregisters.compare(a,b)
- local result = 0
- local compare = sorters.comparers.basic
- local ea, eb = a.split, b.split
- local na, nb = #ea, #eb
- local max = na
- if nb < max then max = nb end
- for i=1,max do
- if result == 0 then
- result = compare(ea[i],eb[i])
- else
- return result
- end
- end
+ local result = compare(a,b)
if result ~= 0 then
return result
- elseif na > nb then
- return 1
- elseif nb > na then
- return -1
elseif a.metadata.kind == 'entry' then -- e/f/t
local page_a, page_b = a.references.realpage, b.references.realpage
if not page_a or not page_b then
---~ print(table.serialize(a),table.serialize(b))
return 0
elseif page_a < page_b then
return -1
elseif page_a > page_b then
return 1
end
- else
- return 0
end
+ return 0
end
function jobregisters.filter(data,options)
- data.result = structure.filter_collected(nil,options.criterium,options.number,data.entries,true)
+ data.result = jobregisters.filter_collected(nil,options.criterium,options.number,data.entries,true)
end
function jobregisters.prepare(data)
@@ -327,7 +359,9 @@ end
function jobregisters.unique(data,options)
local result, prev, equal = { }, nil, table.are_equal
- for _,v in ipairs(data.result) do
+ local dataresult = data.result
+ for k=1,#dataresult do
+ local v = dataresult[k]
if not prev then
result[#result+1], prev = v, v
else
@@ -356,17 +390,21 @@ end
function jobregisters.finalize(data,options)
local result = data.result
data.metadata.nofsorted = #result
- local split = { }
+ local split, lasttag, s, d = { }, nil, nil, nil
-- maps character to index (order)
for k=1,#result do
local v = result[k]
- local entry, tag = sorters.firstofsplit(v.split)
- local s = split[tag] -- keeps track of change
- if not s then
- s = { tag = tag, data = { } }
- split[tag] = s
+ local entry, tag = sorters.firstofsplit(v)
+ if tag ~= lasttag then
+ if trace_registers then
+ logs.report("registers","splitting at %s",tag)
+ end
+ d = { }
+ s = { tag = tag, data = d }
+ split[#split+1] = s
+ lasttag = tag
end
- s.data[#s.data+1] = v
+ d[#d+1] = v
end
data.result = split
end
@@ -374,7 +412,8 @@ end
function jobregisters.analysed(class,options)
local data = collected[class]
if data and data.entries then
- sorters.language = options.language or sorters.defaultlanguage
+ options = options or { }
+ sorters.setlanguage(options.language)
jobregisters.filter(data,options) -- filter entries into results (criteria)
jobregisters.prepare(data,options) -- adds split table parallel to list table
jobregisters.sort(data,options) -- sorts results
@@ -389,6 +428,16 @@ end
-- todo take conversion from index
+function jobregisters.userdata(index,name)
+ local data = jobreferences.internals[tonumber(index)]
+ data = data and data.userdata and data.userdata[name]
+ if data then
+ texsprint(ctxcatcodes,data)
+ end
+end
+
+-- proc can be wrapped
+
function jobregisters.flush(data,options,prefixspec,pagespec)
local equal = table.are_equal
texsprint(ctxcatcodes,"\\startregisteroutput")
@@ -399,25 +448,51 @@ function jobregisters.flush(data,options,prefixspec,pagespec)
local function pagenumber(entry)
local er = entry.references
texsprint(ctxcatcodes,format("\\registeronepage{%s}{%s}{",er.internal or 0,er.realpage or 0)) -- internal realpage content
- helpers.prefixpage(entry,prefixspec,pagespec)
+ local proc = entry.processors and entry.processors[2]
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ helpers.prefixpage(entry,prefixspec,pagespec)
+ texsprint(ctxcatcodes,"}")
+ else
+ helpers.prefixpage(entry,prefixspec,pagespec)
+ end
texsprint(ctxcatcodes,"}")
end
local function pagerange(f_entry,t_entry,is_last)
local er = f_entry.references
texsprint(ctxcatcodes,format("\\registerpagerange{%s}{%s}{",er.internal or 0,er.realpage or 0))
- helpers.prefixpage(f_entry,prefixspec,pagespec)
+ local proc = f_entry.processors and f_entry.processors[2]
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ helpers.prefixpage(f_entry,prefixspec,pagespec)
+ texsprint(ctxcatcodes,"}")
+ else
+ helpers.prefixpage(f_entry,prefixspec,pagespec)
+ end
local er = t_entry.references
- texsprint(ctxcatcodes,format("}{%s}{%s}{",er.internal or 0,er.realpage or 0))
+ texsprint(ctxcatcodes,format("}{%s}{%s}{",er.internal or 0,er.lastrealpage or er.realpage or 0))
if is_last then
- helpers.prefixlastpage(t_entry,prefixspec,pagespec) -- swaps page and realpage keys
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ helpers.prefixlastpage(t_entry,prefixspec,pagespec) -- swaps page and realpage keys
+ texsprint(ctxcatcodes,"}")
+ else
+ helpers.prefixlastpage(t_entry,prefixspec,pagespec) -- swaps page and realpage keys
+ end
else
- helpers.prefixpage(t_entry,prefixspec,pagespec)
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ helpers.prefixpage(t_entry,prefixspec,pagespec)
+ texsprint(ctxcatcodes,"}")
+ else
+ helpers.prefixpage(t_entry,prefixspec,pagespec)
+ end
end
texsprint(ctxcatcodes,"}")
end
-- ranges need checking !
- for k, letter in ipairs(table.sortedkeys(result)) do
- local sublist = result[letter]
+ for i=1,#result do
+ local sublist = result[i]
local done = { false, false, false, false }
local data = sublist.data
local d, n = 0, 0
@@ -426,6 +501,7 @@ function jobregisters.flush(data,options,prefixspec,pagespec)
d = d + 1
local entry = data[d]
local e = { false, false, false, false }
+ local metadata = entry.metadata
for i=1,4 do -- max 4
if entry.list[i] then
e[i] = entry.list[i][1]
@@ -445,7 +521,27 @@ function jobregisters.flush(data,options,prefixspec,pagespec)
texsprint(ctxcatcodes,format("\\startregisterentries{%s}",n))
end
end
- texsprint(ctxcatcodes,format("\\registerentry{%s}",e[i]))
+ if metadata then
+ texsprint(ctxcatcodes,"\\registerentry{")
+ local proc = entry.processors and entry.processors[1]
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ helpers.title(e[i],metadata)
+ texsprint(ctxcatcodes,"}")
+ else
+ helpers.title(e[i],metadata)
+ end
+ texsprint(ctxcatcodes,"}")
+ else
+ local proc = entry.processors and entry.processors[1]
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ texsprint(ctxcatcodes,format("\\registerentry{%s}",e[i]))
+ texsprint(ctxcatcodes,"}")
+ else
+ texsprint(ctxcatcodes,format("\\registerentry{%s}",e[i]))
+ end
+ end
else
done[i] = false
end
@@ -454,6 +550,7 @@ function jobregisters.flush(data,options,prefixspec,pagespec)
local kind = entry.metadata.kind
if kind == 'entry' then
texsprint(ctxcatcodes,"\\startregisterpages")
+ --~ collapse_ranges = true
if collapse_singles or collapse_ranges then
-- we collapse ranges and keep existing ranges as they are
-- so we get prebuilt as well as built ranges
@@ -604,7 +701,14 @@ function jobregisters.flush(data,options,prefixspec,pagespec)
elseif kind == 'see' then
-- maybe some day more words
texsprint(ctxcatcodes,"\\startregisterseewords")
- texsprint(ctxcatcodes,format("\\registeroneword{0}{0}{%s}",entry.seeword.text)) -- todo: internal
+ local proc = entry.processors and entry.processors[1]
+ if proc then
+ texsprint(ctxcatcodes,"\\applyprocessor{",proc,"}{")
+ texsprint(ctxcatcodes,format("\\registeroneword{0}{0}{%s}",entry.seeword.text)) -- todo: internal
+ texsprint(ctxcatcodes,"}")
+ else
+ texsprint(ctxcatcodes,format("\\registeroneword{0}{0}{%s}",entry.seeword.text)) -- todo: internal
+ end
texsprint(ctxcatcodes,"\\stopregisterseewords")
end
end
@@ -629,4 +733,3 @@ function jobregisters.process(class,...)
jobregisters.flush(collected[class],...)
end
end
-
diff --git a/Master/texmf-dist/tex/context/base/strc-reg.mkii b/Master/texmf-dist/tex/context/base/strc-reg.mkii
index 8d824bd9dcd..b088246d327 100644
--- a/Master/texmf-dist/tex/context/base/strc-reg.mkii
+++ b/Master/texmf-dist/tex/context/base/strc-reg.mkii
@@ -98,7 +98,8 @@
\doifelse{\registerparameter\c!ownnumber}\v!yes
\donetrue\donefalse
\expanded{\writeutility{r % spaces are essential
- {\ifcase\registerpagestatus\space\or e\or f\or t\fi} {\currentregister} %
+ \ifcase\registerpagestatus\space\or e\or f\or t\fi\space
+ {\currentregister} %
{\nextinternalreference} %
{\asciiregisterentryA} %
{\asciiregisterentryB} %
diff --git a/Master/texmf-dist/tex/context/base/strc-reg.mkiv b/Master/texmf-dist/tex/context/base/strc-reg.mkiv
index 2ec448d97fe..fcc37549c44 100644
--- a/Master/texmf-dist/tex/context/base/strc-reg.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-reg.mkiv
@@ -57,14 +57,14 @@
\def\detokenizedregisterparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??id#1\endcsname}} % always root
-\def\registerparameter #1{\csname\doregisterparameter{\??id\currentregister}#1\endcsname}
+\def\registerparameter #1{\csname\doregisterparameter{\??id\currentregister}{#1}\endcsname}
\def\registerparameterhash#1{\doregisterparameterhash {\??id\currentregister}#1}
-\def\doregisterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doregisterparentparameter \csname#1\s!parent\endcsname#2\fi}
-\def\doregisterparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\doregisterparentparameterhash\csname#1\s!parent\endcsname#2\fi}
+\def\doregisterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doregisterparentparameter \csname#1\s!parent\endcsname{#2}\fi}
+\def\doregisterparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\doregisterparentparameterhash\csname#1\s!parent\endcsname{#2}\fi}
-\def\doregisterparentparameter #1#2{\ifx#1\relax\s!empty\else\doregisterparameter #1#2\fi}
-\def\doregisterparentparameterhash#1#2{\ifx#1\relax \else\doregisterparameterhash#1#2\fi}
+\def\doregisterparentparameter #1#2{\ifx#1\relax\s!empty\else\doregisterparameter #1{#2}\fi}
+\def\doregisterparentparameterhash#1#2{\ifx#1\relax \else\doregisterparameterhash#1{#2}\fi}
\def\dosetregisterattributes#1#2% style color
{\edef\fontattributehash {\registerparameterhash#1}%
@@ -76,7 +76,7 @@
\newtoks\everysetupregister
-\def\setupregisters
+\unexpanded\def\setupregisters
{\dotripleempty\dosetupregisters}
\def\dosetupregisters[#1][#2][#3]%
@@ -116,6 +116,7 @@
\c!unknownreference=\v!empty,
\c!prefix=\v!both,
%\c!expansion=,
+%\c!xmlsetup=,
\c!pageprefixconnector=\endash,
\c!pagesegments=2:2,
\c!file=\jobname,
@@ -124,16 +125,16 @@
%D Definition:
-\def\defineregister
+\unexpanded\def\defineregister
{\dodoubleargument\dodefineregister}
\def\dodefineregister[#1][#2]% #2?
{\setupregister[#1][\s!parent=\??id]%
\ctxlua{jobregisters.define('#1')}%
\presetheadtext[#1=\Word{#1}]%
- \unexpanded\setvalue{#1}{\dodoubleempty\doregister[#1]}%
- \unexpanded\setvalue{\e!see#1}{\dodoubleempty\doseeregister[#1]}%
-% \unexpanded\setvalue{\e!coupled#1}{\dolinkedregister{#1}}%
+ \setuvalue{#1}{\dodoubleempty\doregister[#1]}%
+ \setuvalue{\e!see#1}{\dodoubleempty\doseeregister[#1]}%
+% \setuvalue{\e!coupled#1}{\dolinkedregister{#1}}%
\setvalue{\e!place#1}{\placeregister[#1]}%
\setvalue{\e!complete#1}{\completeregister[#1]}%
\setvalue{\e!setup#1\e!endsetup}[##1]{\getparameters[\??id#1][##1]}}
@@ -144,32 +145,85 @@
% tzt variant met n entries, parameters en userdata (altnum)
-\def\doregisterstructurepageregister#1#2#3% register data userdata
+\getparameters
+ [\??id]
+ [\c!label=,
+ \c!entries=,
+ \c!entries:1=,\c!entries:2=,\c!entries:3=,
+ \c!keys:1=,\c!keys:2=,\c!keys:3=,
+ \c!alternative=]
+
+\def\doregisterstructurepageregister
+ {\iftrialtypesetting
+ \expandafter\gobblethreearguments
+ \else
+ \expandafter\dodoregisterstructurepageregister
+ \fi}
+
+\def\dodoregisterstructurepageregister#1#2#3% register data userdata
{\begingroup
\edef\currentregister{#1}%
- \getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
+ %getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
+ \getparameters[\??id][#2]%
\edef\currentregisterlabel {\registerparameter\c!label}%
\edef\currentregisterexpansion{\registerparameter\c!expansion}%
\edef\currentregisterownnumber{\registerparameter\c!ownnumber}%
\xdef\currentregisterkeys {\registerparameter\c!keys}%
- \ifx\currentregisterexpansion\s!xml
- \xmlstartraw
- \xdef\currentregisterentries{\registerparameter\c!entries}%
- \xmlstopraw
- \globallet\currentregistercoding\s!xml
+ \xdef\currentregisterentries {\registerparameter\c!entries}%
+ \xdef\currentregisterxmlsetup {\registerparameter\c!xmlsetup}%
+ \ifx\currentregisterentries\empty
+ \ifx\currentregisterexpansion\s!xml
+ \xmlstartraw
+ \xdef\currentregisterentriesa{\registerparameter{\c!entries:1}}%
+ \xdef\currentregisterentriesb{\registerparameter{\c!entries:2}}%
+ \xdef\currentregisterentriesc{\registerparameter{\c!entries:3}}%
+ \xmlstopraw
+ \globallet\currentregistercoding\s!xml
+ \else
+ \ifx\currentregisterexpansion\v!yes
+ \xdef\currentregisterentriesa{\registerparameter{\c!entries:1}}%
+ \xdef\currentregisterentriesb{\registerparameter{\c!entries:2}}%
+ \xdef\currentregisterentriesc{\registerparameter{\c!entries:3}}%
+ \else
+ \xdef\currentregisterentriesa{\detokenizedregisterparameter{\c!entries:1}}%
+ \xdef\currentregisterentriesb{\detokenizedregisterparameter{\c!entries:2}}%
+ \xdef\currentregisterentriesc{\detokenizedregisterparameter{\c!entries:3}}%
+ \fi
+ \globallet\currentregistercoding\s!tex
+ \fi
\else
- \ifx\currentregisterexpansion\v!yes
- \xdef\currentregisterentries{\registerparameter\c!entries}%
+ \ifx\currentregisterexpansion\s!xml
+ \xmlstartraw
+ \xdef\currentregisterentries{\registerparameter\c!entries}%
+ \xmlstopraw
+ \globallet\currentregistercoding\s!xml
\else
- \xdef\currentregisterentries{\detokenizedregisterparameter\c!entries}%
+ \ifx\currentregisterexpansion\v!yes
+ \xdef\currentregisterentries{\registerparameter\c!entries}%
+ \else
+ \xdef\currentregisterentries{\detokenizedregisterparameter\c!entries}%
+ \fi
+ \globallet\currentregistercoding\s!tex
+ \fi
+ \fi
+ \ifx\currentregisterkeys\empty
+ \ifx\currentregistercoding\s!xml
+ \xmlstartraw
+ \xdef\currentregisterkeysa{\registerparameter{\c!keys:1}}%
+ \xdef\currentregisterkeysb{\registerparameter{\c!keys:2}}%
+ \xdef\currentregisterkeysc{\registerparameter{\c!keys:3}}%
+ \xmlstopraw
+ \else
+ \xdef\currentregisterkeysa{\registerparameter{\c!keys:1}}%
+ \xdef\currentregisterkeysb{\registerparameter{\c!keys:2}}%
+ \xdef\currentregisterkeysc{\registerparameter{\c!keys:3}}%
\fi
- \globallet\currentregistercoding\s!tex
\fi
\setnextinternalreference
% we could consider storing register entries in a list which we
% could then sort
\xdef\currentregisternumber{\ctxlua{
- jobregisters.store {
+ jobregisters.store { % 'own' should not be in metadata
metadata = {
kind = "entry",
name = "\currentregister",
@@ -179,18 +233,31 @@
\ifx\currentregisterownnumber\v!yes
own = "\registerparameter\c!alternative", % can be used instead of pagenumber
\fi
+ xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text
+\ifx\currentregisterxmlsetup\empty \else
+ xmlsetup = "\currentregisterxmlsetup",
+\fi
},
references = {
internal = \nextinternalreference,
- section = structure.sections.currentid(), % hm, why then not also lastsection the same way
- label = "\currentregisterlabel",
+ section = structure.sections.currentid(), % hm, why then not also lastsection the same way
+ label = "\currentregisterlabel",
},
- \ifx\currentregisterentries\empty \else
+% \ifx\currentregisterentries\empty \else
entries = {
% we need a special one for xml, this is just a single one
- \!!bs\currentregisterentries\!!es, \!!bs\currentregisterkeys\!!es
+ \ifx\currentregisterentries\empty
+ { \!!bs\currentregisterentriesa\!!es, \!!bs\currentregisterentriesb\!!es, \!!bs\currentregisterentriesc\!!es },
+ \else
+ \!!bs\currentregisterentries\!!es,
+ \fi
+ \ifx\currentregisterkeys\empty
+ { \!!bs\currentregisterkeysa\!!es, \!!bs\currentregisterkeysb\!!es, \!!bs\currentregisterkeysc\!!es },
+ \else
+ \!!bs\currentregisterkeys\!!es,
+ \fi
},
- \fi
+% \fi
userdata = structure.helpers.touserdata(\!!bs\detokenize{#3}\!!es)
}
} }%
@@ -201,7 +268,7 @@
\xdef\currentregistersynchronize{\ctxlatelua{jobregisters.enhance("\currentregister",\currentregisternumber)}}%
\fi
\currentregistersynchronize % here?
- \attribute\destinationattribute\lastdestinationattribute \strut % todo
+ \attribute\destinationattribute\lastdestinationattribute \forcecolorhack % no \strut as it will be removed during cleanup
\endgroup}
\def\doregister[#1][#2]%
@@ -211,8 +278,8 @@
\def\donoregister #1#2#3{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!entries={#3}}{}}}
\def\dodoregister#1#2#3#4{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!alternative=#3,\c!entries={#4}}{}}}
-\def\startregister{\doquadrupleempty\dostartregister}
-\def\stopregister {\dodoubleargument\dostopregister}
+\unexpanded\def\startregister{\doquadrupleempty\dostartregister}
+\unexpanded\def\stopregister {\dodoubleargument\dostopregister}
% a synonym, so that we can nest with overlap without syntax check problems
@@ -234,6 +301,8 @@
\def\setregisterentry {\dotripleempty\dosetregisterentry}
\def\finishregisterentry{\dotripleempty\dofinishregisterentry}
+% not yet document, not sure if this will stay:
+
\def\dosetregisterentry [#1][#2][#3]{\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}}
\def\dofinishregisterentry[#1][#2][#3]{\dofinishregisterstructurepageregister{#1}{#2}{#3}}
@@ -287,6 +356,41 @@
\fi
\endgroup}
+% The following variants are meant for (for instance xml). There is some
+% overlap with previously defined macros.
+%
+% \starttext
+% \setstructurepageregister[index][entries=alpha]a
+% \setstructurepageregister[index][entries=gamma]g
+% \setstructurepageregister[index][entries=beta]b
+% \setstructurepageregister[index][entries:1=alpha,keys:1=z]a
+% \setstructurepageregister[index][entries:1=gamma,keys:1=x]g
+% \setstructurepageregister[index][entries:1=beta, keys:1=y]b
+% \index{alpha}a
+% \index{gamma}g
+% \index{beta}b
+% \placeregister[index][n=1]
+% \stoptext
+
+\def\setstructurepageregister{\dotripleempty\dosetstructurepageregister}
+
+\def\dosetstructurepageregister[#1][#2][#3]% [register][settings][userdata]
+ {\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}}
+
+\unexpanded\def\startstructurepageregister{\doquadrupleempty\dostartstructurepageregister}
+\unexpanded\def\stopstructurepageregister {\dodoubleargument\dostopstructurepageregister}
+
+\let\openstructurepageregisterrange \startstructurepageregister
+\let\closestructurepageregisterrange\stopstructurepageregister
+
+\def\dostartstructurepageregister[#1][#2][#3][#4]% [register][tag][settings][userdata]
+ {\doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,#3}{#4}}}
+
+\def\dostopstructurepageregister[#1][#2]%
+ {\normalexpanded{\ctxlatelua{jobregisters.extend("#1","#2")}}}
+
+% So far.
+
\def\doseeregister[#1][#2]#3#4%
{\doflushatpar{\doprocessseeregister{#1}{#2}{#3}{#4}}}
@@ -312,7 +416,7 @@
\fi
\setnextinternalreference
% we could consider storing register entries in list
- \ctxlua{ jobregisters.store {
+ \edef\temp{\ctxlua{ jobregisters.store {
metadata = {
kind = "see",
name = "\currentregister",
@@ -331,7 +435,7 @@
text = "\currentregisterseeword"
},
}
- }%
+ }}%
\endgroup}
%D Rendering:
@@ -342,7 +446,14 @@
{\dodoubleempty\dodetermineregistercharacteristics}
\def\dodetermineregistercharacteristics[#1][#2]%
- {\edef\utilityregisterlength{\ctxlua{jobregisters.analyse('\currentregister')}}%
+ {\begingroup
+ \edef\currentregister{#1}%
+ \setupregister[\currentregister][#2]%
+ \normalexpanded{\endgroup\noexpand\xdef\noexpand\utilityregisterlength{\ctxlua{jobregisters.analyse('\currentregister',{
+ language = "\registerparameter\s!language",
+ compress = "\registerparameter\c!compress",
+ criterium = "\registerparameter\c!criterium",
+ })}}}% brrr
\ifcase\utilityregisterlength\relax
\resetsystemmode\v!register
\else
@@ -355,7 +466,7 @@
\dontcomplain
\to \everyplaceregister
-\def\placeregister
+\unexpanded\def\placeregister
{\dodoubleempty\doplaceregister}
\def\doplaceregister[#1][#2]%
@@ -380,6 +491,7 @@
% prefix = "\registerparameter\c!pageprefix",
separatorset = "\registerparameter\c!pageprefixseparatorset",
conversionset = "\registerparameter\c!pageprefixconversionset",
+ starter = \!!bs\registerparameter\c!pageprefixstarter\!!es,
stopper = \!!bs\registerparameter\c!pageprefixstopper\!!es,
set = "\registerparameter\c!pageprefixset",
segments = "\registerparameter\c!pageprefixsegments",
@@ -389,6 +501,7 @@
prefix = "\registerparameter\c!pageprefix",
separatorset = "\registerparameter\c!pageseparatorset",
conversionset = "\registerparameter\c!pageconversionset",
+ starter = \!!bs\registerparameter\c!pagestarter\!!es,
stopper = \!!bs\registerparameter\c!pagestopper\!!es,
segments = "\registerparameter\c!pagesegments",
}
@@ -417,7 +530,7 @@
\begingroup
\edef\currentregister{#1}%
% the expansion is needed because we don't want \v!'s in the tuo file (french)
- \normalexpanded{\noexpand\systemsuppliedchapter[\currentregister]{\noexpand\headtext{\currentregister}}}%
+ \normalexpanded{\systemsuppliedchapter[\currentregister]{\noexpand\headtext{\currentregister}}}%
\placeregister[\currentregister][#2]%
\page[\v!yes]%
\endgroup
@@ -426,9 +539,9 @@
% test case for collapsing (experimental, for Steffen Wolfrum)
%
% \starttext
-% \placeregister[index][collapse=no] \blank[2*big]
-% \placeregister[index][collapse=yes] \blank[2*big]
-% \placeregister[index][collapse=akk] \page
+% \placeregister[index][compress=no] \blank[2*big]
+% \placeregister[index][compress=yes] \blank[2*big]
+% \placeregister[index][compress=all] \page
% \dorecurse{10}{test 1:!\index{test} test \page}
% \dorecurse{5} {test 2:\recurselevel \page}
% \dorecurse{10}{test 3:!\index{test} test \page}
@@ -459,13 +572,14 @@
\setvalue{\??id:\c!indicator:a}#1%
{\registerparameter\c!before
- \vskip\lineheight\goodbreak\vskip-\lineheight
+ % bugged, why does leftskip gets set: \vskip\lineheight\goodbreak\vskip-\lineheight
\begingroup\dosetregisterattributes\c!style\c!color
\registerparameter\c!command{\strut#1}%
\endgroup
\registerparameter\c!after
\par\nobreak}
+
% b = <goodbreak> <before> <character> <after> <nobreak>
\setvalue{\??id:\c!indicator:b}#1%
@@ -482,49 +596,53 @@
%D The following macros are the interface to the rendering. These are
%D generated by \LUA. This might change.
-\def\startregisteroutput
+%D Beware, we get funny side effects when a dangling \index precedes an
+%D placeindex as then flushing takes place inside the index. Took me hours
+%D to notice that.
+
+\unexpanded\def\startregisteroutput
{\endgraf
\begingroup
\forgetparindent
\forgetparskip}
-\def\stopregisteroutput
+\unexpanded\def\stopregisteroutput
{\endgraf
\endgroup}
-\def\startregisterentries#1% depth
+\unexpanded\def\startregisterentries#1% depth
{\endgraf
\begingroup
\dosetregisterattributes\c!textstyle\c!textcolor
\advance\leftskip\numexpr#1-1\relax\dimexpr\registerparameter\c!distance\relax
\hangindent\registerparameter\c!distance\hangafter\plusone}
-\def\stopregisterentries
+\unexpanded\def\stopregisterentries
{\endgraf
\endgroup}
-\def\startregistersection#1% title
+\unexpanded\def\startregistersection#1% title
{\registercharacter{#1}\endgraf}
-\def\stopregistersection
+\unexpanded\def\stopregistersection
{\endgraf}
\newconditional\registerpagedone
-\def\startregisterpages
+\unexpanded\def\startregisterpages
{\begingroup
\setfalse\registerpagedone
\dosetregisterattributes\c!pagestyle\c!pagecolor}
-\def\stopregisterpages
+\unexpanded\def\stopregisterpages
{\endgroup}
-\def\startregisterseewords
+\unexpanded\def\startregisterseewords
{\begingroup
\setfalse\registerpagedone
\dosetregisterattributes\c!pagestyle\c!pagecolor}
-\def\stopregisterseewords
+\unexpanded\def\stopregisterseewords
{\endgroup}
\def\registerpageseparator% todo: , configurable
@@ -535,14 +653,29 @@
\settrue\registerpagedone
\fi}
+\def\registeronepagerangeseparator{|\endash|}
+
+\def\withregisterpagecommand#1#2#3%
+ {\def\currentregisterpageindex{#1}%
+ \iflocation
+ \goto{\registerparameter\c!pagecommand{#3}}[internal(#1)]%
+ \else
+ \registerparameter\c!pagecommand{#3}%
+ \fi}
+
\def\registeronepage#1#2#3% content
- {\registerpageseparator\registerparameter\c!pagecommand{\goto{#3}[internal(#1)]}}
+ {\registerpageseparator
+ \withregisterpagecommand{#1}{#2}{#3}}
\def\registerpagerange#1#2#3#4#5#6% content, content todo: -- configurable
- {\registerpageseparator\registerparameter\c!pagecommand{\goto{#3}[internal(#1)]}|--|\registerparameter\c!pagecommand{\goto{#6}[internal(#4)]}}
+ {\registerpageseparator
+ \withregisterpagecommand{#1}{#2}{#3}%
+ \registeronepagerangeseparator
+ \withregisterpagecommand{#4}{#5}{#6}}
\def\registeroneword#1#2#3% content
- {\registerpageseparator\registerseeword{#3}}
+ {\registerpageseparator
+ \registerseeword{#3}}
\def\defaultregisterentry #1{\registerparameter\c!textcommand{\limitedregisterentry{\registerparameter\c!deeptextcommand{#1}}}}
\def\defaultregisterseeword#1{\labeltexts\v!see{#1}}
@@ -559,13 +692,41 @@
% todo: \installregisterpagehandler
+% \def\MyRegisterPageCommand#1%
+% {#1\currentregisterpageuserdata{whatever}}
+%
+% \starttext
+% \setregisterentry[index][entries=aaa][whatever=f.] test \index{bbb} test
+% \placeregister[index][n=1,pagecommand=\MyRegisterPageCommand]
+% \stoptext
+
+\def\registerpageuserdata #1#2{\ctxlua{jobregisters.userdata(#1,"#2")}}
+\def\currentregisterpageuserdata {\registerpageuserdata\currentregisterpageindex} % {#1}
+
+% not yet ok : new internal handler names
+
\def\registerpagebuttonsymbol{\vrule\!!width1em\!!height1ex\!!depth\zeropoint\relax}
-\setvalue{\??id:\c!symbol :\c!n}{\def\registerpageseparatorsymbol{, }\let\registerpagenumberhandler\firstofoneargument}
-\setvalue{\??id:\c!symbol :\c!a}{\def\registerpageseparatorsymbol{, }\let\registerpagenumberhandler\firstofoneargument} % now done via conversion
-\setvalue{\??id:\c!symbol:\v!none}{\let\registerpageseparatorsymbol\empty\let\registerpagenumberhandler\gobbleoneargument}
-\setvalue{\??id:\c!symbol :1}{\let\registerpageseparatorsymbol\space\def\registerpagenumberhandler{\symbol[1]\gobbleoneargument}}
-\setvalue{\??id:\c!symbol :2}{\let\registerpageseparatorsymbol\space\def\registerpagenumberhandler{\registerpagebuttonsymbol\gobbleoneargument}}
+\setvalue{\??id:\c!symbol:\c!n}%
+ {\def\registerpageseparatorsymbol{, }}
+
+\setvalue{\??id:\c!symbol:\c!a}%
+ {\def\registerpageseparatorsymbol{, }} % now done via conversion
+
+\setvalue{\??id:\c!symbol:\v!none}%
+ {\let\registerpageseparatorsymbol\empty
+ \let\registeronepage \gobblethreearguments
+ \let\registerpagerange \gobblesixarguments}
+
+\setvalue{\??id:\c!symbol:1}%
+ {\let\registerpageseparatorsymbol\space
+ \def\registeronepage {\symbol[1]\gobblethreearguments}%
+ \def\registerpagerange {\symbol[1]\gobblesixarguments}}
+
+\setvalue{\??id:\c!symbol:2}%
+ {\let\registerpageseparatorsymbol\space
+ \def\registeronepage {\registerpagebuttonsymbol\gobblethreearguments}%
+ \def\registerpagerange {\registerpagebuttonsymbol\gobblesixarguments}}
\def\setregisterpagerendering
{\edef\currentregisterpagesymbol{\registerparameter\c!symbol}%
@@ -575,7 +736,8 @@
\csname\??id:\c!symbol:\currentregisterpagesymbol\endcsname
\else
\let\registerpageseparatorsymbol\space
- \def\registerpagenumberhandle{\registerparameter\c!symbol\gobbleoneargument}%
+ \def\registeronepage {\registerparameter\c!symbol\gobblethreearguments}%
+ \def\registerpagerange {\registerparameter\c!symbol\gobblesixarguments}%
\fi\fi}
\appendtoks
@@ -684,8 +846,8 @@
% \fi}
% {\dosetpageregister{#1}}}
-\def\dosetregister#1%
- {\dosetpageregister{#1}}
+% \def\dosetregister#1%
+% {\dosetpageregister{#1}}
% \newcounter\internallistreference
diff --git a/Master/texmf-dist/tex/context/base/strc-ren.mkiv b/Master/texmf-dist/tex/context/base/strc-ren.mkiv
index 8890ec8e6c7..3a60a34a380 100644
--- a/Master/texmf-dist/tex/context/base/strc-ren.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-ren.mkiv
@@ -27,20 +27,55 @@
\newevery \everyheadstart \relax
-\def\placeheadmargintexts
+\unexpanded\def\placeheadmargintexts
{\the\everyheadstart
\doif{\structureheadparameter\c!margintext}\v!yes\placemargincontent}
-\def\doplaceheadtextcomponent#1#2%
- {\begingroup
- \dosetstructureheadattributes\c!style\c!color
- \dosetstructureheadattributes\c!textstyle\c!textcolor
- \dontconvertfont
- \ifconditional\structureheadisdisplay % \ifdisplaysectionhead
- \setupinterlinespace
+\unexpanded\def\setupheadcomponentfont#1#2%
+ {\ifconditional\structureheadisdisplay
+ \edef\askedstructureheadinterlinespace{\structureheadparameter\c!interlinespace}%
+ \ifx\askedstructureheadinterlinespace\empty
+ % here the interline space is only set when style sets no space
+ \setfalse\fontattributeisset
+ \setfalse\interlinespaceisset
+ \dosetstructureheadattributes\c!style\c!color
+ \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else
+ \setupinterlinespace
+ \fi \fi
+ \setfalse\fontattributeisset \dosetstructureheadattributes#1#2%
+ \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else
+ \setupinterlinespace
+ \fi \fi
\else
+ % here the set interline space overloads any other set space in the style
+ \setfalse\fontattributeisset
+ \dosetstructureheadattributes\c!style\c!color
+ \ifconditional\fontattributeisset
+ \dosetupcheckedinterlinespace\askedstructureheadinterlinespace
+ \fi
+ \setfalse\fontattributeisset
+ \dosetstructureheadattributes#1#2%
+ \ifconditional\fontattributeisset
+ \dosetupcheckedinterlinespace\askedstructureheadinterlinespace
+ \fi
+ \fi
+ \else
+ \setfalse\fontattributeisset
+ \dosetstructureheadattributes\c!style\c!color
+ \ifconditional\fontattributeisset
+ \setupspacing
+ \fi
+ \setfalse\fontattributeisset
+ \dosetstructureheadattributes#1#2%
+ \ifconditional\fontattributeisset
\setupspacing
\fi
+ \fi
+ \dontconvertfont}
+
+\def\doplaceheadtextcomponent#1#2%
+ {\begingroup
+ \setupheadcomponentfont\c!textstyle\c!textcolor
% \ifcase\headtimingmode#1\fi % can introduce cr
\structureheadparameter\c!commandbefore
\placeheadmargintexts
@@ -68,8 +103,7 @@
\def\doplaceheadnumbercomponent#1#2%
{\begingroup
- \dosetstructureheadattributes\c!style\c!color
- \dosetstructureheadattributes\c!numberstyle\c!numbercolor
+ \setupheadcomponentfont\c!numberstyle\c!numbercolor
% \getvalue{\??ko\currentstructurehead\c!commandbefore}% strange, why here? moved 21/11/2005
\placeheadmargintexts
\ifconditional\structureheadisdisplay % \ifdisplaysectionhead
@@ -93,7 +127,6 @@
\def\doplacestructureheadtext#1#2#3% nodes, text, endstuff
{\beginheadplacement
-% \postponenotes
\doresettructureheadnumbercontent
\ifconditional\structureheadleaveempty
\setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute to \zeropoint {#1}%
@@ -109,7 +142,6 @@
\def\doplacestructureheadnumbertext#1#2#3#4% nodes number text nodes
{\beginheadplacement
-% \postponenotes
\doiftextelse{#2}\dosettructureheadnumbercontent\doresettructureheadnumbercontent
\ifconditional\structureheadleaveempty
\setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute to \zeropoint{#1}%
@@ -122,13 +154,13 @@
\fi
\endheadplacement{#4}}
-\def\placestructureheadnumbertext
+\unexpanded\def\placestructureheadnumbertext
{\doplacestructureheadnumbertext\empty\getstructureheadnumber\getstructureheadtitle\getstructureheadsyncs}
-\def\placestructureheadtext
+\unexpanded\def\placestructureheadtext
{\doplacestructureheadtext\empty\getstructureheadtitle\getstructureheadsyncs}
-\def\placestructureheadnothing
+\unexpanded\def\placestructureheadempty
{\hbox \structureheadattribute {\getstructureheadsyncs}}
%D \starttyping
@@ -159,7 +191,6 @@
\def\beginheadplacement
{\bgroup
\setsystemmode\currentstructurehead
- \ifgridsnapping\iftracegridsnapping\showstruts\fi\fi
\xdef\localheadheight {\the\strutht}%
\xdef\localheaddepth {\the\strutdp}%
\xdef\localheadlineheight{\the\lineheight}%
@@ -241,10 +272,25 @@
\v!unknown=>\hangheadplacement\noflines\numexpr0\commalistelement-1\relax]%
% so far
\let\headlastlinewidth\!!zeropoint
- \snaptogrid[\structureheadparameter\c!grid]\hbox
- {\hskip\localheadskip
- \hskip\structureheadparameter\c!margin\relax
- \box\sectionheadbox}%
+ % kind of special, we want to snap heads also according to local specs local
+ \ifgridsnapping
+ \begingroup
+ \edef\currentstructureheadgridsnapping{\structureheadparameter\c!grid}%
+ \ifconditional\structureheadisdisplay
+ \ifx\currentstructureheadgridsnapping\empty\else
+ \dosetstructureheadattributes\c!style\c!color
+ \setupinterlinespace
+ \dosetstructureheadattributes\c!textstyle\c!textcolor
+ \setupinterlinespace
+ \fi
+ \fi
+ \snaptogrid[\currentstructureheadgridsnapping]\hbox
+ {\hskip\localheadskip\hskip\structureheadparameter\c!margin\box\sectionheadbox}%
+ \endgroup
+ \else
+ \hbox
+ {\hskip\localheadskip\hskip\structureheadparameter\c!margin\box\sectionheadbox}%
+ \fi
\flushnotes % new, not really needed
\endgraf
\ifvmode
@@ -297,13 +343,16 @@
\let\numberheadalternative\v!normal
-\def\defineheadplacement
+\unexpanded\def\defineheadplacement
{\dodoubleargument\dodefineheadplacement}
\def\dodefineheadplacement[#1][#2]% #3#4
{\setvalue{\??ns:#1}{#2}%
\setvalue{\??ns::#1}}
+\def\presetnumberheadalternative
+ {\doifelsevalue{\??ns:\numberheadalternative}\v!horizontal\setfalse\settrue\structureheadisdisplay}
+
% \def\normalplacehead
% {\executeifdefined
% {\??ns::\numberheadalternative}
@@ -390,7 +439,7 @@
\fi
#2}}
-\def\placeheadmargin#1#2%
+\unexpanded\def\placeheadmargin#1#2%
{\vbox
{\localheadsetup
\begstrut % use one \strut here!
@@ -425,7 +474,7 @@
{\begstrut#2}%
\egroup}
-\def\placeheadlohi#1#2#3%
+\unexpanded\def\placeheadlohi#1#2#3%
{\ifconditional\structureheadshownumber % \ifheadnumbercontent
\setbox0\hbox{#2}
\setbox2=#1{\localheadsetup\advance\hsize-\wd0\relax#3}%
diff --git a/Master/texmf-dist/tex/context/base/strc-sbe.mkiv b/Master/texmf-dist/tex/context/base/strc-sbe.mkiv
index 7db3cedb0dd..206ac8a9c4f 100644
--- a/Master/texmf-dist/tex/context/base/strc-sbe.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-sbe.mkiv
@@ -31,8 +31,8 @@
\def\v!structureblockenvironment{structureblockenvironment}
-\def\definestructureblock{\dotripleargument\dodefinestructureblock}
-\def\setupstructureblock {\dodoubleargument\dosetupstructureblock}
+\unexpanded\def\definestructureblock{\dotripleargument\dodefinestructureblock}
+\unexpanded\def\setupstructureblock {\dodoubleargument\dosetupstructureblock}
\def\setstructureblock {\dosingleargument\dosetstructureblock}
% \def\structureblockparameter#1{\executeifdefined{\??nb\currentstructureblock#1}\empty}
@@ -77,15 +77,16 @@
\let\currentstructureblock\s!unknown
-\def\startstructureblock[#1]%
- {\begingroup
+\unexpanded\def\startstructureblock[#1]%
+ {%\ctxlua{structure.counters.check(0)}% we assume sane usage of \page, as this is the only workable place (in push)
+ \begingroup
\edef\currentstructureblock{\ctxlua{structure.sections.pushblock("#1")}}%
\csname #1true\endcsname % for old times sake
\setsystemmode\currentstructureblock
\the\everybeforestructureblock\relax
\showmessage\m!structures1\currentstructureblock}
-\def\stopstructureblock
+\unexpanded\def\stopstructureblock
{\showmessage\m!structures2\currentstructureblock
\the\everyafterstructureblock\relax
\edef\currentstructureblock{\ctxlua{structure.sections.popblock()}}%
diff --git a/Master/texmf-dist/tex/context/base/strc-sec.mkiv b/Master/texmf-dist/tex/context/base/strc-sec.mkiv
index ddc601eb831..35927d98a00 100644
--- a/Master/texmf-dist/tex/context/base/strc-sec.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-sec.mkiv
@@ -41,12 +41,14 @@
% lua interface / names and interface might change
-\def\setstructurelevel #1#2{\ctxlua{structure.sections.setlevel("#1","#2")}} % name, level|parent
-\def\getstructurelevel #1{\ctxlua{structure.sections.getcurrentlevel("#1")}}% name
-\def\setstructurenumber #1#2{\ctxlua{structure.sections.setnumber(#1,"#2")}} % level, number (+/-)
-\def\getstructurenumber #1{\ctxlua{structure.sections.getnumber(#1)}} % level
-\def\getfullstructurenumber #1{\ctxlua{structure.sections.fullnumber(#1)}} % level
-\def\getspecificstructuretitle#1{\ctxlua{structure.sections.structuredata(#1,"titledata.title",nil,"\structureheadparameter\s!catcodes")}}%
+\def\setstructurelevel #1#2{\ctxlua{structure.sections.setlevel("#1","#2")}} % name, level|parent
+\def\getstructurelevel #1{\ctxlua{structure.sections.getcurrentlevel("#1")}}% name
+\def\setstructurenumber #1#2{\ctxlua{structure.sections.setnumber(#1,"#2")}} % level, number (+/-)
+\def\getstructurenumber #1{\ctxlua{structure.sections.getnumber(#1)}} % level
+\def\getsomestructurenumber #1#2{\ctxlua{structure.sections.getnumber(#1,"#2")}} % level, what
+\def\getfullstructurenumber #1{\ctxlua{structure.sections.fullnumber(#1)}} % level
+\def\getsomefullstructurenumber#1#2{\ctxlua{structure.sections.fullnumber(#1,"#2")}}
+\def\getspecificstructuretitle #1{\ctxlua{structure.sections.structuredata(#1,"titledata.title",nil,"\structureheadparameter\s!catcodes")}}%
% interface
@@ -59,6 +61,8 @@
\def\dostructureheadparentparameter #1#2{\ifx#1\relax\s!empty\else\dostructureheadparameter #1#2\fi}
\def\dostructureheadparentparameterhash#1#2{\ifx#1\relax \else\dostructureheadparameterhash#1#2\fi}
+\def\structureheadparameterstrict#1{\csname\ifcsname\??nh\currentstructurehead#1\endcsname\??nh\currentstructurehead#1\else\s!empty\fi\endcsname}
+
\def\dosetstructureheadattributes#1#2% style color
{\edef\fontattributehash {\structureheadparameterhash#1}%
\edef\colorattributehash{\structureheadparameterhash#2}%
@@ -71,22 +75,30 @@
\let\laststructuresectionname\empty
-\def\definestructuresection[#1]%
+\unexpanded\def\definestructuresection[#1]%
{\doifundefined{\??nh#1}
{\global\advance\maxstructuredepth\plusone
\setevalue{\??nh#1\c!level}{\the\maxstructuredepth}%
\setstructurelevel{#1}{\the\maxstructuredepth}%
-% \letvalue{\??nh#1\c!marking}\empty % ?
+% \letvalue{\??nh#1\c!marking}\empty % ?
%\writestatus{structure}{#1\ifx\laststructuresectionname\empty\else\space->\space\laststructuresectionname\fi}%
\normalexpanded{\noexpand\getparameters[\??nh#1][\s!parent=\??nh\laststructuresectionname]}%
+ % this is a rather practical default that we don't want to be part of the parent chain
+ % lookup mechanism; it's also mkii compativle; this might become \everystructureheaddefine
+ \getparameters[\??nh#1]
+ [ \c!textstyle=\structureheadparameterstrict\c!style,
+ \c!textcolor=\structureheadparameterstrict\c!color,
+ \c!numberstyle=\structureheadparameterstrict\c!style,
+ \c!numbercolor=\structureheadparameterstrict\c!color]%
+ % so far for these default inheritances
\definemarking[#1]%
\ifnum\maxstructuredepth>\plusone
-% \normalexpanded{\noexpand\couplemarking[#1][\laststructuresectionname]}% so, the child inherits settings from the parent
+% \normalexpanded{\noexpand\couplemarking[#1][\laststructuresectionname]}% so, the child inherits settings from the parent
\normalexpanded{\noexpand\relatemarking[#1][\laststructuresectionname]}% so, the parent will reset the child
\fi
\xdef\laststructuresectionname{#1}}}
-\def\setupstructuresection
+\unexpanded\def\setupstructuresection
{\dotripleempty\dosetupstructuresection}
\def\dosetupstructuresection[#1]%
@@ -102,16 +114,18 @@
\fi}
\def\structuresectionlevel#1%
- {\executeifdefined{\??nh#1\c!level}0}
+ {\executeifdefined{\??nh#1\c!level}{-1}}
+
+\setvalue{\??nh block\c!level}{0} % -1 == manual
% head -> structurehead
\let\currentstructurehead\empty
\newtoks\everystructureheadsetup
-\def\setupstructureheads{\dosingleargument\dosetupstructureheads}
-\def\setupstructurehead {\dodoubleempty\dosetupstructurehead}
-\def\definestructurehead{\dodoubleempty\dodefinestructurehead}
+\unexpanded\def\setupstructureheads{\dosingleargument\dosetupstructureheads}
+\unexpanded\def\setupstructurehead {\dodoubleempty\dosetupstructurehead}
+\unexpanded\def\definestructurehead{\dodoubleempty\dodefinestructurehead}
\newif\ifsectionnumber % maybe conditional
@@ -254,6 +268,7 @@
\newconditional\structureheaddoincrement
\newconditional\structureheaddoplace
\newconditional\structureheadleaveempty
+\newconditional\structureheadhidden
\newconditional\structureheadshownumber
\newconditional\structureheadisdisplay
@@ -302,11 +317,13 @@
\def\setstructureheadplacement
{\settrue\structureheaddoplace
\setfalse\structureheadleaveempty
+ \setfalse\structureheadhidden
\processaction
[\structureheadparameter\c!placehead]
[ \v!yes=>,
\v!empty=>\settrue\structureheadleaveempty,
- \v!no=>\settrue\structureheadleaveempty\setfalse\structureheaddoplace]}
+ \v!no=>\settrue\structureheadleaveempty\setfalse\structureheaddoplace,
+ \v!hidden=>\settrue\structureheadhidden\settrue\structureheadleaveempty\setfalse\structureheaddoplace]}
\def\setstructureheaddisplay
{\doifelsevalue{\??nh:\structureheadparameter\c!alternative}\v!horizontal
@@ -332,16 +349,17 @@
\setfalse\structureheadshownumber
\fi}
-\def\thestructureheadsynchonization
+\unexpanded\def\thestructureheadsynchonization
{\pagetype[\currentstructureheadcoupling]% hm also number
\normalexpanded{\noexpand\setmarking[\currentstructureheadcoupling]{\currentstructurelistnumber}}%
\currentstructuresynchronize}
-\def\fullstructureheadnumber{\labeltexts{\structureheadparameter\c!label}{\structurenumber}} % todo
-\def\fullstructureheadtitle {\structurevariable{titledata.title}} % no catcode!
+\unexpanded\def\fullstructureheadnumber{\labeltexts{\structureheadparameter\c!label}{\structurenumber}} % todo
+
+% \def\fullstructureheadtitle {\structurevariable{titledata.title}} % no catcode!
+% \unexpanded\def\fullstructureheadtitle{\structureautocatcodedget{titledata.title}{\structureheadparameter\s!catcodes}}
-\unexpanded\def\fullstructureheadtitle
- {\structureautocatcodedget{titledata.title}{\structureheadparameter\s!catcodes}}
+\unexpanded\def\fullstructureheadtitle{\ctxlua{structure.sections.title()}}
\let\currentstructurehead \empty
\let\currentstructureheadcoupling\empty
@@ -356,15 +374,18 @@
\c!saveinlist=\ifconditional\structureheadtolist\v!yes\else\v!no\fi,
\c!level=\currentstructureheadlevel,
\c!name=#1,
- \c!number=\ifconditional\structureheadshownumber\v!yes\else\v!no\fi,
+ \c!number=\ifconditional\structureheaddoincrement\ifconditional\structureheadshownumber\v!yes\else\v!no\fi\else\v!no\fi,
\c!bookmark=,
\c!marking=,
\c!list=,
\c!expansion=\structureheadparameter\c!expansion,
+ \c!xmlsetup=\structureheadparameter\c!xmlsetup,
+ \s!catcodes=\structureheadparameter\s!catcodes,
\c!sectionresetset=\structureheadparameter\c!sectionresetset,
\c!sectionseparatorset=\structureheadparameter\c!sectionseparatorset,
\c!sectionconversionset=\structureheadparameter\c!sectionconversionset,
\c!sectionconversion=\structureheadparameter\c!conversion, % just for compatibility
+ \c!sectionstarter=\structureheadparameter\c!sectionstarter,
\c!sectionstopper=\structureheadparameter\c!sectionstopper,
\c!sectionset=\structureheadparameter\c!sectionset,
\c!sectionsegments=\structureheadparameter\c!sectionsegments,
@@ -378,14 +399,21 @@
\unexpanded\def\placeheadtext {\dosingleempty\doplaceheadtext } % use with care
\unexpanded\def\placeheadnumber{\dosingleempty\doplaceheadnumber} % use with care
+\ifdefined\setupheadcomponentfont \else
+
+ \unexpanded\def\setupheadcomponentfont#1#2%
+ {\dosetstructureheadattributes\c!style\c!color
+ \dosetstructureheadattributes#1#2%
+ \dontconvertfont
+ \setupinterlinespace}
+
+\fi
+
\def\doplaceheadtext[#1]%
{\dontleavehmode
\begingroup
\edef\currentstructurehead{#1}%
- \dosetstructureheadattributes\c!style\c!color
- \dosetstructureheadattributes\c!textstyle\c!textcolor
- \dontconvertfont
- \setupinterlinespace
+ \setupheadcomponentfont\c!textstyle\c!textcolor
\relax
\getspecificstructuretitle{\thenamedstructureheadlevel{#1}}%
\endgraf
@@ -395,15 +423,14 @@
{\dontleavehmode
\begingroup
\edef\currentstructurehead{#1}%
- \dosetstructureheadattributes\c!style\c!color
- \dosetstructureheadattributes\c!numberstyle\c!numbercolor
- \dontconvertfont
- \setupinterlinespace
+ \setupheadcomponentfont\c!numberstyle\c!numbercolor
\relax
\getfullstructurenumber{\thenamedstructureheadlevel{#1}}%
\endgraf
\endgroup}
+\ifdefined \else \let\presetnumberheadalternative\relax \fi
+
\def\dohandlestructurehead#1#2#3% name data userdata
{\xdef\currentstructurehead {#1}%
\xdef\currentstructureheadcoupling{\structuresectionheadcoupling\currentstructurehead}%
@@ -432,6 +459,7 @@
%
\edef\numberheaddistance {\structureheadparameter\c!distance }% compatibility
\edef\numberheadalternative{\structureheadparameter\c!alternative}% compatibility
+ \presetnumberheadalternative
%
\let\getstructureheadnumber\empty
\let\getstructureheadtitle \empty
@@ -449,13 +477,17 @@
\placestructureheadtext
\fi
\dostructureheadspacingafteryes
+ \else\ifconditional\structureheadhidden
+ \doregisterstructurehead{#1}{#2}{#3}% after optional \page
+ \let\getstructureheadsyncs\thestructureheadsynchonization
+ \placestructureheadhidden % only something when tracing
\else
\dostructureheadspacingbeforenop % toegevoegd ivm subpaginanr / tug sheets
\doregisterstructurehead{#1}{#2}{#3}% after optional \page
\let\getstructureheadsyncs\thestructureheadsynchonization
- \placestructureheadnothing % just flush 'm
+ \placestructureheadempty % just flush 'm
\dostructureheadspacingafternop
- \fi
+ \fi\fi
\else
\ifconditional\structureheaddoplace
\dostructureheadspacingbeforeyes
@@ -464,14 +496,18 @@
\let\getstructureheadtitle\fullstructureheadtitle
\placestructureheadtext
\dostructureheadspacingafteryes
+ \else\ifconditional\structureheadhidden
+ \doregisterstructurehead{#1}{#2}{#3}% after optional \page
+ \let\getstructureheadsyncs\thestructureheadsynchonization
+ \placestructureheadhidden % only something when tracing
\else
% do nothing / should be vbox to 0pt
\dostructureheadspacingbeforenop
\doregisterstructurehead{#1}{#2}{#3}% after optional \page
\let\getstructureheadsyncs\thestructureheadsynchonization
- \placestructureheadnothing % just flush 'm
+ \placestructureheadempty % just flush 'm
\dostructureheadspacingafternop
- \fi
+ \fi\fi
\fi
\flushingcolumnfloatstrue
\setfalse\ignorehandlepagebreak
@@ -484,28 +520,54 @@
% typesetting
-\def\placestructureheadnumbertext % dummy, will be overloaded
+\unexpanded\def\placestructureheadnumbertext % dummy, will be overloaded
{\getstructureheadnumber/\getstructureheadtitle
\getstructureheadsyncs}
-\def\placestructureheadtext % dummy, will be overloaded
+\unexpanded\def\placestructureheadtext % dummy, will be overloaded
{\getstructureheadtitle
\getstructureheadsyncs}
-\def\placestructureheadnothing % dummy, will be overloaded
+\unexpanded\def\placestructureheadempty % dummy, will be overloaded
{\getstructureheadsyncs}
+\unexpanded\def\placestructureheadhidden
+ {\setxvalue{\currentstructurehead:sync}%
+ {\noexpand\pagetype[\currentstructureheadcoupling]% hm also number
+ \noexpand\setmarking[\currentstructureheadcoupling]{\currentstructurelistnumber}%
+ \currentstructuresynchronize}}
+
+\def\synchronizestructurehead#1%
+ {\getvalue{#1:sync}}
+
+\unexpanded\def\placerawheaddata [#1]{\synchronizestructurehead {#1}}
+\unexpanded\def\placerawheadtext [#1]{\getspecificstructuretitle{\thenamedstructureheadlevel{#1}}}
+\unexpanded\def\placerawheadnumber[#1]{\getfullstructurenumber {\thenamedstructureheadlevel{#1}}}
+
+% \setuphead[chapter][placehead=hidden]
+% \chapter {test}
+%
+% %(\synchronizestructurehead{chapter}) % \getstructureheadsyncs
+% %(\getfullstructurenumber{\thenamedstructureheadlevel{chapter}})
+% %(\getspecificstructuretitle{\thenamedstructureheadlevel{chapter}})
+%
+% (\placerawheaddata [chapter])
+% (\placerawheadnumber[chapter])
+% (\placerawheadtext [chapter])
+
% pagebreaks
\newcount\precedingstructurelevel \precedingstructurelevel\plusone
\newconditional\ignorehandlepagebreak
\def\dostructureheadspacingbeforeyes
- {\docheckstructureheadbefore\dohandlestructureheadpagebreak
+ {\docheckstructureheadbefore
+ \dohandlestructureheadpagebreak
\structureheadparameter\c!inbetween}
\def\dostructureheadspacingbeforenop
- {\docheckstructureheadbefore\docheckstructureheadlayout
+ {\docheckstructureheadbefore
+ \docheckstructureheadlayout
\structureheadparameter\c!inbetween}
% \def\emptystructureheadcorrection
@@ -579,7 +641,7 @@
\setfalse\ignorehandlepagebreak
\else
\ifnum\lastpenalty>\zerocount
- \global\pagebreakdisabledtrue
+% \global\pagebreakdisabledtrue
\fi
% beware, these numbers are not yet know here
\doifelse{\structureheadparameter\c!continue}\v!yes
@@ -592,53 +654,70 @@
\doifnot{\structureheadparameter\c!aligntitle}\v!float\flushsidefloats
\structureheadparameter\c!before
\relax
- \ifpagebreakdisabled
- \global\pagebreakdisabledfalse
- \else
+% \ifpagebreakdisabled
+% \global\pagebreakdisabledfalse
+% \else
\dopreventbreakafterstructureheadauto
- \fi
+% \fi
\doif{\structureheadparameter\c!aligntitle}\v!float\indent
\global\precedingstructurelevel\currentstructureheadlevel
\fi}
% the next one was: \somebreakmethod
-\chardef\somestructureheadbreakmethod\plusone % 0=nothing, 1=weighted, 2=strict, 3=vspacing
+% \chardef\somestructureheadbreakmethod\plusone % 0=nothing, 1=weighted, 2=strict, 3=vspacing
+\chardef\somestructureheadbreakmethod\plusthree
+
+% \def\dopreventbreakafterstructureheadauto % used after \c!before
+% {\ifcase\somestructureheadbreakmethod
+% % 0 = nothing
+% \or
+% % 1 = old weighted version
+% \ifnum\currentstructureheadlevel>\precedingstructurelevel
+% \dosomebreak{\penalty\numexpr20000+500*\currentstructureheadlevel\relax}%
+% \else
+% \dosomebreak\allowbreak % brr
+% \fi
+% \or
+% % 2 = strict version
+% \dosomebreak{\penalty\maxdimen}%
+% \or
+% % 3 = vspacing
+% \vspacing[\v!samepage]% if preceded by ! then a loop
+% \else
+% % nothing
+% \fi}
+%
+% \def\dopreventbreakafterstructureheadspec#1% see enumerations etc
+% {\ifcase\somestructureheadbreakmethod
+% % 0 = nothing
+% \or
+% % 1 = old weighted version
+% \dosomebreak{\penalty\numexpr20000+500*(\currentstructureheadlevel+#1)\relax}%
+% \or
+% % 2 = strict version
+% \dosomebreak{\penalty\maxdimen}%
+% \or
+% % 3 = vspacing
+% \vspacing[\v!samepage]%
+% \else
+% % nothing
+% \fi}
+%
+% todo: \vspacing[category:8] == keep_together
\def\dopreventbreakafterstructureheadauto % used after \c!before
{\ifcase\somestructureheadbreakmethod
% 0 = nothing
- \or
- % 1 = old weighted version
- \ifnum\currentstructureheadlevel>\precedingstructurelevel
- \dosomebreak{\penalty\numexpr20000+500*\currentstructureheadlevel\relax}%
- \else
- \dosomebreak\allowbreak % brr
- \fi
- \or
- % 2 = strict version
- \dosomebreak{\penalty\maxdimen}%
- \or
- % 3 = vspacing
- \vspacing[\v!samepage]% if preceded by ! then a loop
\else
- % nothing
+ \vspacing[\v!samepage-\currentstructureheadlevel]%
\fi}
\def\dopreventbreakafterstructureheadspec#1% see enumerations etc
{\ifcase\somestructureheadbreakmethod
% 0 = nothing
- \or
- % 1 = old weighted version
- \dosomebreak{\penalty\numexpr20000+500*(\currentstructureheadlevel+#1)\relax}%
- \or
- % 2 = strict version
- \dosomebreak{\penalty\maxdimen}%
- \or
- % 3 = vspacing
- \vspacing[\v!samepage]%
\else
- % nothing
+ \vspacing[\v!samepage-\the\numexpr\currentstructureheadlevel+1\relax]% todo #1
\fi}
\def\dohandlepagebreakX{\dopreventbreakafterstructureheadspec} % no \let so we can redefind
@@ -649,13 +728,13 @@
% \chapter{some} \setupheadnumber[chapter][3] \chapter{more}
% \setupheadnumber[section][8] \section{b} \section{c} \setupheadnumber[section][-1] \section{d}
-\def\thecurrentstructureheadlevel#1%
- {\getcurrentstructurelevel{#1}}
+% \def\thecurrentstructureheadlevel#1%
+% {\getcurrentstructurelevel{#1}}
\def\thenamedstructureheadlevel#1%
{\structuresectionlevel{\structuresectionheadsection{\structuresectionheadcoupling{#1}}}}
-\def\setupheadnumber
+\unexpanded\def\setupheadnumber
{\dodoubleargument\dosetupheadnumber}
\def\dosetupheadnumber[#1][#2]% todo: reset if at other level
@@ -663,18 +742,29 @@
\def\currentstructureheadnumber{0} % ==> \currentheadnumber
-\def\determineheadnumber[#1]%
+\unexpanded\def\determineheadnumber[#1]%
{\xdef\currentstructureheadnumber{\getstructurenumber{\thenamedstructureheadlevel{#1}}}}
% The previous macro is been replaced by the expandable:
-\def\namedheadnumber#1{\getstructurenumber{\thenamedstructureheadlevel{#1}}}
+\def\namedheadnumber #1{\getstructurenumber {\thenamedstructureheadlevel{#1}}}
+\def\somenamedheadnumber#1#2{\getsomestructurenumber{\thenamedstructureheadlevel{#1}}{#2}}
+
+\unexpanded\def\structureheadnumber
+ {\dodoubleempty\dostructureheadnumber}
+
+\def\dostructureheadnumber[#1][#2]% simple case is just a number
+ {\getsomefullstructurenumber{\iffirstargument\thenamedstructureheadlevel{#1}\fi}{#2}}
-\def\structureheadnumber
- {\dosingleempty\dostructureheadnumber}
+\def\somestructureheadnumber
+ {\dodoubleempty\dosomestructureheadnumber}
-\def\dostructureheadnumber[#1]% simple case is just a number
- {\getfullstructurenumber{\iffirstargument\thecurrentstructureheadlevel{#1}\fi}}
+\def\dosomestructureheadnumber[#1][#2]%
+ {\dontleavehmode
+ \begingroup
+ \edef\currentstructurehead{#1}%
+ \getsomefullstructurenumber{\thenamedstructureheadlevel{#1}}{#2}%
+ \endgroup}
% compatibility code (after all, we might offer different structure handlers as well
% but we might as well remove the 'structure' substring at some point (we needed it
diff --git a/Master/texmf-dist/tex/context/base/strc-syn.lua b/Master/texmf-dist/tex/context/base/strc-syn.lua
index d9b7b9a572e..d6f38c2c7f6 100644
--- a/Master/texmf-dist/tex/context/base/strc-syn.lua
+++ b/Master/texmf-dist/tex/context/base/strc-syn.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['str-syn'] = {
version = 1.001,
- comment = "companion to str-syn.tex",
+ comment = "companion to str-syn.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -24,7 +24,9 @@ local function initializer()
end
local function finalizer()
- tobesaved.hash = nil
+ for entry, data in next, tobesaved do
+ data.hash = nil
+ end
end
job.register('joblists.collected', joblists.tobesaved, initializer, finalizer)
@@ -56,8 +58,18 @@ end
function joblists.register(class,kind,spec)
local data = allocate(class)
data.metadata.kind = kind -- runtime, not saved in format (yet)
- data.entries[#data.entries+1] = spec
- data.hash[spec.definition.tag or ""] = spec
+ if not data.hash[spec.definition.tag or ""] then
+ data.entries[#data.entries+1] = spec
+ data.hash[spec.definition.tag or ""] = spec
+ end
+end
+
+function joblists.registerused(class,tag)
+ local data = allocate(class)
+ local dht = data.hash[tag]
+ if dht then
+ dht.definition.used = true
+ end
end
function joblists.synonym(class,tag)
@@ -80,9 +92,7 @@ function joblists.meaning(class,tag)
end
end
-function joblists.compare(a,b)
- return sorters.comparers.basic(a.split,b.split)
-end
+joblists.compare = sorters.comparers.basic -- (a,b)
function joblists.filter(data,options)
local result = { }
@@ -124,7 +134,7 @@ function joblists.finalize(data,options)
local split = { }
for k=1,#result do
local v = result[k]
- local entry, tag = sorters.firstofsplit(v.split)
+ local entry, tag = sorters.firstofsplit(v)
local s = split[entry] -- keeps track of change
if not s then
s = { tag = tag, data = { } }
@@ -137,19 +147,21 @@ end
function joblists.flush(data,options) -- maybe pass the settings differently
local kind = data.metadata.kind -- hack, will be done better
- texsprint(ctxcatcodes,format("\\start%soutput",kind))
+--~ texsprint(ctxcatcodes,format("\\start%soutput",kind))
local result = data.result
- for k, letter in ipairs(table.sortedkeys(result)) do
+ local sorted = table.sortedkeys(result)
+ for k=1,#sorted do
+ local letter = sorted[k]
local sublist = result[letter]
local data = sublist.data
- texsprint(ctxcatcodes,format("\\start%ssection{%s}",kind,sublist.tag))
+--~ texsprint(ctxcatcodes,format("\\start%ssection{%s}",kind,sublist.tag))
for d=1,#data do
local entry = data[d].definition
- texsprint(ctxcatcodes,format("\\%sentry{%s}{%s}{%s}",kind,d,entry.synonym,entry.meaning))
+ texsprint(ctxcatcodes,format("\\%sentry{%s}{%s}{%s}{%s}",kind,d,entry.tag,entry.synonym,entry.meaning or ""))
end
- texsprint(ctxcatcodes,format("\\stop%ssection",kind))
+--~ texsprint(ctxcatcodes,format("\\stop%ssection",kind))
end
- texsprint(ctxcatcodes,format("\\stop%soutput",kind))
+--~ texsprint(ctxcatcodes,format("\\stop%soutput",kind))
-- for now, maybe at some point we will do a multipass or so
data.result = nil
data.metadata.sorted = false
@@ -158,6 +170,8 @@ end
function joblists.analysed(class,options)
local data = joblists.collected[class]
if data and data.entries then
+ options = options or { }
+ sorters.setlanguage(options.language)
joblists.filter(data,options) -- filters entries to result
joblists.prepare(data,options) -- adds split table parallel to list table
joblists.sort(data,options) -- sorts entries in result
diff --git a/Master/texmf-dist/tex/context/base/strc-syn.mkiv b/Master/texmf-dist/tex/context/base/strc-syn.mkiv
index 9865305c75e..65f5174372a 100644
--- a/Master/texmf-dist/tex/context/base/strc-syn.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-syn.mkiv
@@ -15,6 +15,9 @@
\registerctxluafile{strc-syn}{1.001}
+% todo: add 'define only' option to descriptions, then add sorting (also based on key)
+% and call to definition -> replaces this module
+
\unprotect
% general help, can be shared
@@ -64,7 +67,7 @@
\newtoks\everysetupsynonyms
-\def\setupsynonyms
+\unexpanded\def\setupsynonyms
{\dodoubleargument\dosetupsynonyms}
\def\dosetupsynonyms[#1][#2]%
@@ -95,7 +98,7 @@
%\c!expansion=,
\s!language=\currentmainlanguage]
-\def\definesynonyms
+\unexpanded\def\definesynonyms
{\doquadrupleempty\dodefinesynonyms}
\def\dodefinesynonyms[#1][#2][#3][#4]% name plural \meaning \use
@@ -104,21 +107,21 @@
\ifthirdargument
\unexpanded\def#3##1{\doinsertsynonymmeaning{#1}{##1}}% \meaning
\fi
- \unexpanded\setvalue{#1}{\definesynonym[\v!no][#1]}% \name
+ \setuvalue{#1}{\definesynonym[\v!no][#1]}% \name
\else
\ifthirdargument
\unexpanded\def#3##1{\doinsertsynonymmeaning{#1}{##1}}% \meaning
\fi
- \unexpanded\setvalue{#1}{\definesynonym[\v!yes][#1]}% \name
+ \setuvalue{#1}{\definesynonym[\v!yes][#1]}% \name
\fi
- \getparameters[\??sm#1][\s!parent=\??sm]%
+ \getparameters[\??sm#1][\s!parent=\??sm,\s!multi={#2}]%
\presetheadtext[#2=\Word{#2}]% changes the \if...argument
%\ctxlua{joblists.define('#1')}%
\setvalue{\e!setup #2\e!endsetup}{\dodoubleargument\getparameters[\??sm#1]}% to be obsolete
- \setvalue{\e!place \e!listof#2}{\doplacelistofsynonyms{#1}{#2}}%
- \setvalue{\e!complete\e!listof#2}{\docompletelistofsynonyms{#1}{#2}}}
+ \setvalue{\e!place \e!listof#2}{\placelistofsynonyms[#1]}% accepts extra argument
+ \setvalue{\e!complete\e!listof#2}{\completelistofsynonyms[#1]}}
-\def\definesynonym
+\unexpanded\def\definesynonym
{\dotripleempty\dodefinesynonym}
\def\dodefinesynonym[#1][#2][#3]#4#5%
@@ -147,10 +150,16 @@
used = false,
}
})}%
- \doif{#1}\v!yes{\unexpanded\setxvalue\currentsynonymtag{\noexpand\doinsertsynonym{\currentsynonym}{\currentsynonymtag}}}%
+ \doif{#1}\v!yes{\setuxvalue\currentsynonymtag{\noexpand\doinsertsynonym{\currentsynonym}{\currentsynonymtag}}}%
\fi
\endgroup}
+\def\registersynonym
+ {\dodoubleargument\doregistersynonym}
+
+\def\registersynonym[#1][#2]%
+ {\ctxlua{joblists.registerused("#1","#2")}}
+
\unexpanded\def\doinsertsynonymmeaning#1#2% name tag
{\begingroup
\def\currentsynonym{#1}%
@@ -163,9 +172,12 @@
\def\currentsynonym{#1}%
\dosetsynonymattributes\c!synonymstyle\c!synonymcolor
\synonymparameter\c!synonymcommand{\ctxlua{joblists.synonym("#1","#2")}}%
- \endgroup}
+ \normalexpanded{\endgroup\synonymparameter\c!next}}
+
+\unexpanded\def\placelistofsynonyms
+ {\dodoubleempty\doplacelistofsynonyms}
-\def\doplacelistofsynonyms#1#2%
+\def\doplacelistofsynonyms[#1][#2]%
{\begingroup
\def\currentsynonym{#1}%
\definedescription % todo, per class
@@ -185,15 +197,19 @@
\c!headstyle=\synonymparameter\c!textstyle,
\c!headcolor=\synonymparameter\c!textcolor,
\c!style=,
- \c!color=]%
+ \c!color=.
+ #2]%
\startpacked
\ctxlua{joblists.process('#1',{ criterium = "\synonymparameter\c!criterium" })}%
\stoppacked
\endgroup}
-\def\docompletelistofsynonyms#1#2% expansion needed to avoid v! (due to french active !)
- {\normalexpanded{\noexpand\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
- \doplacelistofsynonyms{#1}{#2}%
+\def\completelistofsynonyms
+ {\dodoubleempty\docompletelistofsynonyms}
+
+\def\docompletelistofsynonyms[#1][#2]% expansion needed to avoid v! (due to french active !)
+ {\normalexpanded{\systemsuppliedchapter[#1]{\noexpand\headtext{\synonymparameter\s!single}}}%
+ \doplacelistofsynonyms[#1][#2]%
\page[\v!yes]}
\let\startsynonymoutput \relax
@@ -201,10 +217,10 @@
\let\startsynonymsection\gobbleoneargument
\let\stopsynonymsection \relax
-\unexpanded\def\synonymentry#1#2#3%
+\unexpanded\def\synonymentry#1#2#3#4%
% {\syndef{\dosetsynonymattributes\c!textstyle\c!textcolor#2}#3\par}
% {\startsyndef{#2}#3\stopsyndef}
- {\syndef{#2}#3\par}
+ {\syndef{#3}#4\par}
\let\currentsorting\empty
@@ -227,7 +243,7 @@
\newtoks\everysetupsorting
-\def\setupsorting
+\unexpanded\def\setupsorting
{\dodoubleargument\dosetupsorting}
\def\dosetupsorting[#1][#2]%
@@ -248,7 +264,7 @@
%\c!expansion=,
\s!language=\currentmainlanguage]
-\def\definesorting
+\unexpanded\def\definesorting
{\dotripleempty\dodefinesorting}
% if #3=\relax or \v!none, then no command but still protected
@@ -259,19 +275,18 @@
{\ifx#3\relax \else
\unexpanded\def#3##1{\doinsertsort{#1}{##1}}%
\fi}%
- \unexpanded\setvalue{#1}{\definesort[\v!no][#1]}%
+ \setuvalue{#1}{\definesort[\v!no][#1]}%
\else
- \unexpanded\setvalue{#1}{\definesort[\v!yes][#1]}%
+ \setuvalue{#1}{\definesort[\v!yes][#1]}%
\fi
- \getparameters[\??so#1][\s!parent=\??so]%
+ \getparameters[\??so#1][\s!parent=\??so,\s!multi={#2}]%
\presetheadtext[#2=\Word{#2}]% after \ifthirdargument -)
%\ctxlua{joblists.define('#1')}%
\setvalue{\e!setup #2\e!endsetup}{\dodoubleargument\getparameters[\??so#1]}% to be obsolete
- \setvalue{\e!place \e!listof#2}{\doplacelistofsortings{#1}{#2}}%
- \setvalue{\e!complete\e!listof#2}{\docompletelistofsortings{#1}{#2}}}
+ \setvalue{\e!place \e!listof#2}{\placelistofsorts[#1]}%
+ \setvalue{\e!complete\e!listof#2}{\completelistofsorts[#1]}}
-
-\def\definesort
+\unexpanded\def\definesort
{\dotripleempty\dodefinesort}
\def\dodefinesort[#1][#2][#3]#4%
@@ -298,32 +313,46 @@
% used = false,
}
})}%
- \doif{#1}\v!yes{\unexpanded\setxvalue\currentsortingtag{\noexpand\doinsertsort{\currentsorting}{\currentsortingtag}}}%
+ \doif{#1}\v!yes{\setuxvalue\currentsortingtag{\noexpand\doinsertsort{\currentsorting}{\currentsortingtag}}}%
\fi
\endgroup}
-\def\doinsertsort#1#2% name tag
+\unexpanded\def\doinsertsort#1#2% name tag
{\begingroup
% no kap currently, of .. we need to map cap onto WORD
+ \edef\currentsorting{#1}%
\dosetsynonymattributes\c!style\c!color
\ctxlua{joblists.synonym("#1","#2")}%
- \endgroup}
+ \normalexpanded{\endgroup\sortingparameter\c!next}}
+
+\def\registersort
+ {\dodoubleargument\doregistersort}
+
+\def\registersort[#1][#2]%
+ {\ctxlua{joblists.registerused("#1","#2")}}
% before after
%
% maybe just 'commandset' and then combine
-\def\doplacelistofsorts#1% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC
+\unexpanded\def\placelistofsorts
+ {\dodoubleempty\placelistofsorts}
+
+\unexpanded\def\placelistofsorts[#1][#2]% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC
{\begingroup
\def\currentsorting{#1}%
+ \getparameters[\??so#1][#2]%
\startpacked
- \ctxlua{joblists.process('#1',{})}%
+ \ctxlua{joblists.process('#1',{ criterium = "\sortingparameter\c!criterium" })}%
\stoppacked
\endgroup}
-\def\docompletelistofsorts#1#2%
- {\normalexpanded{\noexpand\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
- \doplacelistofsorts{#1}%
+\def\completelistofsorts
+ {\dodoubleemptydocompletelistofsorts}
+
+\def\docompletelistofsorts[#1][#2]%
+ {\normalexpanded{\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
+ \doplacelistofsorts[#1][#2]%
\page[\v!yes]}
\let\startsortingoutput \relax
@@ -331,8 +360,10 @@
\let\startsortingsection\gobbleoneargument
\let\stopsortingsection \relax
-\def\sortingentry#1#2#3%
- {\begingroup\dosetsortingattributes\c!style\c!color#2\endgroup\par} % todo
+\def\sortingentry#1#2#3#4% #4 is meaning but empty here
+ {\doifelsenothing{\sortingparameter\c!command}
+ {\begingroup\dosetsortingattributes\c!style\c!color#3\endgroup\par} % todo
+ {\sortingparameter\c!command{#1}{#2}{#3}}}
%D Here we define a support macro that can sort simple comma
%D separated lists. It's a multi-list variant of a prototype
diff --git a/Master/texmf-dist/tex/context/base/strc-xml.mkiv b/Master/texmf-dist/tex/context/base/strc-xml.mkiv
index 3f11c0ac9f8..7a009958597 100644
--- a/Master/texmf-dist/tex/context/base/strc-xml.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-xml.mkiv
@@ -15,13 +15,23 @@
\unprotect
-\startxmlsetups xml:ctx:tocentry
- \xmlsetsetup{\xmldocument}{ctx:tocentry}{xml:ctx:tocentry}
+\startxmlsetups xml:ctx:internal:setup
+ \xmlsetsetup{\xmldocument}{ctx:genericentry} {xml:ctx:genericentry}
+ \xmlsetsetup{\xmldocument}{ctx:sectionentry} {xml:ctx:sectionentry}
+ \xmlsetsetup{\xmldocument}{ctx:registerentry}{xml:ctx:registerentry}
\stopxmlsetups
-\xmlregistersetup{xml:ctx:tocentry}
+\xmlregistersetup{xml:ctx:internal:setup}
-\startxmlsetups xml:ctx:tocentry
+\startxmlsetups xml:ctx:genericentry
+ \xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:ctx:sectionentry
+ \xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:ctx:registerentry
\xmlflush{#1}
\stopxmlsetups
diff --git a/Master/texmf-dist/tex/context/base/supp-box.tex b/Master/texmf-dist/tex/context/base/supp-box.tex
index e314305d7dc..4c398973ee3 100644
--- a/Master/texmf-dist/tex/context/base/supp-box.tex
+++ b/Master/texmf-dist/tex/context/base/supp-box.tex
@@ -1897,6 +1897,13 @@
\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
diff --git a/Master/texmf-dist/tex/context/base/supp-dir.mkiv b/Master/texmf-dist/tex/context/base/supp-dir.mkiv
index 2d7f6bd6640..0634bd36f34 100644
--- a/Master/texmf-dist/tex/context/base/supp-dir.mkiv
+++ b/Master/texmf-dist/tex/context/base/supp-dir.mkiv
@@ -15,4 +15,27 @@
\unprotect
+% \expanded{\defineactivecharacter \number"2000E} {\textdir TRT\relax}
+% \expanded{\defineactivecharacter \number"2000F} {\textdir TLT\relax}
+
+\unexpanded\def\showdirsinmargin
+ {\doifelse{\the\pardir}\!!TLT
+ {\inleft{\normalexpanded{\noexpand\hbox dir TLT{\ttxx[\the\pardir,\the\textdir]}}}}
+ {\inleft{\normalexpanded{\noexpand\hbox dir TLT{\ttxx[\the\pardir,\the\textdir]}}}}}
+
+\bgroup
+ \catcode`L=\othercatcode \gdef\istltdir#1#2#3{\if#2L0\else1\fi}
+ \catcode`R=\othercatcode \gdef\istrtdir#1#2#3{\if#2R0\else1\fi}
+\egroup
+
+\def\istlttextdir{\expandafter\istltdir\the\textdir}
+\def\istrttextdir{\expandafter\istrtdir\the\textdir}
+
+\def\istltpardir {\expandafter\istltdir\the\pardir }
+\def\istrtpardir {\expandafter\istrtdir\the\pardir }
+
+% \ifcase\istlttextdir Y\else N\fi
+% \ifcase\istltpardir Y\else N\fi
+% \ifcase\istltdir TRT\relax Y\else N\fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.lua b/Master/texmf-dist/tex/context/base/supp-fil.lua
index a93b0bce92f..8d69f64a72c 100644
--- a/Master/texmf-dist/tex/context/base/supp-fil.lua
+++ b/Master/texmf-dist/tex/context/base/supp-fil.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['supp-fil'] = {
version = 1.001,
- comment = "companion to supp-fil.tex",
+ comment = "companion to supp-fil.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -12,9 +12,10 @@ if not modules then modules = { } end modules ['supp-fil'] = {
at the <l n='tex'/> side.</p>
--ldx]]--
-local find, gsub, match = string.find, string.gsub, string.match
+local find, gsub, match, format, concat = string.find, string.gsub, string.match, string.format, table.concat
+local texsprint, texwrite, ctxcatcodes = tex.sprint, tex.write, tex.ctxcatcodes
-local ctxcatcodes = tex.ctxcatcodes
+local trace_modules = false trackers.register("modules.loading", function(v) trace_modules = v end)
support = support or { }
environment = environment or { }
@@ -26,7 +27,7 @@ function support.checkfilename(str) -- "/whatever..." "c:..." "http://..."
end
function support.thesanitizedfilename(str)
- tex.write((gsub(str,"\\","/")))
+ texwrite((gsub(str,"\\","/")))
end
function support.splitfilename(fullname)
@@ -84,5 +85,195 @@ function support.doiffileexistelse(name)
end
function support.lastexistingfile()
- tex.sprint(ctxcatcodes,lastexistingfile)
+ texsprint(ctxcatcodes,lastexistingfile)
end
+
+-- more, we can cache matches
+
+local finders, loaders, openers = resolvers.finders, resolvers.loaders, resolvers.openers
+
+local found = { } -- can best be done in the resolver itself
+
+-- todo: tracing
+
+local function readfilename(specification,backtrack,treetoo)
+ local fnd = found[specification]
+ if not fnd then
+ local splitspec = resolvers.splitmethod(specification)
+ local filename = splitspec.path or ""
+ if lfs.isfile(filename) then
+ fnd = filename
+ end
+ if not fnd and backtrack then
+ local fname = filename
+ for i=1,backtrack,1 do
+ fname = "../" .. fname
+ if lfs.isfile(fname) then
+ fnd = fname
+ break
+ end
+ end
+ end
+ if not fnd and treetoo then
+--~ fnd = resolvers.find_file(filename)
+ fnd = resolvers.findtexfile(filename)
+ end
+ found[specification] = fnd
+ end
+ return fnd or ""
+end
+
+support.readfilename = readfilename
+
+function finders.job(filename) return readfilename(filename,nil,false) end -- current path, no backtracking
+function finders.loc(filename) return readfilename(filename,2, false) end -- current path, backtracking
+function finders.sys(filename) return readfilename(filename,nil,true ) end -- current path, obeys tex search
+function finders.fix(filename) return readfilename(filename,2, false) end -- specified path, backtracking
+function finders.set(filename) return readfilename(filename,nil,false) end -- specified path, no backtracking
+function finders.any(filename) return readfilename(filename,2, true ) end -- loc job sys
+
+openers.job = openers.generic loaders.job = loaders.generic
+openers.loc = openers.generic loaders.loc = loaders.generic
+openers.sys = openers.generic loaders.sys = loaders.generic
+openers.fix = openers.generic loaders.fix = loaders.generic
+openers.set = openers.generic loaders.set = loaders.generic
+openers.any = openers.generic loaders.any = loaders.generic
+
+function support.doreadfile(protocol,path,name) -- better do a split and then pass table
+ local specification
+ if url.hasscheme(name) then
+ specification = name
+ else
+ specification = ((path == "") and format("%s:///%s",protocol,name)) or format("%s:///%s/%s",protocol,path,name)
+ end
+ texsprint(ctxcatcodes,resolvers.findtexfile(specification))
+end
+
+-- modules can only have a tex or mkiv suffix or can have a specified one
+
+local prefixes = { "m", "p", "s", "x", "t" }
+local suffixes = { "tex", "mkiv" }
+local modstatus = { }
+
+local function usemodule(name,hassheme)
+ local foundname
+ if hasscheme then
+ -- no auto suffix as http will return a home page or error page
+ -- so we only add one if missing
+ local fullname = file.addsuffix(name,"tex")
+ if trace_modules then
+ logs.report("modules","checking scheme driven file '%s'",fullname)
+ end
+ foundname = resolvers.findtexfile(fullname) or ""
+ elseif file.extname(name) ~= "" then
+ if trace_modules then
+ logs.report("modules","checking suffix driven file '%s'",name)
+ end
+ foundname = support.readfilename(name,false,true) or ""
+ else
+ for i=1,#suffixes do
+ local fullname = file.addsuffix(name,suffixes[i])
+ if trace_modules then
+ logs.report("modules","checking suffix driven file '%s'",fullname)
+ end
+ foundname = support.readfilename(fullname,false,true) or ""
+ if foundname ~= "" then
+ break
+ end
+ end
+ end
+ if foundname ~= "" then
+ if trace_modules then
+ logs.report("modules","loading '%s'",foundname)
+ end
+ context.startreadingfile()
+ context.input(foundname)
+ context.stopreadingfile()
+ return true
+ else
+ return false
+ end
+end
+
+function support.usemodules(prefix,askedname,truename)
+ local hasprefix = prefix and prefix ~= ""
+ local hashname = ((hasprefix and prefix) or "*") .. "-" .. truename
+ local status = modstatus[hashname]
+ if status == 0 then
+ -- not found
+ elseif status == 1 then
+ status = status + 1
+ else
+ if trace_modules then
+ logs.report("modules","locating '%s'",truename)
+ end
+ local hasscheme = url.hasscheme(truename)
+ if hasscheme then
+ -- no prefix and suffix done
+ if usemodule(truename,true) then
+ status = 1
+ else
+ status = 0
+ end
+ elseif hasprefix then
+ if usemodule(prefix .. "-" .. truename) then
+ status = 1
+ else
+ status = 0
+ end
+ else
+ for i=1,#prefixes do
+ -- todo: reconstruct name i.e. basename
+ local thename = prefixes[i] .. "-" .. truename
+ if usemodule(thename) then
+ status = 1
+ break
+ end
+ end
+ if status then
+ -- ok, don't change
+ elseif usemodule(truename) then
+ status = 1
+ else
+ status = 0
+ end
+ end
+ end
+ if status == 0 then
+ if trace_modules then
+ logs.report("modules","skipping '%s' (not found)",truename)
+ else
+ interfaces.showmessage("systems",6,askedname)
+ end
+ elseif status == 1 then
+ if not trace_modules then
+ interfaces.showmessage("systems",5,askedname)
+ end
+ else
+ if trace_modules then
+ logs.report("modules","skipping '%s' (already loaded)",truename)
+ else
+ interfaces.showmessage("systems",7,askedname)
+ end
+ end
+ modstatus[hashname] = status
+end
+
+statistics.register("loaded tex modules", function()
+ if next(modstatus) then
+ local t, f = { }, { }
+ for k, v in table.sortedhash(modstatus) do
+ k = file.basename(k)
+ if v == 0 then
+ f[#f+1] = k
+ else
+ t[#t+1] = k
+ end
+ end
+ local ts = (#t>0 and format(" (%s)",concat(t," "))) or ""
+ local fs = (#f>0 and format(" (%s)",concat(f," "))) or ""
+ return format("%s requested, %s found%s, %s missing%s",#t+#f,#t,ts,#f,fs)
+ else
+ return nil
+ end
+end)
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.mkii b/Master/texmf-dist/tex/context/base/supp-fil.mkii
index 1e86498e424..fc0492442ce 100644
--- a/Master/texmf-dist/tex/context/base/supp-fil.mkii
+++ b/Master/texmf-dist/tex/context/base/supp-fil.mkii
@@ -392,6 +392,8 @@
\readfile{#1}{#2}{#3}%
\popcatcodetable}
+\ifdefined\xmlcatcodes \else \let\xmlcatcodes\xmlcatcodesn \fi
+
\def\readxmlfile#1#2#3%
{\pushcatcodetable \catcodetable \xmlcatcodes
\readfile{#1}{#2}{#3}%
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.mkiv b/Master/texmf-dist/tex/context/base/supp-fil.mkiv
index 00263a85fbd..872612eab0b 100644
--- a/Master/texmf-dist/tex/context/base/supp-fil.mkiv
+++ b/Master/texmf-dist/tex/context/base/supp-fil.mkiv
@@ -194,7 +194,7 @@
\def\inputgivenfile#1{\normalinput"#1"\relax}
%D \macros
-%D {readfile,ReadFile,maxreadlevel}
+%D {readfile,ReadFile}
%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
@@ -236,13 +236,7 @@
%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 level (on the commandline using a directive); we default to~3.
%D
%D We use \type{\normalinput} instead of \type{\input}
%D because we want to be able to redefine the original
@@ -254,106 +248,27 @@
\let \everyreadfile \everybeforereadfile
-\newif\iftracefiles
-
-\newcount\readlevel
-
-\def\maxreadlevel{3}
-
-\newconditional\trackfilenames
-\let\trackedfilename\empty
+\def\maxreadlevel{\ctxlua{commands.maxreadlevel()}}
% 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
+\def\doreadfile#1#2#3% protocol path filename true false
+ {\edef\readfilename{\ctxlua{support.doreadfile("#1","#2","#3")}}%
\ifx\readfilename\empty
- % silently ignore
+ \expandafter\doreadfilenop
\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
+ \expandafter\doreadfileyes
\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
+\long\def\doreadfileyes#1#2%
+ {#1\relax
\the\everybeforereadfile
\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}
-
-\def\readxmlfile#1#2#3%
- {\pushcatcodetable \catcodetable \xmlcatcodes
- \readfile{#1}{#2}{#3}%
- \popcatcodetable}
-
-\unexpanded\def\ReadFile#1%
- {\readfile{#1}\donothing\donothing}
+\long\def\doreadfilenop#1#2%
+ {#2}
%D \macros
%D {readjobfile,readlocfile,readsysfile,
@@ -366,45 +281,26 @@
%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 backtracks~\number\maxreadlevel\ 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
%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
%D Of the last two, \type{\readfixfile} searches on the
%D directory specified and backtracks too, while
%D \type{\readsetfile} does only search on the specified path.
+%D
+%D The most liberal is \type {\readfile}.
-\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}}}}
+\unexpanded\def\readjobfile #1{\doreadfile{job} {.}{#1}} % current path, no backtracking
+\unexpanded\def\readlocfile #1{\doreadfile{loc} {.}{#1}} % current path, backtracking
+\unexpanded\def\readsysfile #1{\doreadfile{sys} {.}{#1}} % current path, obeys tex search
+\unexpanded\def\readfixfile#1#2{\doreadfile{fix}{#1}{#2}} % specified path, backtracking
+\unexpanded\def\readsetfile#1#2{\doreadfile{set}{#1}{#2}} % specified path, no backtracking
+\unexpanded\def\readfile #1{\doreadfile{any} {.}{#1}}
+\unexpanded\def\ReadFile #1{\doreadfile{any} {.}{#1}\donothing\donothing}
%D So now we've got ourselves five file loading commands:
%D
@@ -417,44 +313,15 @@
%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\readtexfile#1#2#3%
+ {\pushcatcodetable \catcodetable \ctxcatcodes
+ \readfile{#1}{#2}{#3}%
+ \popcatcodetable}
-\def\openfixin#1#2#3%
- {\readlevel\maxreadlevel
- \doopenin{#1}{\pathplusfile{#2}{#3}}}
+\def\readxmlfile#1#2#3%
+ {\pushcatcodetable \catcodetable \xmlcatcodes
+ \readfile{#1}{#2}{#3}%
+ \popcatcodetable}
%D \macros
%D {doiffileelse,doiflocfileelse}
@@ -545,13 +412,13 @@
\newtoks \everystartreadingfile
\newtoks \everystopreadingfile
-\def\startreadingfile% beter een every en \setnormalcatcodes
+\unexpanded\def\startreadingfile% beter een every en \setnormalcatcodes
{\global\advance\readingfilelevel\plusone
\the\everystartreadingfile
\beginrestorecatcodes
\setcatcodetable\prtcatcodes}
-\def\stopreadingfile
+\unexpanded\def\stopreadingfile
{\endrestorecatcodes
\the\everystopreadingfile
\global\advance\readingfilelevel\minusone}
diff --git a/Master/texmf-dist/tex/context/base/supp-mat.tex b/Master/texmf-dist/tex/context/base/supp-mat.mkii
index 1a51164e676..1a51164e676 100644
--- a/Master/texmf-dist/tex/context/base/supp-mat.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mat.mkii
diff --git a/Master/texmf-dist/tex/context/base/supp-mat.mkiv b/Master/texmf-dist/tex/context/base/supp-mat.mkiv
new file mode 100644
index 00000000000..4aebddda91d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/supp-mat.mkiv
@@ -0,0 +1,293 @@
+%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 / 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 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\Ustartmath #1\Ustopmath \fi}
+\long\def\displaymath#1{\noindent \ifmmode#1\else\Ustartdisplaymath#1\Ustopdisplaymath\fi}
+\long\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\Ustartmath #1\Ustopmath \fi}
+
+\let\stopmathmode\relax
+
+\unexpanded\def\startmathmode % cannot be used nested
+ {\relax\ifmmode
+ \let\stopmathmode\relax
+ \else
+ \Ustartmath\let\stopmathmode\Ustopmath
+ \fi}
+
+\unexpanded\def\startmathmode % nested variant
+ {\relax\ifmmode
+ \begingroup\let\stopmathmode\endgroup
+ \else
+ \Ustartmath\let\stopmathmode\Ustopmath
+ \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
+ \Ustartmath\mathsurround\zeropoint#1\radical\zerocount{#2}\Ustopmath}%
+ \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/supp-mis.mkii b/Master/texmf-dist/tex/context/base/supp-mis.mkii
index 5b45d8b9da0..f3bde453ba2 100644
--- a/Master/texmf-dist/tex/context/base/supp-mis.mkii
+++ b/Master/texmf-dist/tex/context/base/supp-mis.mkii
@@ -91,8 +91,7 @@
\ifnocontextobject \writestatus \do
- \def\writestatus#1#2%
- {\immediate\write16{#1 : #2}}
+ \def\writestatus#1#2{\immediate\write16{#1 : #2}}
\fi
@@ -704,6 +703,30 @@
\let\newconditional = \setfalse
\let\ifconditional = \ifcase
+%D We could load \type {norm-tex} but this takes less hash space:
+
+\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 \normalfi = \fi
+\let \normalelse = \else
+
+\let \normalunexpanded = \unexpanded % beware the primitive, not the context one
+
%D That's it. Please forget this junk and take a look at how
%D it should be done.
diff --git a/Master/texmf-dist/tex/context/base/supp-mis.tex b/Master/texmf-dist/tex/context/base/supp-mis.tex
index c5c2dfb851c..bda8d4f6fda 100644
--- a/Master/texmf-dist/tex/context/base/supp-mis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mis.tex
@@ -1,5 +1,4 @@
-% This file is not needed, for instance supp-pdf has the relevant code
-% built in and ppchtex is adapted.
-
-\input supp-mis.mkii
-
+% 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/supp-mpe.tex b/Master/texmf-dist/tex/context/base/supp-mpe.tex
index 27518ba6125..f4438133a2a 100644
--- a/Master/texmf-dist/tex/context/base/supp-mpe.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mpe.tex
@@ -1,5 +1,4 @@
-% This file is not needed as I don't expect other macro packages
-% to support the metafun extensions.
-
-\input supp-mpe.mkii
-
+% 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/supp-mps.mkii b/Master/texmf-dist/tex/context/base/supp-mps.mkii
index 3629ccf0b4a..b071ffe72de 100644
--- a/Master/texmf-dist/tex/context/base/supp-mps.mkii
+++ b/Master/texmf-dist/tex/context/base/supp-mps.mkii
@@ -236,7 +236,8 @@
%D The next hack prevents too long lines:
\long\def\runtimeobeyMPlines
- {\ifx\rawcharacter\undefined
+ {\catcode35=11\relax % goodie
+ \ifx\rawcharacter\undefined
\let\obeyedline\space
\else
\obeylines
diff --git a/Master/texmf-dist/tex/context/base/supp-num.tex b/Master/texmf-dist/tex/context/base/supp-num.tex
index 130fd393844..d192ab54836 100644
--- a/Master/texmf-dist/tex/context/base/supp-num.tex
+++ b/Master/texmf-dist/tex/context/base/supp-num.tex
@@ -195,23 +195,25 @@
%D Although we could do with one pass, a second pass for
%D handling the stored sequence is more readable.
-\startmode[mkiv]
+\ifnum\texengine=\luatexengine
\def\dohandledigits
- {\mathcode`\,="003B \mathcode`\.="003A % pretty hard coded
+ {\mathcode`\,="002C \mathcode`\.="002E % pretty hard coded
\expandafter\handletokens\collecteddigits\with\scandigits
\ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
-\stopmode
+ \chardef\mathaxisfontid\zerocount
-\startnotmode[mkiv]
+\else
\def\dohandledigits
{\mathcode`\,="013B \mathcode`\.="013A % pretty hard coded
\expandafter\handletokens\collecteddigits\with\scandigits
\ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
-\stopnotmode
+ \chardef\mathaxisfontid\plustwo
+
+\fi
\def\doscandigit#1%
{\ifcase\skipdigit\@EA\hbox\else\@EA\hphantom\fi\bgroup
@@ -230,7 +232,6 @@
\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).
@@ -317,9 +318,9 @@
{\ifcase\digitsignmode#1\else
\hbox
{\setbox\scratchbox\hbox{0}%
- \scratchdimen\mathaxisheight\textfont2
+ \scratchdimen\mathaxisheight\textfont\mathaxisfontid
\def\digitsgn##1##2%
- {\advance\scratchdimen-\mathaxisheight##12
+ {\advance\scratchdimen-\mathaxisheight##1\mathaxisfontid
\raise\scratchdimen
\hbox to \wd\scratchbox{\hss$##2#1$\hss}}%
\ifcase\digitsignmode\or
@@ -390,7 +391,7 @@
%D
%D We also permit:
-\let\Digits=\digits
+\let\Digits\digits
%D These macros are complicated by the fact that we also
%D have to support cases like:
@@ -435,8 +436,8 @@
\handletokens#1\with\scandigittemplate}
\def\scandigittemplate#1%
- {\if #1.\ifcase\digitinputmode\chardef\digitinputmode1 \fi% period
- \else\if#1,\ifcase\digitinputmode\chardef\digitinputmode2 \fi% comma
+ {\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/supp-pdf.tex b/Master/texmf-dist/tex/context/base/supp-pdf.tex
index a7467fce81e..2ae87806782 100644
--- a/Master/texmf-dist/tex/context/base/supp-pdf.tex
+++ b/Master/texmf-dist/tex/context/base/supp-pdf.tex
@@ -1,2 +1 @@
-\input supp-pdf.mkii
-
+\input supp-pdf.mkii
diff --git a/Master/texmf-dist/tex/context/base/supp-ran.lua b/Master/texmf-dist/tex/context/base/supp-ran.lua
index 9e4330f57ca..fe635fc7f9e 100644
--- a/Master/texmf-dist/tex/context/base/supp-ran.lua
+++ b/Master/texmf-dist/tex/context/base/supp-ran.lua
@@ -11,7 +11,20 @@ if not modules then modules = { } end modules ['supp-ran'] = {
commands = commands or { }
-local texwrite, random, seed, last = tex.write, math.random, false, 1
+local random, randomseed, round, seed, last = math.random, math.randomseed, math.round, false, 1
+local texwrite = tex.write
+
+function math.setrandomseedi(n,comment)
+ if n <= 1 then
+ n = n*1073741823 -- maxcount
+ end
+ n = round(n)
+ if false then
+ logs.report("system","setting random seed to %s (%s)",n,comment or "normal")
+ end
+ randomseed(n)
+ last = random(0,1073741823) -- we need an initial value
+end
function commands.getrandomcounta(min,max)
last = random(min,max)
@@ -25,22 +38,30 @@ end
function commands.setrandomseed(n)
last = n
- math.randomseed(n)
+ math.setrandomseedi(n)
end
function commands.getrandomseed(n)
texwrite(last)
end
-function commands.freezerandomseed()
- if seed == false then
+-- maybe stack
+
+function commands.freezerandomseed(n)
+ -- print("<<<<",seed,last)
+ if seed == false or seed == nil then
seed = last
+ math.setrandomseedi(seed,"freeze",seed)
+ end
+ if n then
+ randomseed(n)
end
end
function commands.defrostrandomseed()
+ -- print(">>>>",seed,last)
if seed ~= false then
- math.randomseed(last)
+ math.setrandomseedi(seed,"defrost",seed) -- was last (bug)
seed = false
end
end
diff --git a/Master/texmf-dist/tex/context/base/supp-vis.tex b/Master/texmf-dist/tex/context/base/supp-vis.tex
index 82ada920229..f38c8e1e353 100644
--- a/Master/texmf-dist/tex/context/base/supp-vis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-vis.tex
@@ -201,11 +201,12 @@
%D offers \type{\hfilneg} and \type{\vfilneg}, we define our
%D own alternative double \type{ll}'ed ones.
-\def\hfillneg
- {\normalhskip\zeropoint \!!plus-1fill\relax}
-
-\def\vfillneg
- {\normalvskip\zeropoint \!!plus-1fill\relax}
+\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,
diff --git a/Master/texmf-dist/tex/context/base/symb-ini.mkiv b/Master/texmf-dist/tex/context/base/symb-ini.mkiv
index 253a7c41ce9..f4f6bdd7965 100644
--- a/Master/texmf-dist/tex/context/base/symb-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/symb-ini.mkiv
@@ -45,7 +45,7 @@
% ss:set:tag -> symbol out of set
% sstag -> list of symbols in set
-\def\definesymbol
+\unexpanded\def\definesymbol
{\dotripleempty\dodefinesymbol}
% \def\dodefinesymbol[#1][#2][#3]% class name meaning
@@ -155,7 +155,7 @@
\appendtoks \resetexternalfigures \to \everysymbol
-\def\definefiguresymbol
+\unexpanded\def\definefiguresymbol
{\dotripleempty\dodefinefiguresymbol}
\def\dodefinefiguresymbol[#1][#2][#3]%
@@ -233,15 +233,15 @@
\let\currentsymboldef\empty
-\def\startsymbolset[#1]
+\unexpanded\def\startsymbolset[#1]
{\def\currentsymboldef{#1}}
-\def\stopsymbolset
+\unexpanded\def\stopsymbolset
{\let\currentsymboldef\empty}
\newtoks\symbolsetups
-\def\setupsymbolset[#1]%
+\unexpanded\def\setupsymbolset[#1]%
{\prependtoksonce\fetchsymbol{#1}\to\symbolsetups}
\def\resetsymbolset
diff --git a/Master/texmf-dist/tex/context/base/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/syst-aux.mkiv
index 995a0cb6e02..fcc1ee88f1e 100644
--- a/Master/texmf-dist/tex/context/base/syst-aux.mkiv
+++ b/Master/texmf-dist/tex/context/base/syst-aux.mkiv
@@ -428,6 +428,11 @@
\def\undefinevalue#1{\expandafter\let\csname#1\endcsname\undefined}
\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
@@ -439,26 +444,19 @@
\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 {unexpanded}
%D
-%D Because we use thi smodule onl in \MKIV, we have removed the
+%D Because we use this module only in \MKIV, we have removed the
%D old protection code.
%D
%D \starttyping
%D \unexpanded\def\somecommand{... ... ...}
%D \stoptyping
+%D
+%D This overloads the \ETEX\ primitive but as we already had an \MKII\
+%D solution we keep the same name for a similar mechanism.
-\let \donottest \firstofoneargument % we need to weed
-\let \honorunexpanded \empty % we need to weed
-\let \forceunexpanded \empty % we need to weed
-\let \resetunexpanded \empty % we need to weed
-
-\let \unexpanded \normalprotected
+\let\unexpanded\normalprotected
%D \macros
%D {doifundefined,doifdefined,
@@ -623,8 +621,7 @@
\fi}
%D \macros
-%D {doif,doifelse,doifnot,
-%D donottest}
+%D {doif,doifelse,doifnot}
%D
%D Programming in \TEX\ differs from programming in procedural
%D languages like \MODULA. This means that one --- well, let me
@@ -641,9 +638,6 @@
%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}.
\long\def\doif#1#2%
{\edef\!!stringa{#1}\edef\!!stringb{#2}%
@@ -1120,6 +1114,15 @@
\def\processcommacommand[#1]%
{\expandafter\processcommalist\expandafter[\normalexpanded{#1}]}
+% \def\processcommacommand[#1]%
+% {\edef\expandedcommacommand{#1%
+% \ifx\expandedcommacommand\empty\else
+% \doprocesscommacommand
+% \fi}
+%
+% \def\doprocesscommacommand
+% {\expandafter\processcommalist\expandafter[\expandedcommacommand]}
+
%D The argument to \type{\command} is not delimited. Because
%D we often use \type{[]} as delimiters, we also have:
%D
@@ -1142,11 +1145,11 @@
%D
%D Two more:
-\long\def\startprocesscommalist[#1]#2\stopprocesscommalist
+\long\unexpanded\def\startprocesscommalist[#1]#2\stopprocesscommalist
{\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}%
\processcommalist[#1]\currentcommalistcommand}
-\long\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
+\long\unexpanded\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
{\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}%
\normalexpanded{\noexpand\processcommacommand[#1]}\currentcommalistcommand}
@@ -1779,6 +1782,7 @@
\def\getparameters {\dogetparameters\dosetvalue}
\def\geteparameters {\dogetparameters\dosetevalue}
\def\getgparameters {\dogetparameters\dosetgvalue}
+\def\getxparameters {\dogetparameters\dosetxvalue}
\def\forgetparameters{\dogetparameters\doignorevalue}
\let\getexpandedparameters=\geteparameters
@@ -1864,11 +1868,11 @@
\def\processassignmentcommand[#1]%
{\normalexpanded{\noexpand\processassignmentlist[#1]}}
-\long\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
+\long\unexpanded\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\unexpanded\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
{\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
\normalexpanded{\noexpand\processassignmentlist[#1]}\currentassignmentlistcommand}
@@ -1909,13 +1913,24 @@
\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}
+
\def\xdoget@e@parameters#1]%
- {\let\dosetnvalue\dosetvalue
- \let\dosetvalue\dosetevalue
+ {\let\dosetnvalue\setsomevalue
+ \let\setsomevalue\dosetevalue
\let\p!doassign\p!e!doassign
+ \let\setsomevalue\dosetevalue
\xprocesscommaitem#1,],\@relax@
\let\p!doassign\p!n!doassign
- \let\dosetvalue\dosetnvalue
+ \let\setsomevalue\dosetnvalue
\let\xdogetparameters\xdoget@n@parameters
\let\currentvalue\empty}
@@ -2137,7 +2152,7 @@
%D \def\dosetupsomething[#1][#2]%
%D {... #1 ... #2 ...}
%D
-%D \def\setupsomething
+%D \unexpanded\def\setupsomething
%D {\dodoubleargument\dosetupsomething}
%D \stoptyping
%D
@@ -2475,13 +2490,13 @@
\def\docomplexorsimpleempty#1%
{\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#1[]}}
-\def\definecomplexorsimple#1%
+\unexpanded\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\def\definecomplexorsimpleempty#1%
{\unexpanded\edef#1%
{\noexpand\docomplexorsimpleempty
\@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname}}
@@ -2876,7 +2891,7 @@
%D Also new:
-\def\define#1%
+\unexpanded\def\define#1%
{\ifdefined#1%
\message{[\noexpand#1is already defined]}%
\expandafter\def\expandafter\gobbleddefinition
@@ -3116,8 +3131,8 @@
%D We cannot use the simple scheme:
%D
%D \starttyping
-%D \def\settrue#1{\let#1=\iftrue}
-%D \def\settrue#1{\let#1=\iffalse}
+%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
@@ -3403,7 +3418,7 @@
%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 frquently used
+%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
@@ -3431,6 +3446,15 @@
\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}%
@@ -3519,13 +3543,21 @@
\def\recurselevel{\number\fastrecursecounter}%
\dodofastrecurse}
+\def\resetrecurselevel{\let\recurselevel\!!zerocount}
+
\def\dodofastrecurse
- {\ifnum\fastrecursecounter>\lastrecursecounter\else
+ {\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.
@@ -3583,7 +3615,7 @@
\csname t\strippedcsname#1\endcsname}
\def\newevery#1#2%
- {\newtoks#1% we test for redefinition elsewhere
+ {\ifx#1\everypar\else\newtoks#1\fi% we test for redefinition elsewhere
\ifx#2\relax\else\ifdefined#2\else
\expandafter\newtoks\csname t\strippedcsname#1\endcsname
\def#2{\dowithevery#1}%
@@ -3965,7 +3997,7 @@
%D hard coded delimiter like in:
%D
%D \starttyping
-%D \def\startcommand#1\stopcommand%
+%D \unexpanded\def\startcommand#1\stopcommand%
%D {... #1 ...}
%D \stoptyping
%D
@@ -3986,7 +4018,7 @@
%D This means that:
%D
%D \starttyping
-%D \def\starthello%
+%D \unexpanded\def\starthello%
%D {\grabuntil{stophello}\message}
%D
%D \starthello Hello world!\stophello
@@ -4123,7 +4155,22 @@
\afterassignment\BeforeGroup
\let\next=}
-\long\def\HandleNoGroup#1#2%
+% \long\def\HandleNoGroup#1#2%
+% {\long\def\AfterGroup{#2\egroup}%
+% \bgroup\aftergroup\AfterGroup#1}
+
+\def\HandleNoGroup % retrofit into mkii
+ {\ifnum\currentgrouptype=\@@semisimplegroup
+ \expandafter\HandleNoGroupA
+ \else
+ \expandafter\HandleNoGroupB
+ \fi}
+
+\long\def\HandleNoGroupA#1#2%
+ {\long\def\AfterGroup{#2\endgroup}%
+ \begingroup\aftergroup\AfterGroup#1}
+
+\long\def\HandleNoGroupB#1#2%
{\long\def\AfterGroup{#2\egroup}%
\bgroup\aftergroup\AfterGroup#1}
@@ -4362,19 +4409,6 @@
%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}
@@ -4385,8 +4419,7 @@
{\ifx#2\empty % redundant but gives cleaner extensions
#4{#1}%
\else\ifnum#1<\zerocount
- \bgroup\scratchcounter#1%
- \normalexpanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}%
+ \normalexpanded{\noexpand\dorecurse{\number-\number#1}}{#4{-#2#3}}%
\else\ifx#2+%
\dorecurse{#1}{#4{#3}}%
\else
@@ -5284,7 +5317,7 @@
%D \def\dodefinesomething[#1][#2]%
%D {\getparameters[\??xx#1][#2]}
%D
-%D \def\definesomething%
+%D \unexpanded\def\definesomething%
%D {\dodoubleargumentwithset\dodefinesomething}
%D \stoptyping
%D
@@ -5896,10 +5929,10 @@
\def\dostopglobaldefs
{\globaldefs\ifcsname @gd@\the\globaldefs\endcsname\zerocount}
-\def\startlocal {\dostartglobaldefs>-}
-\def\stoplocal {\dostopglobaldefs}
-\def\startglobal {\dostartglobaldefs<+}
-\def\stopglobal {\dostopglobaldefs}
+\unexpanded\def\startlocal {\dostartglobaldefs>-}
+\unexpanded\def\stoplocal {\dostopglobaldefs}
+\unexpanded\def\startglobal {\dostartglobaldefs<+}
+\unexpanded\def\stopglobal {\dostopglobaldefs}
%D \macros
%D {twodigitrounding}
@@ -5931,7 +5964,7 @@
%D Beware of verbatim, i.e. catcode changes.
%D
%D \starttyping
-%D \def\starthans%
+%D \unexpanded\def\starthans%
%D {\processcontent{stophans}\test{\message{\test}\wait}}
%D \stoptyping
%D
@@ -6118,12 +6151,16 @@
% better: push/pop
-\def\startstrictinspectnextcharacter
+\unexpanded\def\startstrictinspectnextcharacter
{\let\inspectnextcharacter\strictinspectnextcharacter}
-\def\stopstrictinspectnextcharacter
+\unexpanded\def\stopstrictinspectnextcharacter
{\let\inspectnextcharacter\normalinspectnextcharacter}
+\def\strictdoifnextoptionalelse#1#2%
+ {\startstrictinspectnextcharacter
+ \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
+
%D \macros
%D {gobblespacetokens}
%D
@@ -6261,7 +6298,7 @@
\def\??dm{@@dm} % brrr
-\def\definemeasure
+\unexpanded\def\definemeasure
{\dodoubleargument\dodefinemeasure}
\def\dodefinemeasure[#1][#2]%
@@ -6296,6 +6333,71 @@
\expandafter\thirdoffourarguments
\fi}
+%D Ok, here's another one, slower but seldom used. This one scans the text.
+%D
+%D \starttabulate[|Tc|Tc|]
+%D \NC pt \NC \doifdimenstringelse {pt}{yes}{no} \NC \NR
+%D \NC 12pt \NC \doifdimenstringelse {-12pt}{yes}{no} \NC \NR
+%D \NC 1pt \NC \doifdimenstringelse {1pt}{yes}{no} \NC \NR
+%D \NC 12pt \NC \doifdimenstringelse {12pt}{yes}{no} \NC \NR
+%D \NC 12.0pt \NC \doifdimenstringelse {12.0pt}{yes}{no} \NC \NR
+%D \NC -.12pt \NC \doifdimenstringelse {-.12pt}{yes}{no} \NC \NR
+%D \NC .12pt \NC \doifdimenstringelse {.12pt}{yes}{no} \NC \NR
+%D \NC -12pt \NC \doifdimenstringelse {-12pt}{yes}{no} \NC \NR
+%D \NC -12.0pt \NC \doifdimenstringelse{-12.0pt}{yes}{no} \NC \NR
+%D \NC big \NC \doifdimenstringelse {big}{yes}{no} \NC \NR
+%D \NC 10 \NC \doifdimenstringelse {10}{yes}{no} \NC \NR
+%D \NC 1 \NC \doifdimenstringelse {1}{yes}{no} \NC \NR
+%D \stoptabulate
+
+\def\doifdimenstringelse#1{\normalexpanded{\noexpand\dodimenteststageone#1}\empty\empty]}
+
+\def\dodimenteststageone #1#2{\csname d!1!\ifcsname d!1!#2\endcsname#2\else x\fi\endcsname#2}
+\def\dodimenteststagetwo #1#2{\csname d!2!\ifcsname d!2!#2\endcsname#2\else x\fi\endcsname#2}
+\def\dodimenteststagethree #1]{\csname d!3!\ifcsname d!3!#1\endcsname#1\else x\fi\endcsname}
+
+\expandafter\let\csname d!1!x\endcsname\dodimenteststagethree
+\expandafter\let\csname d!2!x\endcsname\dodimenteststagethree
+\expandafter\let\csname d!3!x\endcsname\secondoftwoarguments
+
+\expandafter\let\csname d!1!.\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!1!,\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!1!1\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!2\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!3\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!4\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!5\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!6\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!7\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!8\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!9\endcsname\dodimenteststageone
+\expandafter\let\csname d!1!0\endcsname\dodimenteststageone
+
+\expandafter\let\csname d!2!1\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!2\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!3\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!4\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!5\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!6\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!7\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!8\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!9\endcsname\dodimenteststagetwo
+\expandafter\let\csname d!2!0\endcsname\dodimenteststagetwo
+
+\expandafter\let\csname d!3!pt\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!pc\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!in\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!bp\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!cm\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!mm\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!dd\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!cc\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!sp\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!ex\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!em\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!nd\endcsname\firstoftwoarguments
+\expandafter\let\csname d!3!nc\endcsname\firstoftwoarguments
+
%D \macros
%D {comparedimension,comparedimensioneps}
%D
@@ -6501,10 +6603,15 @@
% awaiting the definitive implementation
-\ifdefined\resettimer \else
- \let\resettimer \relax
- \newcount\elapsedtime
-\fi
+% \ifdefined\resettimer \else
+% \let\resettimer \relax
+% \newcount\elapsedtime
+% \fi
+% \def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\elapsedtime sp\relax}
+
+\def\resettimer {\ctxlua{commands.resettimer()}}
+\def\elapsedtime {\ctxlua{commands.elapsedtime()}}
+\let\elapsedseconds \elapsedtime
\newcount\featuretest
@@ -6524,8 +6631,6 @@
\wait
\egroup}
-\def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\elapsedtime sp\relax}
-
\def\showtimer#1%
{\writestatus{runtime}{\elapsedseconds\space s / #1}}
@@ -6781,8 +6886,7 @@
%D \stoptyping
\def\stripstring#1% #1 is \cs
- {\edef\cs{\ctxlua
- {tex.sprint(tex.vrbcatcodes,string.strip(\!!bs\detokenize\expandafter{#1}\!!es))}}}
+ {\edef\cs{\ctxlua{tex.sprint(tex.vrbcatcodes,string.strip(\!!bs\detokenize\expandafter{#1}\!!es))}}}
%D \macros
%D {dowithrange}
@@ -6864,11 +6968,11 @@
\newbox\nointerferencebox
-\def\startnointerference % not even grouped !
+\unexpanded\def\startnointerference % not even grouped !
{\setbox\nointerferencebox\vbox
\bgroup}
-\def\stopnointerference
+\unexpanded\def\stopnointerference
{\egroup
\setbox\nointerferencebox\emptybox}
diff --git a/Master/texmf-dist/tex/context/base/syst-con.lua b/Master/texmf-dist/tex/context/base/syst-con.lua
index b2f6c42afc8..638f3c797bf 100644
--- a/Master/texmf-dist/tex/context/base/syst-con.lua
+++ b/Master/texmf-dist/tex/context/base/syst-con.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['syst-con'] = {
version = 1.001,
- comment = "companion to syst-con.tex",
+ comment = "companion to syst-con.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/Master/texmf-dist/tex/context/base/syst-ext.mkii b/Master/texmf-dist/tex/context/base/syst-ext.mkii
index 898ee8000a5..73fb98b728f 100644
--- a/Master/texmf-dist/tex/context/base/syst-ext.mkii
+++ b/Master/texmf-dist/tex/context/base/syst-ext.mkii
@@ -498,8 +498,8 @@
%D We cannot use the simple scheme:
%D
%D \starttyping
-%D \def\settrue#1{\let#1=\iftrue}
-%D \def\settrue#1{\let#1=\iffalse}
+%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
@@ -969,7 +969,7 @@
%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 frquently used
+%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
@@ -997,6 +997,15 @@
\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}%
@@ -1040,13 +1049,21 @@
\def\recurselevel{\number\fastrecursecounter}%
\dodofastrecurse}
+\def\resetrecurselevel{\let\recurselevel\!!zerocount}
+
\def\dodofastrecurse
- {\ifnum\fastrecursecounter>\lastrecursecounter\else
+ {\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.
@@ -4752,6 +4769,10 @@
\def\stopstrictinspectnextcharacter
{\let\inspectnextcharacter\normalinspectnextcharacter}
+\def\strictdoifnextoptionalelse#1#2%
+ {\startstrictinspectnextcharacter
+ \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
+
%D \macros
%D {gobblespacetokens}
%D
diff --git a/Master/texmf-dist/tex/context/base/syst-gen.mkii b/Master/texmf-dist/tex/context/base/syst-gen.mkii
index 65a501360f3..0367ba4fd76 100644
--- a/Master/texmf-dist/tex/context/base/syst-gen.mkii
+++ b/Master/texmf-dist/tex/context/base/syst-gen.mkii
@@ -4435,7 +4435,15 @@
% \ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi
% \ifx\writebanner\undefined \def\writebanner{\writestring} \fi
-\let\writestatus\normalwritestatus
+\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}
diff --git a/Master/texmf-dist/tex/context/base/syst-ini.tex b/Master/texmf-dist/tex/context/base/syst-ini.tex
index 2a04f111271..7c9d72127a7 100644
--- a/Master/texmf-dist/tex/context/base/syst-ini.tex
+++ b/Master/texmf-dist/tex/context/base/syst-ini.tex
@@ -311,7 +311,7 @@
\newdimen\onepoint \onepoint = 1pt
\newdimen\maxdimen \maxdimen = 16383.99999pt
\newdimen\onebasepoint \onebasepoint = 1bp
-\chardef \scaledpoint = 1
+\newdimen\scaledpoint \scaledpoint = 1sp
\newdimen\thousandpoint\thousandpoint= 1000pt
\let\points\onepoint
@@ -442,7 +442,7 @@
\chardef\@@active = 13 \chardef\active = 13
\chardef\@@comment = 14
-%D Constants to be used with \type {\grouptype}.
+%D Constants to be used with \type {\currentgrouptype}.
\chardef\@@bottomlevelgroup = 0
\chardef\@@simplegroup = 1
@@ -580,7 +580,7 @@
\tracingstats\plusone
-%D Here we also save \input, more will be saved later.
+%D Here we also save \type {\input}, more will be saved later.
\ifdefined\normalinput \else \let\normalinput\input \fi
@@ -800,13 +800,14 @@
\pdfminorversion \plusfive
- \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi
- \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi
- \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode\plusone
+ \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\plusone \pdfcompresslevel\plusnine }
- \def\normalpdfcompression {\pdfobjcompresslevel\plusone \pdfcompresslevel\plusthree}
+ \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine }
+ \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree}
\normalpdfcompression
diff --git a/Master/texmf-dist/tex/context/base/syst-ltx.tex b/Master/texmf-dist/tex/context/base/syst-ltx.tex
new file mode 100644
index 00000000000..ae89ff25b81
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-ltx.tex
@@ -0,0 +1,56 @@
+%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]
+%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 {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/syst-lua.lua b/Master/texmf-dist/tex/context/base/syst-lua.lua
index 6df1b7b4480..64028295350 100644
--- a/Master/texmf-dist/tex/context/base/syst-lua.lua
+++ b/Master/texmf-dist/tex/context/base/syst-lua.lua
@@ -1,13 +1,14 @@
if not modules then modules = { } end modules ['syst-lua'] = {
version = 1.001,
- comment = "companion to syst-lua.tex",
+ comment = "companion to syst-lua.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local texsprint, texprint, texwrite, texiowrite_nl = tex.sprint, tex.print, tex.write, texio.write_nl
-local format = string.format
+local format, find = string.format, string.find
+local lpegmatch = lpeg.match
local ctxcatcodes = tex.ctxcatcodes
@@ -20,14 +21,29 @@ function commands.writestatus(a,b,c,...)
texiowrite_nl(format("%-16s: %s\n",a,b)) -- b can have %'s
end
end
+function commands.writedebug(a,b,c,...)
+ if c then
+ texiowrite_nl(format("%-16s| %s\n",a,format(b,c,...)))
+ else
+ texiowrite_nl(format("%-16s| %s\n",a,b)) -- b can have %'s
+ end
+end
+
+function commands.report(s,t,...)
+ commands.writestatus("!"..s,format(t,...))
+end
-function commands.doifelse(b)
+local function testcase(b)
if b then -- faster with if than with expression
texsprint(ctxcatcodes,"\\firstoftwoarguments")
else
texsprint(ctxcatcodes,"\\secondoftwoarguments")
end
end
+
+commands.testcase = testcase
+commands.doifelse = testcase
+
function commands.doif(b)
if b then
texsprint(ctxcatcodes,"\\firstofoneargument")
@@ -43,14 +59,12 @@ function commands.doifnot(b)
end
end
-commands.testcase = commands.doifelse
-
function commands.boolcase(b)
if b then texwrite(1) else texwrite(0) end
end
function commands.doifelsespaces(str)
- return commands.doifelse(str:find("^ +$"))
+ return commands.doifelse(find(str,"^ +$"))
end
local s = lpeg.Ct(lpeg.splitat(","))
@@ -59,27 +73,27 @@ local h = { }
function commands.doifcommonelse(a,b)
local ha = h[a]
local hb = h[b]
- if not ha then ha = s:match(a) h[a] = ha end
- if not hb then hb = s:match(b) h[b] = hb end
+ if not ha then ha = lpegmatch(s,a) h[a] = ha end
+ if not hb then hb = lpegmatch(s,b) h[b] = hb end
for i=1,#ha do
for j=1,#hb do
if ha[i] == hb[j] then
- return commands.testcase(true)
+ return testcase(true)
end
end
end
- return commands.testcase(false)
+ return testcase(false)
end
function commands.doifinsetelse(a,b)
local hb = h[b]
- if not hb then hb = s:match(b) h[b] = hb end
+ if not hb then hb = lpegmatch(s,b) h[b] = hb end
for i=1,#hb do
if a == hb[i] then
- return commands.testcase(true)
+ return testcase(true)
end
end
- return commands.testcase(false)
+ return testcase(false)
end
function commands. def (cs,value) texsprint(ctxcatcodes,format( "\\def\\%s{%s}",cs,value)) end
@@ -87,3 +101,9 @@ function commands.edef (cs,value) texsprint(ctxcatcodes,format("\\edef\\%s{%s}
function commands.gdef (cs,value) texsprint(ctxcatcodes,format("\\gdef\\%s{%s}",cs,value)) end
function commands.xdef (cs,value) texsprint(ctxcatcodes,format("\\xdef\\%s{%s}",cs,value)) end
function commands.chardef(cs,value) texsprint(ctxcatcodes,format("\\chardef\\%s=%s\\relax",cs,value)) end
+
+local pattern = lpeg.patterns.validdimen
+
+function commands.doifdimenstringelse(str)
+ testcase(lpegmatch(pattern,str))
+end
diff --git a/Master/texmf-dist/tex/context/base/type-tmf.tex b/Master/texmf-dist/tex/context/base/tabl-com.mkii
index 78ed89cf9c3..892905f6c12 100644
--- a/Master/texmf-dist/tex/context/base/type-tmf.tex
+++ b/Master/texmf-dist/tex/context/base/tabl-com.mkii
@@ -1,8 +1,8 @@
%D \module
-%D [ file=type-tmf,
-%D version=2007.07.30,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Core \TEX\ Fonts,
+%D [ file=tabl-com,
+%D version=2009.08.22,
+%D title=\CONTEXT\ Table Macros,
+%D subtitle=Common Code,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,6 +11,11 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\loadmarkfile{type-tmf}
+\writestatus{loading}{ConTeXt Table Macros / Common Code}
-\endinput
+\unprotect
+
+\let\NC\relax
+\let\NR\relax
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/tabl-com.mkiv b/Master/texmf-dist/tex/context/base/tabl-com.mkiv
new file mode 100644
index 00000000000..892905f6c12
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/tabl-com.mkiv
@@ -0,0 +1,21 @@
+%D \module
+%D [ file=tabl-com,
+%D version=2009.08.22,
+%D title=\CONTEXT\ Table Macros,
+%D subtitle=Common Code,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Table Macros / Common Code}
+
+\unprotect
+
+\let\NC\relax
+\let\NR\relax
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/tabl-ltb.mkii b/Master/texmf-dist/tex/context/base/tabl-ltb.mkii
index 0ff64047e62..095e30e2b76 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ltb.mkii
+++ b/Master/texmf-dist/tex/context/base/tabl-ltb.mkii
@@ -1,5 +1,5 @@
%D \module
-%D [ file=core-ltb,
+%D [ file=tabl-ltb,
%D version=2002.10.31,
%D title=\CONTEXT\ Table Macros,
%D subtitle=Line Tables,
diff --git a/Master/texmf-dist/tex/context/base/tabl-ltb.mkiv b/Master/texmf-dist/tex/context/base/tabl-ltb.mkiv
index 0ff64047e62..7d3fab0df37 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ltb.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-ltb.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=core-ltb,
+%D [ file=tabl-ltb,
%D version=2002.10.31,
%D title=\CONTEXT\ Table Macros,
%D subtitle=Line Tables,
@@ -93,7 +93,7 @@
\chardef\linetablepage \zerocount
\chardef\linetablerepeat\zerocount
-\def\setuplinetable
+\unexpanded\def\setuplinetable
{\dotripleempty\dosetuplinetable}
\def\dosetuplinetable[#1][#2][#3]%
@@ -182,7 +182,7 @@
}
{\xdef\noflinetablelines{\linetableparameter\c!lines}}}
-\def\startlinetablecell
+\unexpanded\def\startlinetablecell
{\dosingleempty\dostartlinetablecell}
\def\dostartlinetablecell[#1]%
@@ -247,7 +247,7 @@
\dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty
\begstrut \ignorespaces}
-% \def\stoplinetablecell
+% \unexpanded\def\stoplinetablecell
% {\unskip \endstrut
% \dostopattributes
% \ifcase\linetablemode
@@ -269,7 +269,7 @@
\newconditional\linetableautoheight \settrue\linetableautoheight
-\def\stoplinetablecell
+\unexpanded\def\stoplinetablecell
{\unskip \endstrut
\dostopattributes
\ifcase\linetablemode
@@ -298,7 +298,7 @@
\fi
\egroup}
-% \def\stoplinetablecell
+% \unexpanded\def\stoplinetablecell
% {\unskip \endstrut
% \dostopattributes
% \ifcase\linetablemode
@@ -387,14 +387,14 @@
\setnoftableslines
\fi}
-\def\startlinetablepart
+\unexpanded\def\startlinetablepart
{\global\linetablesubcol\zerocount
\setbox\scratchbox\hbox\bgroup
\doconvertfont{\linetablerparameter\c!style}%
\startcolor[\linetablerparameter\c!color]%
\ignorespaces}
-\def\stoplinetablepart
+\unexpanded\def\stoplinetablepart
{\ifnum\linetablepart>\zerocount
\unskip \unskip % remove last intercolumn skip (distance+fill)
\fi
@@ -514,7 +514,7 @@
% \linetableparameter\c!var -> \@@levar (when no classes)
-\def\startlinetablerun % to do: quit when nested
+\unexpanded\def\startlinetablerun % to do: quit when nested
{\bgroup
\inlinetabletrue
% autowidth
@@ -571,7 +571,7 @@
\let\NR\linetableNR
\flushlinetablehead}
-\def\stoplinetablerun
+\unexpanded\def\stoplinetablerun
{\globallet\linetableline\!!maxcard
\chardef\linetableheadstate\zerocount % blocked
\flushlinetableparts
@@ -736,19 +736,19 @@
{\stoplinetablecell % dummy
\linetableER}
-\def\startlinetable
+\unexpanded\def\startlinetable
{\startlinetablerun}
-\def\stoplinetable
+\unexpanded\def\stoplinetable
{\stoplinetablerun}
-\def\startlinetableanalysis
+\unexpanded\def\startlinetableanalysis
{\bgroup
\linetableprerolltrue
\trialtypesettingtrue
\startlinetablerun}
-\def\stoplinetableanalysis
+\unexpanded\def\stoplinetableanalysis
{\stoplinetablerun
\egroup
\globallet\noflinetablerows\linetablerows
@@ -767,7 +767,7 @@
\newtoks \@@linetablehead
-\long\def\startlinetablehead#1\stoplinetablehead
+\long\unexpanded\def\startlinetablehead#1\stoplinetablehead
{\ifinlinetable
\@@linetablehead\emptytoks
\fi
diff --git a/Master/texmf-dist/tex/context/base/tabl-ntb.mkii b/Master/texmf-dist/tex/context/base/tabl-ntb.mkii
index 1f9a9d5747d..0bfcc20c68f 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ntb.mkii
+++ b/Master/texmf-dist/tex/context/base/tabl-ntb.mkii
@@ -1213,6 +1213,7 @@
\fi
\advance\xxrowTBL\plusone}%
% distribute overshoot equally
+\ifdim\dimen2>\zeropoint % see natural-003
\ifdim\dimen4<\dimen0
\advance\dimen0 -\dimen4
\divide\dimen0 \!!countb
@@ -1231,6 +1232,7 @@
\else\ifdim\dimen4>\dimen0
\settblhei\xrowTBL{\the\dimen2}%
\fi\fi
+\fi
\fi}
\def\checktblheightsone
diff --git a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
index e7df3b28171..b24eaa85d3c 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
@@ -214,6 +214,7 @@
\newif\ifappendTBLsetups \appendTBLsetupstrue
\newif\ifenableTBLbreak \enableTBLbreakfalse
\newif\ifmultipleTBLheads \multipleTBLheadsfalse
+\newif\iftightTBLrowspan \tightTBLrowspantrue
\newif\iftraceTABLE \traceTABLEfalse
@@ -320,7 +321,37 @@
% \eTABLE
% \stopTEXpage
-\def\setupTBLcell#1#2% cell over col over row
+%D By default rowspans are tight but you can change that:
+%D
+%D \startbuffer
+%D \bTABLE
+%D \bTR[height=20pt] \bTH 1. col \eTH \bTH 2. col \eTH \eTR
+%D \bTR[height=20pt] \bTD 1 row in 1. col \eTD \bTD[nr=2] 2 rows in 2. col \eTD \eTR
+%D \bTR[height=20pt] \bTD[nr=2] 2 rows in 1. col\eTD \eTR
+%D \bTR[height=20pt] \bTD[nr=3] 3 rows in 2. col \eTD \eTR
+%D \bTR[height=20pt] \bTD 1 row in 1. col \eTD \eTR
+%D \bTR[height=20pt] \bTD 1 row in 1. col \eTD \eTR
+%D \eTABLE
+%D
+%D \bTABLE
+%D \bTR[height=20pt] \bTH 2. col \eTH \bTH 1. col \eTH \eTR
+%D \bTR[height=20pt] \bTD[nr=2] 2 rows in 2. col \eTD \bTD 1 row in 1. col \eTD \eTR
+%D \bTR[height=20pt] \bTD[nr=2] 2 rows in 1. col\eTD \eTR
+%D \bTR[height=20pt] \bTD[nr=3] 3 rows in 2. col \eTD \eTR
+%D \bTR[height=20pt] \bTD 1 row in 1. col \eTD \eTR
+%D \bTR[height=20pt] \bTD 1 row in 1. col \eTD \eTR
+%D \eTABLE
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \getbuffer
+%D
+%D With \type {\tightTBLrowspanfalse} we get:
+%D
+%D \start \tightTBLrowspanfalse \getbuffer \stop
+
+\unexpanded\def\setupTBLcell#1#2% cell over col over row
{\setupTBLsection % already forgotten
\edef\positiverow{\number#1}%
\edef\positivecol{\number#2}%
@@ -626,7 +657,7 @@
\long\def\doTABLEfoot[#1]#2\eTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot}
\long\def\doTABLEsection[#1]#2%
- {\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}%
+ {\unexpanded\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}%
#2%
\let\setupTBLsection\relax}
@@ -656,6 +687,9 @@
\getparameters
[\@@tbl\@@tbl]
[\c!align={\v!right,\v!broad,\v!high},#1]%
+ \ifx\tbltblsetups\empty\else
+ \doprocesslocalsetups\tbltblsetups
+ \fi
\hsize\tbltbltextwidth
\processaction
[\tbltblsplit]
@@ -776,6 +810,17 @@
% \vskip-\strutdp
% \fi
\fi
+ % tracing
+ % \iftrue
+ % \blank \tttf
+ % \dorecurse\maximumrow
+ % {\row\recurselevel\relax
+ % \dorecurse\maximumcol
+ % {\col\recurselevel\relax
+ % [r=\the\row,c=\the\col,h=\the\dimexpr\gettblht\row\col,w=\the\dimexpr\gettblwd\row\col]}%
+ % \par}%
+ % \blank
+ % \fi
\egroup
\popTBL}
@@ -829,6 +874,9 @@
{\global\advance\tblrow\plusone
\global\tblcol\zerocount
\global\tblspn\zerocount}%
+ % \iftrue
+ % \bgroup\tbox{\tttf[\number\tblrow]}\egroup
+ % \fi
\nexttblcol
\kern\dimexpr\tbltblleftmargindistance-\tbltblcolumndistance\relax}
@@ -923,8 +971,7 @@
\else
\scratchcounter#1\relax
\dorecurse\!!countb
- {\advance\scratchdimen
- \gettblhei\scratchcounter
+ {\advance\scratchdimen\gettblhei\scratchcounter
\advance\scratchcounter\plusone}%
\ifdim\scratchdimen<\!!heighta\relax
\scratchdimen\!!heighta
@@ -1190,24 +1237,28 @@
\fi
\advance\xxrowTBL\plusone}%
% distribute overshoot equally
- \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
+ \ifdim\dimen2>\zeropoint % new: test on 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
+ \iftightTBLrowspan
+ \settblhei\xrowTBL{\the\dimen2}%
+ \fi
+ \fi\fi
+ \fi
\fi}
\def\checktblheightsone
@@ -1372,7 +1423,7 @@
\fi}%
\hskip\gettbldis{#2}}
-\presetlocalframed
+\presetlocalframed % todo: tableparameter etc
[\@@tbl\@@tbl]
\setupTABLE [%
@@ -1405,6 +1456,7 @@
\c!rightmargindistance=\zeropoint,% whole table
\c!left=,
\c!right=,
+ \c!setups=,
\c!splitmethod=a%
]
@@ -1549,7 +1601,7 @@
% \bTRs[xx] \bTD oeps \eTD \bTD oeps \eTD \eTRs
% \eTABLE
-\def\defineTABLEsetup
+\unexpanded\def\defineTABLEsetup
{\dodoubleargument\dodefineTABLEsetup}
\def\dodefineTABLEsetup[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/tabl-tab.mkiv b/Master/texmf-dist/tex/context/base/tabl-tab.mkiv
index 429f41add44..d926dab989a 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tab.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-tab.mkiv
@@ -980,12 +980,13 @@
\newconditional\tablerepeathead
\newconditional\tablerepeattail
-\def\starttable
+\unexpanded\def\starttable
{\bgroup
+ \let\stoptable\dostoptable
\doif\@@tisplit\v!auto
{\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}%
\doifinsetelse\@@tisplit{\v!yes,\v!repeat}
- {\def\stoptable{\stoptables\egroup}%
+ {\unexpanded\def\stoptable{\stoptables\egroup}%
\starttables}
{\doifelsenothing\@@tiframe
{\ifinsidefloat\else\startbaselinecorrection\fi}
@@ -993,7 +994,12 @@
\postponenotes
\firststagestartTABLE}}
-\def\stoptable
+% We cannot define \unexpanded\def\dostoptable a ssomehow lookahead
+% in alignments fail then, so we relax it and define it locally.
+
+\let\stoptabel\relax
+
+\def\dostoptable
{\chuckTABLEautorow % before the tail, else noalign problem
\insertTABLEtail
\TABLEnoalign{\globalletempty\@@TABLEhead}%
@@ -1039,7 +1045,7 @@
%D The implementation of the definition macro is not that
%D complicated:
-\def\definetabletemplate % to be redone
+\unexpanded\def\definetabletemplate % to be redone
{\bgroup
\catcode`\|=\@@other
\doquadrupleempty\dodefinetabletemplate}
@@ -1208,8 +1214,9 @@
\newbox\tablecontentbox
-\def\starttables
+\unexpanded\def\starttables
{\bgroup
+ \let\stoptables\dostoptables
\splittablestrue
\doifelse\@@tisplit\v!repeat
{\settrue \tablerepeathead\settrue \tablerepeattail}
@@ -1220,23 +1227,17 @@
\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}
+\let\stoptables\relax % needed for \noalign
+
+\def\dostoptables
+ {\chuckTABLEautorow % AM: before the tail, else noalign problem
+ \ifconditional\tablerepeattail\else\insertTABLEtail\fi
+ \finishTABLE
+ \egroup
+ \dontcomplain
+ \dosplittablebox\tablecontentbox
+ \flushnotes
+ \egroup}
\newdimen\TABLEcaptionheight % obsolete
@@ -1296,11 +1297,11 @@
\letvalue{\e!stop \v!tabletail}=\undefined
\expanded
- {\def\csname\e!start\v!tablehead\endcsname##1\csname\e!stop\v!tablehead\endcsname%
+ {\long\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%
+ {\long\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
@@ -1312,8 +1313,8 @@
\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}}
+\long\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{\TABLEnoalign{\global\settrue\someTABLEhead}#3}}
+\long\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.
@@ -1454,7 +1455,7 @@
\global\TABLEgraydonefalse
\fi}
-\def\defineTABLEendings
+\unexpanded\def\defineTABLEendings
{\let\SR\TableSR
\let\FR\TableFR
\let\MR\TableMR
@@ -1694,13 +1695,13 @@
%D \sym{\type{\HC}} a horizontal colored line
%D \stopitemize
-% \def\defineTABLErules
+% \unexpanded\def\defineTABLErules
% {\let\VL\TableVL
% \let\VC\TableVC
% \let\HL\TableHL
% \let\HC\TableHC}
-\def\defineTABLErules
+\unexpanded\def\defineTABLErules
{\let\VL\TableVL
\let\VC\TableVC
\let\HL\TableHL
@@ -1865,7 +1866,7 @@
% n+1 uitleggen
-\def\defineTABLEsteps
+\unexpanded\def\defineTABLEsteps
{\let\NL\TableNL
\let\NR\TableNR
\let\NC\TableNC
@@ -1931,7 +1932,7 @@
\newif\ifTABLEdivision
-% \def\defineTABLEdivisions
+% \unexpanded\def\defineTABLEdivisions
% {\global\TABLEdivisionfalse % in start
% \let\DL\TableDL
% \let\DC\TableDC
@@ -1939,7 +1940,7 @@
% \let\VD\TableDV
% \let\DR\TableDR}
-\def\defineTABLEdivisions
+\unexpanded\def\defineTABLEdivisions
{\global\TABLEdivisionfalse % in start
\let\DL\TableDL
\let\DC\TableDC
@@ -2044,7 +2045,7 @@
% definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green])
% dus: \CL en \RL mix tussen \HL en \BL
-\def\defineTABLEbackgrounds
+\unexpanded\def\defineTABLEbackgrounds
{\let\BC \TableBC
\let\BL \TableBL
\let\BR \TableBR
@@ -2345,7 +2346,7 @@
\global\chardef\TABLEendofrowdepth \TABLErowfactor
\fi}
-\def\defineTABLEshorthands%
+\unexpanded\def\defineTABLEshorthands%
{\def\SPAN##1{\use{##1}}%
\def\TWO {\use2}%
\def\THREE {\use3}%
@@ -2354,7 +2355,7 @@
\def\SIX {\use6}%
\def\REF {\ReFormat}}
-\def\defineTABLEunits
+\unexpanded\def\defineTABLEunits
{\processaction
[\@@tidistance]
[ \v!none=>\OpenUp00\def\LOW{\Lower6 },
@@ -2376,7 +2377,7 @@
% De macro's t.b.v. instellingen.
-\def\setuptables
+\unexpanded\def\setuptables
{\dosingleargument\dosetuptables}
\def\dosetuptables[#1]%
@@ -2414,8 +2415,8 @@
\expanded{\switchtobodyfont[\@@tibodyfont]}%
% linecolor
\doifsomething\@@tirulecolor
- {\def\startglobalTABLEcolor{\startcolor[\@@tirulecolor]}%
- \def\stopglobalTABLEcolor {\stopcolor}}%
+ {\unexpanded\def\startglobalTABLEcolor{\startcolor[\@@tirulecolor]}%
+ \unexpanded\def\stopglobalTABLEcolor {\stopcolor}}%
% linethickness
\LineThicknessFactor4
\scratchdimen\@@tirulethickness
@@ -2423,10 +2424,10 @@
\expanded{\NormalTLTU{\the\scratchdimen}}%
% spacing, was depth=4 height=8 (counters, sigh, now macros)
\doifelse\@@tiheight\v!strut
- {\let\StrutHeightFactor\@@itheight}
+ {\let\StrutHeightFactor\strutheightfactor}
{\let\StrutHeightFactor\@@tiheight}%
\doifelse\@@tidepth\v!strut
- {\let\StrutDepthFactor\@@itdepth}
+ {\let\StrutDepthFactor\strutdepthfactor}
{\let\StrutDepthFactor\@@tidepth}%
\scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10%
\edef\StrutHeightFactor{\withoutpt\the\scratchdimen}%
diff --git a/Master/texmf-dist/tex/context/base/tabl-tbl.mkii b/Master/texmf-dist/tex/context/base/tabl-tbl.mkii
index 15e827e68b7..09fa4105c53 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tbl.mkii
+++ b/Master/texmf-dist/tex/context/base/tabl-tbl.mkii
@@ -1221,7 +1221,8 @@
\dotabulaterule
\ifnum\noftabulatelines>\plusone
\ifnum\noftabulatelines<\minusnoftabulatelines
- \vskip\topskip\allowbreak\vskip-\topskip
+ % \vskip \topskip\allowbreak \vskip-\topskip
+ \vskip1\topskip\allowbreak\vskip-1\topskip
\vskip-\tabulateparameter\c!rulethickness
\dotabulaterule
\fi
diff --git a/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv b/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
index bfff978ab70..400d8a659de 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-tbl.mkiv
@@ -15,6 +15,8 @@
% \processbetween gebruiken in head/tail macros
+% todo: \aligntab \alignmark (after 0.60 is out)
+
\unprotect
%D I can probably reimplement this using a \LUA||\TEX\ combination
@@ -173,6 +175,7 @@
\newif \ifframedtabulate
\newdimen \tabulatepwidth
+\newdimen \tabulatexwidth
\newdimen \tabulatewidth
\newdimen \tabulateunit
\newdimen \tabulatemaxpheight
@@ -316,6 +319,13 @@
\unexpanded\def\beforetabulateentry{\ignorespaces\tabulatehook}
\unexpanded\def\aftertabulateentry {\unskip\unskip\ifmmode\else\endgraf\fi}
+\unexpanded\def\beginreshapedtabulatepar
+ {\dowithnextbox
+ {\ctxlua{commands.doreshapeframedbox(\number\nextbox)}\ifvmode\unvbox\else\box\fi\nextbox}
+ \vbox\bgroup}
+
+\let\endreshapedtabulatepar\egroup
+
\def\dodosettabulatepreamble#1#2% only makes sense for many tabulates
{\normalexpanded{\!!toksa{\the\!!toksa
&\hskip\pretabskip\noexpand\pretabrule##&%
@@ -328,7 +338,7 @@
\noexpand\autotabulatetrue
\fi
\else
- \ifnum\tabulatemodus=\zeropoint
+ \ifnum\tabulatemodus=\zerocount
\hbox to
\else
\hsize
@@ -339,8 +349,11 @@
\noexpand\bbskip
\bgroup % we cannot combine the if because a cell may have only one ##
\noexpand#1%
+ \ifcase\tabulatereshape\else
+ \beginreshapedtabulatepar
+ \fi
\noexpand\ifnum\noexpand\tabulatetype=\plusone\noexpand\else
- \the\tabulatebmath
+ \the\tabulatebmath % maybe later?
\the\tabulatefont
\the\tabulatesettings
\the\tabulatebefore
@@ -356,6 +369,9 @@
\the\tabulateafter
\the\tabulateemath
\noexpand\fi
+ \ifcase\tabulatereshape\else
+ \endreshapedtabulatepar
+ \fi
\noexpand#2%
\egroup
\egroup
@@ -410,8 +426,8 @@
\def\gettabulatepreskip#1%
{\doifnumberelse{#1}
- {\edef\pretabskip{\the\dimenexpr#1\tabulateunit}\let\next\empty}
- {\edef\pretabskip{\the\dimenexpr.5\tabulateunit}\def\next{#1}}%
+ {\edef\pretabskip{\the\dimexpr#1\tabulateunit}\let\next\empty}
+ {\edef\pretabskip{\the\dimexpr.5\tabulateunit}\def\next{#1}}%
\@EA\settabulatepreamble\next}
\def\gettabulateposskip#1%
@@ -423,8 +439,8 @@
\def\gettabulatepreposskip#1%
{\doifnumberelse{#1}
- {\edef\pretabskip{\the\dimenexpr#1\tabulateunit}\let\next\empty}
- {\edef\pretabskip{\the\dimenexpr.5\tabulateunit}\def\next{#1}}%
+ {\edef\pretabskip{\the\dimexpr#1\tabulateunit}\let\next\empty}
+ {\edef\pretabskip{\the\dimexpr.5\tabulateunit}\def\next{#1}}%
\let\postabskip\pretabskip
\let\gettabulateexit\settabulatepreamble
\@EA\settabulatepreamble\next}
@@ -483,6 +499,8 @@
[ \v!fit=>\let\tabulatemodus\plusthree,
\v!fixed=>\let\tabulatemodus\plusthree
\tabulatenopbreaktrue,
+ \v!auto=>\let\tabulatemodus\plusthree
+ \let\tabulatereshape\plusone,
\s!unknown=>\tabulatewidth#1\relax]%
\ifnum\tabulatedimen=\plusone
\global\advance\tabulatepwidth\tabulatewidth
@@ -533,11 +551,12 @@
{\let\tabulatealign\@@tabulatealign
\let\tabulatemodus\zerocount
\let\tabulatedimen\zerocount
- \tabulatebefore \emptytoks
- \tabulateafter \emptytoks
- \tabulatebmath \emptytoks
- \tabulateemath \emptytoks
- \tabulatefont \emptytoks
+ \let\tabulatereshape\zerocount
+ \tabulatebefore\emptytoks
+ \tabulateafter\emptytoks
+ \tabulatebmath\emptytoks
+ \tabulateemath\emptytoks
+ \tabulatefont\emptytoks
\tabulatesettings\emptytoks
\global\advance\tabulatecolumns\plusone
\expandafter\let\csname\??tt:s:\the\tabulatecolumns\endcsname\donothing
@@ -947,7 +966,7 @@
%D When set to true, no (less) break optimization is done.
-\newif\iftolerantTABLEbreak
+\newif\iftolerantTABLEbreak % used in styles !
%D The main processing macro is large but splitting it up
%D would make things less clear.
@@ -1017,7 +1036,7 @@
\def\tabulatexeskipone{\par\egroup\egroup\glet\tabulatehook\dotabulatehook}
\def\tabulatebaselinecorrection
- {\def\dobaselinecorrection
+ {\def\dobaselinecorrection % todo: mkiv
{\vskip-\prevdepth
\vskip\strutdp
\vskip\strutdp}%
@@ -1042,26 +1061,31 @@
\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}}
+ \TABLEnoalign{\the\everyaftertabulaterow}%
+ \TABLEnoalign{\checktabulatepenaltiesa}}
+
+\def\checktabulatepenaltiesa
+ {\iftolerantTABLEbreak\else
+ \ifnum\totalnoftabulatelines=\plusone
+ % \allowbreak
+ \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
+ \fi
+ \global\tabulatefirstflushedfalse}
\def\tabulatebbskiptwo
{\ifvoid\tablebox\tabulatecolumn
@@ -1175,12 +1199,23 @@
\prevdepth\strutdp
\dotabulatenobreak}}
+% see ***
+%
+% \enabletrackers[nodes.page_vspacing]
+% \starttext
+% \starttabulate[||] \dorecurse{100}{\NC Eins \NC \NR \HL} \stoptabulate
+% \stoptext
+
\def\tabulateMLfive{\TABLEnoalign
{\dotabulateruleseperator
\dotabulaterule
\ifnum\noftabulatelines>\plusone
\ifnum\noftabulatelines<\minusnoftabulatelines
- \vskip\topskip\allowbreak\vskip-\topskip
+ % *** somehow topskip messes up as it's intercepted
+ % \vskip \topskip\allowbreak\vskip- \topskip
+ % messy anyhow so this needs to be improved, so for
+ % the momenet we keep this bugged variant
+ \vskip1\topskip\allowbreak\vskip-1\topskip
\vskip-\tabulateparameter\c!rulethickness
\dotabulaterule
\fi
@@ -1223,6 +1258,7 @@
\totalnoftabulatelines\noftabulatelines
\minusnoftabulatelines\noftabulatelines
\global\tabulatepwidth\zeropoint
+ \global\tabulatexwidth\zeropoint
\global\tabulateequalfalse
\resettabulatepheight
\ifinsidesplitfloat
@@ -1291,7 +1327,7 @@
\ifnum\nofautotabulate>\zerocount
% so, even if the natural size is larger, in the final
% run, we force the calculated width
- \tabulatewidth\dimexpr\hsize-\wd0-\tabulatepwidth\relax
+ \tabulatewidth\dimexpr\hsize-\wd0-\tabulatepwidth-\tabulatexwidth\relax
\ifnum\nofautotabulate>\zerocount
\divide\tabulatewidth \nofautotabulate\relax
\fi
@@ -1446,7 +1482,7 @@
% \NC \digits $@@@.@@1,@@$ \NC\NR
% \stoptabulatie
-\def\setuptabulate
+\unexpanded\def\setuptabulate
{\dotripleempty\dosetuptabulate}
\def\dosetuptabulate[#1][#2][#3]%
diff --git a/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv b/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
index 49bb7ad90ed..9ceb3af6e89 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
@@ -29,12 +29,14 @@
% \splitfloat [settings] {\placetable[optional args]{test}} {content}
-\definenumber
+% \def\s!noftablesplits{nofsplittables}
+
+\definenumber % we need a nicer name like nofsplittables, we then also need to set \s!parent
[\??si]
[\c!way=\v!by\v!text,
\c!conversion=\@@siconversion]
-\def\setupfloatsplitting
+\unexpanded\def\setupfloatsplitting
{\dodoubleargument\getparameters[\??si]}
\newif\ifinsidesplitfloat % will become chardef
diff --git a/Master/texmf-dist/tex/context/base/task-ini.lua b/Master/texmf-dist/tex/context/base/task-ini.lua
index 7ba20fa204a..aaa97ec4910 100644
--- a/Master/texmf-dist/tex/context/base/task-ini.lua
+++ b/Master/texmf-dist/tex/context/base/task-ini.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['task-ini'] = {
version = 1.001,
- comment = "companion to task-ini.tex",
+ 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"
@@ -8,44 +8,87 @@ if not modules then modules = { } end modules ['task-ini'] = {
-- 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 (*)
-tasks.appendaction("processors", "normalizers", "fonts.collections.process")
-tasks.appendaction("processors", "normalizers", "fonts.checkers.missing")
+tasks.appendaction("processors", "normalizers", "fonts.collections.process") -- todo
+tasks.appendaction("processors", "normalizers", "fonts.checkers.missing") -- disabled
-tasks.appendaction("processors", "characters", "chars.handle_mirroring")
-tasks.appendaction("processors", "characters", "chars.handle_casing")
-tasks.appendaction("processors", "characters", "chars.handle_breakpoints")
+tasks.appendaction("processors", "characters", "chars.handle_mirroring") -- disabled
+tasks.appendaction("processors", "characters", "chars.handle_casing") -- disabled
+tasks.appendaction("processors", "characters", "chars.handle_digits") -- disabled
+tasks.appendaction("processors", "characters", "chars.handle_breakpoints") -- disabled
tasks.appendaction("processors", "characters", "scripts.preprocess")
-tasks.appendaction("processors", "words", "kernel.hyphenation")
-tasks.appendaction("processors", "words", "languages.words.check")
+tasks.appendaction("processors", "words", "kernel.hyphenation") -- always on
+tasks.appendaction("processors", "words", "languages.words.check") -- disabled
-tasks.appendaction("processors", "fonts", "nodes.process_characters")
-tasks.appendaction("processors", "fonts", "nodes.inject_kerns")
-tasks.appendaction("processors", "fonts", "nodes.protect_glyphs", nil, "nohead")
-tasks.appendaction("processors", "fonts", "kernel.ligaturing")
-tasks.appendaction("processors", "fonts", "kernel.kerning")
+tasks.appendaction("processors", "fonts", "nodes.process_characters") -- maybe todo
+tasks.appendaction("processors", "fonts", "nodes.inject_kerns") -- maybe todo
+tasks.appendaction("processors", "fonts", "nodes.protect_glyphs", nil, "nohead") -- maybe todo
+tasks.appendaction("processors", "fonts", "kernel.ligaturing") -- always on
+tasks.appendaction("processors", "fonts", "kernel.kerning") -- always on
+tasks.appendaction("processors", "fonts", "nodes.stripping.process") -- disabled (might move)
-tasks.appendaction("processors", "lists", "lists.handle_spacing")
-tasks.appendaction("processors", "lists", "lists.handle_kerning")
+tasks.appendaction("processors", "lists", "lists.handle_spacing") -- disabled
+tasks.appendaction("processors", "lists", "lists.handle_kerning") -- disabled
-tasks.appendaction("shipouts", "normalizers", "nodes.cleanup_page")
-tasks.appendaction("shipouts", "normalizers", "nodes.add_references")
-tasks.appendaction("shipouts", "normalizers", "nodes.add_destinations")
+tasks.appendaction("shipouts", "normalizers", "nodes.cleanup_page") -- maybe todo
+tasks.appendaction("shipouts", "normalizers", "nodes.add_references") -- disabled
+tasks.appendaction("shipouts", "normalizers", "nodes.add_destinations") -- disabled
+tasks.appendaction("shipouts", "normalizers", "nodes.rules.process") -- disabled
+tasks.appendaction("shipouts", "normalizers", "nodes.shifts.process") -- disabled
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_color")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_transparency")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_overprint")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect")
-tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer")
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_color") -- disabled
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_transparency") -- disabled
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_colorintent") -- disabled
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative") -- disabled
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect") -- disabled
+tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer") -- disabled
-tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead")
-tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead")
-tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead")
+tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead") -- always on
+tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead") -- always on
+tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead") -- always on
-tasks.appendaction("math", "builders", "noads.mlist_to_hlist")
+tasks.appendaction("math", "builders", "noads.mlist_to_hlist") -- always on
-- quite experimental
-tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust")
+tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust") -- todo
+
+-- rather new
+
+tasks.appendaction("mvlbuilders", "normalizers", "nodes.migrate_outwards")
+tasks.appendaction("mvlbuilders", "normalizers", "nodes.handle_page_spacing") -- last !
+
+tasks.appendaction("vboxbuilders", "normalizers", "nodes.handle_vbox_spacing")
+
+-- speedup: only kick in when used
+
+tasks.disableaction("processors", "fonts.checkers.missing")
+tasks.disableaction("processors", "chars.handle_breakpoints")
+tasks.disableaction("processors", "chars.handle_casing")
+tasks.disableaction("processors", "chars.handle_digits")
+tasks.disableaction("processors", "chars.handle_mirroring")
+tasks.disableaction("processors", "languages.words.check")
+tasks.disableaction("processors", "lists.handle_spacing")
+tasks.disableaction("processors", "lists.handle_kerning")
+tasks.disableaction("processors", "nodes.stripping.process")
+
+tasks.disableaction("shipouts", "nodes.rules.process")
+tasks.disableaction("shipouts", "nodes.shifts.process")
+tasks.disableaction("shipouts", "shipouts.handle_color")
+tasks.disableaction("shipouts", "shipouts.handle_transparency")
+tasks.disableaction("shipouts", "shipouts.handle_colorintent")
+tasks.disableaction("shipouts", "shipouts.handle_effect")
+tasks.disableaction("shipouts", "shipouts.handle_negative")
+tasks.disableaction("shipouts", "shipouts.handle_viewerlayer")
+
+tasks.disableaction("shipouts", "nodes.add_references")
+tasks.disableaction("shipouts", "nodes.add_destinations")
+
+tasks.disableaction("mvlbuilders", "nodes.migrate_outwards")
+
+callbacks.freeze("find_.*_file", "find file using resolver")
+callbacks.freeze("read_.*_file", "read file at once")
+callbacks.freeze("open_.*_file", "open file for reading")
diff --git a/Master/texmf-dist/tex/context/base/toks-ini.lua b/Master/texmf-dist/tex/context/base/toks-ini.lua
index 1313b04a238..ec60402d857 100644
--- a/Master/texmf-dist/tex/context/base/toks-ini.lua
+++ b/Master/texmf-dist/tex/context/base/toks-ini.lua
@@ -56,7 +56,7 @@ collectors.data = collectors.data or { }
function tex.printlist(data)
callbacks.push('token_filter', function ()
- callbacks.pop('token_filter')
+ callbacks.pop('token_filter') -- tricky but the nil assignment helps
return data
end)
end
@@ -142,7 +142,7 @@ commands.other = token.command_id("other_char")
function collectors.default_words(t,str)
t[#t+1] = tokens.bgroup
t[#t+1] = token.create("red")
- for k,v in ipairs(str) do
+ for i=1,#str do
t[#t+1] = tokens.other('*')
end
t[#t+1] = tokens.egroup
@@ -151,7 +151,9 @@ end
function collectors.with_words(tag,handle)
local t, w = { }, { }
handle = handle or collectors.default_words
- for _,v in ipairs(collectors.data[tag]) do
+ local tagdata = collectors.data[tag]
+ for k=1,#tagdata do
+ local v = tagdata[k]
if v[1] == commands.letter then
w[#w+1] = v[2]
else
@@ -201,7 +203,7 @@ collectors.show_methods.a = function(data) -- no need to store the table, just p
texsprint(ctxcatcodes, "\\starttabulate[|T|Tr|cT|Tr|T|]")
texsprint(ctxcatcodes, format(template,"cmd","chr","","id","name"))
texsprint(ctxcatcodes, "\\HL")
- for _,v in pairs(data) do
+ for _,v in next, data do
local cmd, chr, id, cs, sym = v[1], v[2], v[3], "", ""
local name = gsub(token.command_name(v) or "","_","\\_")
if id > 0 then
@@ -231,7 +233,7 @@ collectors.show_methods.b_c = function(data,swap) -- no need to store the table,
end
texsprint(ctxcatcodes, format(template,"cmd","chr","name"))
texsprint(ctxcatcodes, "\\HL")
- for _,v in pairs(data) do
+ for _,v in next, data do
local cmd, chr, id, cs, sym = v[1], v[2], v[3], "", ""
local name = gsub(token.command_name(v) or "","_","\\_")
if id > 0 then
diff --git a/Master/texmf-dist/tex/context/base/toks-ini.mkiv b/Master/texmf-dist/tex/context/base/toks-ini.mkiv
index 932c05f32e3..22deca745dd 100644
--- a/Master/texmf-dist/tex/context/base/toks-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/toks-ini.mkiv
@@ -19,7 +19,7 @@
%D Handy for manuals \unknown
-\def\starttokens [#1]{\ctxlua{collectors.install("#1", "stoptokens")}}
+\unexpanded\def\starttokens [#1]{\ctxlua{collectors.install("#1", "stoptokens")}}
\let\stoptokens \relax
\def\flushtokens [#1]{\ctxlua{collectors.flush("#1")}}
\def\showtokens [#1]{\ctxlua{collectors.show("#1")}}
@@ -62,7 +62,7 @@
\def\remaptokens#1%
{\ctxlua{collectors.handle("#1",function(str) return collectors.remapper.convert("#1",str) end)}}
-\def\defineremapper[#1]%
+\unexpanded\def\defineremapper[#1]%
{\setvalue{\e!start#1}{\dostartremapper{#1}}%
\setvalue{\e!stop #1}{\dostopremapper {#1}}%
\def\next##1{\setvalue{#1}####1{\getvalue{\e!start#1}####1##1}}%
diff --git a/Master/texmf-dist/tex/context/base/trac-deb.lua b/Master/texmf-dist/tex/context/base/trac-deb.lua
index f476169c395..97753f3e921 100644
--- a/Master/texmf-dist/tex/context/base/trac-deb.lua
+++ b/Master/texmf-dist/tex/context/base/trac-deb.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['trac-deb'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ comment = "companion to trac-deb.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -9,19 +9,6 @@ if not modules then modules = { } end modules ['trac-deb'] = {
if not lmx then lmx = { } end
if not lmx.variables then lmx.variables = { } end
-lmx.variables['color-background-green'] = '#4F6F6F'
-lmx.variables['color-background-blue'] = '#6F6F8F'
-lmx.variables['color-background-yellow'] = '#8F8F6F'
-lmx.variables['color-background-purple'] = '#8F6F8F'
-
-lmx.variables['color-background-body'] = '#808080'
-lmx.variables['color-background-main'] = '#3F3F3F'
-lmx.variables['color-background-one'] = lmx.variables['color-background-green']
-lmx.variables['color-background-two'] = lmx.variables['color-background-blue']
-
-lmx.variables['title-default'] = 'ConTeXt Status Information'
-lmx.variables['title'] = lmx.variables['title-default']
-
lmx.htmfile = function(name) return environment.jobname .. "-status.html" end
lmx.lmxfile = function(name) return resolvers.find_file(name,'tex') end
@@ -31,8 +18,11 @@ if not tracers.strings then tracers.strings = { } end
tracers.strings.undefined = "undefined"
+local splitter = lpeg.splitat(":")
+local lpegmatch = lpeg.match
+
function tracers.split(csname)
- return csname:match("^(.+):(.+)$")
+ return lpegmatch(splitter,csname)
end
function tracers.type(csname)
@@ -82,30 +72,30 @@ function tracers.knownlist(name)
end
function tracers.showdebuginfo()
- lmx.set('title', 'ConTeXt Debug Information')
- lmx.set('color-background-one', lmx.get('color-background-green'))
- lmx.set('color-background-two', lmx.get('color-background-blue'))
- lmx.show('context-debug.lmx')
- lmx.restore()
+ local variables = {
+ ['title'] = 'ConTeXt Debug Information',
+ ['color-background-one'] = lmx.get('color-background-green'),
+ ['color-background-two'] = lmx.get('color-background-blue'),
+ }
+ lmx.show('context-debug.lmx',variables)
end
function tracers.showerror()
- lmx.set('title', 'ConTeXt Error Information')
- lmx.set('errormessage', status.lasterrorstring)
- lmx.set('linenumber', status.linenumber)
- lmx.set('color-background-one', lmx.get('color-background-yellow'))
- lmx.set('color-background-two', lmx.get('color-background-purple'))
local filename = status.filename
local linenumber = tonumber(status.linenumber or "0")
+ local variables = {
+ ['title'] = 'ConTeXt Error Information',
+ ['errormessage'] = status.lasterrorstring,
+ ['linenumber'] = status.linenumber,
+ ['color-background-one'] = lmx.get('color-background-yellow'),
+ ['color-background-two'] = lmx.get('color-background-purple'),
+ }
if not filename then
- lmx.set('filename', 'unknown')
- lmx.set('errorcontext', 'error in filename')
+ variables.filename, variables.errorcontext = 'unknown', 'error in filename'
elseif type(filename) == "number" then
- lmx.set('filename', "<read " .. filename .. ">")
- lmx.set('errorcontext', 'unknown error')
+ variables.filename, variables.errorcontext = "<read " .. filename .. ">", 'unknown error'
elseif io.exists(filename) then
-- todo: use an input opener so that we also catch utf16 an reencoding
- lmx.set('filename', filename)
lines = io.lines(filename)
if lines then
local context = { }
@@ -124,16 +114,14 @@ function tracers.showerror()
end
n = n + 1
end
- lmx.set('errorcontext', table.concat(context,"\n"))
+ variables.filename, variables.errorcontext = filename, table.concat(context,"\n")
else
- lmx.set('errorcontext', "")
+ variables.filename, variables.errorcontext = filename, ""
end
else
- lmx.set('filename', filename)
- lmx.set('errorcontext', 'file not found')
+ variables.filename, variables.errorcontext = filename, 'file not found'
end
- lmx.show('context-error.lmx')
- lmx.restore()
+ lmx.show('context-error.lmx',variables)
end
function tracers.overloaderror()
@@ -171,7 +159,7 @@ function tracers.dump_hash(filename,delta)
local list = { }
local hash = tex.hashtokens()
local command_name = token.command_name
- for name, token in pairs(hash) do
+ for name, token in next, hash do
if not delta or not saved[name] then
-- token: cmd, chr, csid -- combination cmd,chr determines name
local kind = command_name(token)
@@ -195,12 +183,5 @@ function tracers.register_dump_hash(delta)
main.register_stop_actions(1,function() tracers.dump_hash(nil,true) end) -- at front
end
--- trackers (maybe group the show by class)
-
-function trackers.show()
- commands.writestatus("","")
- for k,v in ipairs(trackers.list()) do
- commands.writestatus("tracker",v)
- end
- commands.writestatus("","")
-end
+directives.register("system.dumphash", function() tracers.register_dump_hash(false) end)
+directives.register("system.dumpdelta", function() tracers.register_dump_hash(true ) end)
diff --git a/Master/texmf-dist/tex/context/base/trac-deb.mkiv b/Master/texmf-dist/tex/context/base/trac-deb.mkiv
index 870c452adf7..b004cdeb495 100644
--- a/Master/texmf-dist/tex/context/base/trac-deb.mkiv
+++ b/Master/texmf-dist/tex/context/base/trac-deb.mkiv
@@ -37,7 +37,15 @@
}%
\to \everybye
-\def\showtrackers {\ctxlua{trackers.show()}}
-\def\resettrackers {\ctxlua{trackers.reset()}}
-\def\enabletrackers [#1]{\ctxlua{trackers.enable("#1")}}
-\def\disabletrackers[#1]{\ctxlua{trackers.disable("#1")}}
+\def\showtrackers {\ctxlua{trackers.show()}}
+\def\enabletrackers [#1]{\ctxlua{trackers.enable("#1")}}
+\def\disabletrackers [#1]{\ctxlua{trackers.disable("#1")}}
+\def\resettrackers {\ctxlua{trackers.reset()}}
+
+\def\showdirectives {\ctxlua{directives.show()}}
+\def\enabledirectives [#1]{\ctxlua{directives.enable("#1")}}
+\def\disabledirectives [#1]{\ctxlua{directives.disable("#1")}}
+
+\def\showexperiments {\ctxlua{experiments.show()}}
+\def\enableexperiments [#1]{\ctxlua{experiments.enable("#1")}}
+\def\disableexperiments[#1]{\ctxlua{experiments.disable("#1")}}
diff --git a/Master/texmf-dist/tex/context/base/trac-inf.lua b/Master/texmf-dist/tex/context/base/trac-inf.lua
index 3dfaf71192b..72f03675a1c 100644
--- a/Master/texmf-dist/tex/context/base/trac-inf.lua
+++ b/Master/texmf-dist/tex/context/base/trac-inf.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['trac-inf'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ comment = "companion to trac-inf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -25,6 +25,14 @@ function statistics.hastimer(instance)
return instance and instance.starttime
end
+function statistics.resettiming(instance)
+ if not instance then
+ notimer = { timing = 0, loadtime = 0 }
+ else
+ instance.timing, instance.loadtime = 0, 0
+ end
+end
+
function statistics.starttiming(instance)
if not instance then
notimer = { }
@@ -39,6 +47,8 @@ function statistics.starttiming(instance)
if not instance.loadtime then
instance.loadtime = 0
end
+ else
+--~ logs.report("system","nested timing (%s)",tostring(instance))
end
instance.timing = it + 1
end
@@ -84,6 +94,12 @@ function statistics.elapsedindeed(instance)
return t > statistics.threshold
end
+function statistics.elapsedseconds(instance,rest) -- returns nil if 0 seconds
+ if statistics.elapsedindeed(instance) then
+ return format("%s seconds %s", statistics.elapsedtime(instance),rest or "")
+ end
+end
+
-- general function
function statistics.register(tag,fnc)
@@ -161,3 +177,21 @@ function statistics.timed(action,report)
statistics.stoptiming(timer)
report("total runtime: %s",statistics.elapsedtime(timer))
end
+
+-- where, not really the best spot for this:
+
+commands = commands or { }
+
+local timer
+
+function commands.resettimer()
+ statistics.resettiming(timer)
+ statistics.starttiming(timer)
+end
+
+function commands.elapsedtime()
+ statistics.stoptiming(timer)
+ tex.sprint(statistics.elapsedtime(timer))
+end
+
+commands.resettimer()
diff --git a/Master/texmf-dist/tex/context/base/trac-lmx.lua b/Master/texmf-dist/tex/context/base/trac-lmx.lua
index 07f5ae291c0..664815c6618 100644
--- a/Master/texmf-dist/tex/context/base/trac-lmx.lua
+++ b/Master/texmf-dist/tex/context/base/trac-lmx.lua
@@ -1,72 +1,129 @@
if not modules then modules = { } end modules ['trac-lmx'] = {
- version = 1.001,
- comment = "companion to luat-lib.tex",
+ version = 1.002,
+ comment = "companion to trac-lmx.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-local gsub, format, concat = string.gsub, string.format, table.concat
+-- todo: use lpeg instead (although not really needed)
--- we can now use l-xml, and we can also use lpeg
+local gsub, format, concat, byte = string.gsub, string.format, table.concat, string.byte
lmx = lmx or { }
-lmx.escapes = {
+local escapes = {
['&'] = '&amp;',
['<'] = '&lt;',
['>'] = '&gt;',
['"'] = '&quot;'
}
--- local function p -> ends up in lmx.p, so we need to cast
-
-lmx.variables = { }
-
-lmx.variables['title-default'] = 'LMX File'
-lmx.variables['title'] = lmx.variables['title-default']
-
--- demonstrates: local, *all, gsub using tables, nil or value, loadstring
-
-function lmx.loadedfile(filename)
- return io.loaddata(resolvers.find_file(filename))
-end
-
-lmx.converting = false
-
-local templates = { }
-
-function lmx.convert(template,result) -- todo: use lpeg instead
- if not lmx.converting then -- else, if error then again tex error and loop
- local data = templates[template]
- if not data then
- data = lmx.loadedfile(template)
- templates[template] = data
- end
- local text = { }
- function lmx.print(...)
- text[#text+1] = concat({...})
- end
- function lmx.variable(str)
- return lmx.variables[str] or ""
- end
- function lmx.escape(str)
- str = tostring(str)
- str = gsub(str,'&','&amp;')
- str = gsub(str,'[<>"]',lmx.escapes)
- return str
- end
- function lmx.type(str)
- if str then lmx.print("<tt>" .. lmx.escape(str) .. "</tt>") end
- end
- function lmx.pv(str)
- lmx.print(lmx.variable(str))
- end
- function lmx.tv(str)
- lmx.type(lmx.variable(str))
- end
+-- variables
+
+lmx.variables = { } -- global, shared
+
+local lmxvariables = lmx.variables
+
+lmxvariables['title-default'] = 'ConTeXt LMX File'
+lmxvariables['title'] = lmx.variables['title-default']
+lmxvariables['color-background-green'] = '#4F6F6F'
+lmxvariables['color-background-blue'] = '#6F6F8F'
+lmxvariables['color-background-yellow'] = '#8F8F6F'
+lmxvariables['color-background-purple'] = '#8F6F8F'
+lmxvariables['color-background-body'] = '#808080'
+lmxvariables['color-background-main'] = '#3F3F3F'
+lmxvariables['color-background-one'] = lmxvariables['color-background-green']
+lmxvariables['color-background-two'] = lmxvariables['color-background-blue']
+
+function lmx.set(key, value)
+ lmxvariables[key] = value
+end
+
+function lmx.get(key)
+ return lmxvariables[key] or ""
+end
+
+-- helpers
+
+local variables, result = { } -- we assume no nesting
+
+local function do_print(one,two,...)
+ if two then
+ result[#result+1] = concat { one, two, ... }
+ else
+ result[#result+1] = one
+ end
+end
+
+local function do_escape(str)
+ str = tostring(str)
+ str = gsub(str,'&','&amp;')
+ str = gsub(str,'[<>"]',escapes)
+ return str
+end
+
+local function do_urlescaped(str)
+ return (gsub(str,"[^%a%d]",format("%%0x",byte("%1"))))
+end
+
+function do_type(str)
+ if str then do_print("<tt>" .. do_escape(str) .. "</tt>") end
+end
+
+local function do_variable(str)
+ return variables[str] or lmxvariables[str] -- or format("<!-- unset lmx instance variable: %s -->",str or "?")
+end
+
+function lmx.loadedfile(name)
+ name = (resolvers and resolvers.find_file and resolvers.find_file(name)) or name
+ return io.loaddata(name)
+end
+
+local function do_include(filename)
+ local stylepath = do_variable('includepath')
+ local data = lmx.loadedfile(filename)
+ if (not data or data == "") and stylepath ~= "" then
+ data = lmx.loadedfile(file.join(stylepath,filename))
+ end
+ if not data or data == "" then
+ data = format("<!-- unknown lmx include file: %s -->",filename)
+ end
+ return data
+end
+
+lmx.print = do_print
+lmx.type = do_type
+lmx.escape = do_escape
+lmx.urlescape = do_escape
+lmx.variable = do_variable
+lmx.include = do_include
+
+function lmx.pv(str)
+ do_print(do_variable(str) or "")
+end
+
+function lmx.tv(str)
+ lmx.type(do_variable(str) or "")
+end
+
+local template = [[
+ local definitions = { }
+ local p, v, e, t, pv, tv = lmx.print, lmx.variable, lmx.escape, lmx.type, lmx.pv, lmx.tv
+ %s
+]]
+
+local cache = { }
+
+local trace = false
+
+function lmx.new(data,variables)
+ data = data or ""
+ local known = cache[data]
+ if not known then
+ local definitions = { }
data = gsub(data,"<%?lmx%-include%s+(.-)%s-%?>", function(filename)
- return lmx.loadedfile(filename)
+ return lmx.include(filename)
end)
local definitions = { }
data = gsub(data,"<%?lmx%-define%-begin%s+(%S-)%s-%?>(.-)<%?lmx%-define%-end%s-%?>", function(tag,content)
@@ -76,78 +133,86 @@ function lmx.convert(template,result) -- todo: use lpeg instead
data = gsub(data,"<%?lmx%-resolve%s+(%S-)%s-%?>", function(tag)
return definitions[tag] or ""
end)
- data = gsub(data,"%c%s-(<%?lua .-%?>)%s-%c", function(lua)
- return "\n" .. lua .. " "
- end)
- data = gsub(data .. "<?lua ?>","(.-)<%?lua%s+(.-)%?>", function(txt, lua)
- txt = gsub(txt,"%c+", "\\n")
- txt = gsub(txt,'"' , '\\"')
- txt = gsub(txt,"'" , "\\'")
- -- txt = gsub(txt,"([\'\"])", { ["'"] = '\\"', ['"'] = "\\'" } )
- return "p(\"" .. txt .. "\")\n" .. lua .. "\n"
+ data = gsub(data .. "<?lua ?>","(.-)<%?lua%s+(.-)%s*%?>", function(txt,lua)
+ txt = gsub(txt,"%c+","\n")
+ return format("p(%q)%s ",txt,lua) -- nb! space
end)
- lmx.converting = true
- data = "local p,v,e,t,pv,tv = lmx.print,lmx.variable,lmx.escape,lmx.type,lmx.pv,lmx.tv " .. data
- assert(loadstring(data))()
- lmx.converting = false
- text = concat(text)
- if result then
- io.savedata(result,text)
- else
- return text
- end
+ data = format(template,data)
+ known = {
+ data = trace and data,
+ variables = variables or { },
+ converter = loadstring(data),
+ }
+ elseif variables then
+ known.variables = variables
+ end
+ return known, known.variables
+end
+
+function lmx.reset(self)
+ self.variables = { }
+end
+
+function lmx.result(self)
+ if trace then
+ return self.data
+ else
+ variables, result = self.variables, { }
+ self.converter()
+ return concat(result)
+ end
+end
+
+-- file converter
+
+local loaded = { }
+
+function lmx.convert(templatefile,resultfile,variables)
+ local data = loaded[templatefile]
+ if not data then
+ data = lmx.new(lmx.loadedfile(templatefile),variables)
+ loaded[template] = data
+ elseif variables then
+ data.variables = variables
+ end
+ local result = lmx.result(data)
+ if resultfile then
+ io.savedata(resultfile,result)
+ else
+ return lmx.result(data,result)
end
end
-- these can be overloaded; we assume that the os handles filename associations
-lmx.lmxfile = function(filename) return filename end
-lmx.htmfile = function(filename) return filename end
+lmx.lmxfile = function(filename) return filename end -- beware, these can be set!
+lmx.htmfile = function(filename) return filename end -- beware, these can be set!
-if os.platform == "windows" then
+if os.type == "windows" then
lmx.popupfile = function(filename) os.execute("start " .. filename) end
else
lmx.popupfile = function(filename) os.execute(filename) end
end
-function lmx.make(name)
+function lmx.make(name,variables)
local lmxfile = lmx.lmxfile(name)
local htmfile = lmx.htmfile(name)
if lmxfile == htmfile then
htmfile = gsub(lmxfile, "%.%a+$", "html")
end
- lmx.convert(lmxfile, htmfile)
+ lmx.convert(lmxfile,htmfile,variables)
return htmfile
end
-function lmx.show(name)
- local htmfile = lmx.make(name)
+function lmx.show(name,variables)
+ local htmfile = lmx.make(name,variables)
lmx.popupfile(htmfile)
return htmfile
end
--- kind of private
-
-lmx.restorables = { }
-
-function lmx.set(key, value)
- if not lmx.restorables[key] then
- table.insert(lmx.restorables, key)
- lmx.variables['@@' .. key] = lmx.variables[key]
- end
- lmx.variables[key] = value
-end
-
-function lmx.get(key)
- return lmx.variables[key] or ""
-end
+-- test
-function lmx.restore()
- for _,key in pairs(lmx.restorables) do
- lmx.variables[key] = lmx.variables['@@' .. key]
- end
- lmx.restorables = { }
-end
+--~ print(lmx.result(lmx.new(io.loaddata("t:/sources/context-timing.lmx"))))
-- command line
diff --git a/Master/texmf-dist/tex/context/base/trac-log.lua b/Master/texmf-dist/tex/context/base/trac-log.lua
index d05bc9fec9c..0d4a1b0a9f1 100644
--- a/Master/texmf-dist/tex/context/base/trac-log.lua
+++ b/Master/texmf-dist/tex/context/base/trac-log.lua
@@ -1,6 +1,6 @@
-if not modules then modules = { } end modules ['luat-log'] = {
+if not modules then modules = { } end modules ['trac-log'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ comment = "companion to trac-log.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -8,7 +8,11 @@ if not modules then modules = { } end modules ['luat-log'] = {
-- this is old code that needs an overhaul
-local write_nl, write, format = texio.write_nl or print, texio.write or io.write, string.format
+--~ io.stdout:setvbuf("no")
+--~ io.stderr:setvbuf("no")
+
+local write_nl, write = texio.write_nl or print, texio.write or io.write
+local format, gmatch = string.format, string.gmatch
local texcount = tex and tex.count
if texlua then
@@ -89,25 +93,48 @@ function logs.tex.line(fmt,...) -- new
end
end
+--~ function logs.tex.start_page_number()
+--~ local real, user, sub = texcount.realpageno, texcount.userpageno, texcount.subpageno
+--~ if real > 0 then
+--~ if user > 0 then
+--~ if sub > 0 then
+--~ write(format("[%s.%s.%s",real,user,sub))
+--~ else
+--~ write(format("[%s.%s",real,user))
+--~ end
+--~ else
+--~ write(format("[%s",real))
+--~ end
+--~ else
+--~ write("[-")
+--~ end
+--~ end
+
+--~ function logs.tex.stop_page_number()
+--~ write("]")
+--~ end
+
+local real, user, sub
+
function logs.tex.start_page_number()
- local real, user, sub = texcount.realpageno, texcount.userpageno, texcount.subpageno
+ real, user, sub = texcount.realpageno, texcount.userpageno, texcount.subpageno
+end
+
+function logs.tex.stop_page_number()
if real > 0 then
if user > 0 then
if sub > 0 then
- write(format("[%s.%s.%s",real,user,sub))
+ logs.report("pages", "flushing realpage %s, userpage %s, subpage %s",real,user,sub)
else
- write(format("[%s.%s",real,user))
+ logs.report("pages", "flushing realpage %s, userpage %s",real,user)
end
else
- write(format("[%s",real))
+ logs.report("pages", "flushing realpage %s",real)
end
else
- write("[-")
+ logs.report("pages", "flushing page")
end
-end
-
-function logs.tex.stop_page_number()
- write("]")
+ io.flush()
end
logs.tex.report_job_stat = statistics.show_job_stat
@@ -207,7 +234,7 @@ end
function logs.setprogram(_name_,_banner_,_verbose_)
name, banner = _name_, _banner_
if _verbose_ then
- trackers.enable("resolvers.verbose")
+ trackers.enable("resolvers.locating")
end
logs.set_method("tex")
logs.report = report -- also used in libraries
@@ -220,9 +247,9 @@ end
function logs.setverbose(what)
if what then
- trackers.enable("resolvers.verbose")
+ trackers.enable("resolvers.locating")
else
- trackers.disable("resolvers.verbose")
+ trackers.disable("resolvers.locating")
end
logs.verbose = what or false
end
@@ -239,7 +266,7 @@ logs.report = logs.tex.report
logs.simple = logs.tex.report
function logs.reportlines(str) -- todo: <lines></lines>
- for line in str:gmatch("(.-)[\n\r]") do
+ for line in gmatch(str,"(.-)[\n\r]") do
logs.report(line)
end
end
@@ -250,8 +277,12 @@ end
logs.simpleline = logs.reportline
-function logs.help(message,option)
+function logs.reportbanner() -- for scripts too
logs.report(banner)
+end
+
+function logs.help(message,option)
+ logs.reportbanner()
logs.reportline()
logs.reportlines(message)
local moreinfo = logs.moreinfo or ""
@@ -282,3 +313,8 @@ end
--~ for i=1,10 do
--~ logs.system(syslogname,"context","test","fonts","font %s recached due to newer version (%s)","blabla","123")
--~ end
+
+function logs.fatal(where,...)
+ logs.report(where,"fatal error: %s, aborting now",format(...))
+ os.exit()
+end
diff --git a/Master/texmf-dist/tex/context/base/trac-tex.mkiv b/Master/texmf-dist/tex/context/base/trac-tex.mkiv
index 8443541600f..9c596feabc3 100644
--- a/Master/texmf-dist/tex/context/base/trac-tex.mkiv
+++ b/Master/texmf-dist/tex/context/base/trac-tex.mkiv
@@ -33,4 +33,23 @@
\def\doenabletextracer #1{\csname enabletracer#1\endcsname}
\def\dodisabletextracer#1{\csname disabletracer#1\endcsname}
+% context --directives=system.nostatistics ...
+
+\def\nomkivstatistics{\ctxlua{statistics.enable = false}} % for taco
+
+\def\tracersdumphash {\ctxlua{tracers.register_dump_hash(false)}}
+\def\tracersdumpdelta{\ctxlua{tracers.register_dump_hash(true)}}
+
+% wrong place:
+
+\def\traceluausage
+ {\dosingleempty\dotraceluausage}
+
+\def\dotraceluausage[#1]%
+ {\ctxlua{debugger.enable()}%
+ \appendtoks
+ \ctxlua{debugger.disable() debugger.showstats(print,\doifnumberelse{#1}{#1}{5000})}^
+ \to \everybye
+ \gdef\dotraceluausage[#1]{}}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/trac-tim.lua b/Master/texmf-dist/tex/context/base/trac-tim.lua
index 82c03f4c7a2..a8725bb5c11 100644
--- a/Master/texmf-dist/tex/context/base/trac-tim.lua
+++ b/Master/texmf-dist/tex/context/base/trac-tim.lua
@@ -6,10 +6,14 @@ if not modules then modules = { } end modules ['trac-tim'] = {
license = "see context related readme files"
}
-goodies = goodies or { }
-goodies.progress = goodies.progress or { }
+local format, gsub = string.format, string.gsub
+local concat, sort = table.concat, table.sort
+local next, tonumber = next, tonumber
-local progress = goodies.progress
+plugins = plugins or { }
+plugins.progress = plugins.progress or { }
+
+local progress = plugins.progress
progress = progress or { }
@@ -26,7 +30,7 @@ local params = {
"pdf_mem_ptr",
"pdf_mem_size",
"pdf_os_cntr",
- "pool_ptr",
+-- "pool_ptr", -- obsolete
"str_ptr",
}
@@ -36,12 +40,8 @@ local last = os.clock()
local data = { }
function progress.save()
- local f = io.open((name or progress.defaultfilename) .. ".lut","w")
- if f then
- f:write(table.serialize(data,true))
- f:close()
- data = { }
- end
+ io.savedata((name or progress.defaultfilename) .. ".lut",table.serialize(data,true))
+ data = { }
end
function progress.store()
@@ -50,7 +50,7 @@ function progress.store()
elapsed_time = c - last,
node_memory = nodes.usage(),
}
- for k, v in pairs(params) do
+ for k, v in next, params do
if status[v] then t[v] = status[v] end
end
data[#data+1] = t
@@ -61,32 +61,7 @@ end
local processed = { }
-function progress.bot(name,tag)
- local d = progress.convert(name)
- return d.bot[tag] or 0
-end
-function progress.top(name,tag)
- local d = progress.convert(name)
- return d.top[tag] or 0
-end
-function progress.pages(name,tag)
- local d = progress.convert(name)
- return d.pages or 0
-end
-function progress.path(name,tag)
- local d = progress.convert(name)
- return d.paths[tag] or "origin"
-end
-function progress.nodes(name)
- local d = progress.convert(name)
- return d.names or { }
-end
-function progress.parameters(name)
- local d = progress.convert(name)
- return params -- shared
-end
-
-function progress.convert(name)
+local function convert(name)
name = ((name ~= "") and name) or progress.defaultfilename
if not processed[name] then
local names, top, bot, pages, paths, keys = { }, { }, { }, 0, { }, { }
@@ -97,21 +72,22 @@ function progress.convert(name)
pages = #data
if pages > 1 then
local factor = 100
- for k,v in ipairs(data) do
- for k,v in pairs(v.node_memory) do
+ for k=1,#data do
+ for k, v in next, data[k].node_memory do
keys[k] = true
end
end
- for k,v in ipairs(data) do
- local m = v.node_memory
- for k, _ in pairs(keys) do
+ for k=1,#data do
+ local m = data[k].node_memory
+ for k, v in next, keys do
if not m[k] then m[k] = 0 end
end
end
local function path(tag,subtag)
local b, t, s = nil, nil, { }
- for k,v in ipairs(data) do
- local v = (subtag and v[tag][subtag]) or v[tag]
+ for k=1,#data do
+ local v = data[k][tag]
+ v = v and (subtag and v[subtag]) or v
if v then
v = tonumber(v)
if b then
@@ -127,30 +103,30 @@ function progress.convert(name)
end
end
local tagname = subtag or tag
- top[tagname] = (string.format("%.3f",t)):gsub("%.000$","")
- bot[tagname] = (string.format("%.3f",b)):gsub("%.000$","")
+ top[tagname] = gsub(format("%.3f",t),"%.000$","")
+ bot[tagname] = gsub(format("%.3f",b),"%.000$","")
local delta = t-b
if delta == 0 then
delta = 1
else
delta = factor/delta
end
- for k, v in ipairs(s) do
- s[k] = "(" .. k .. "," .. (v-b)*delta .. ")"
+ for k=1,#s do
+ s[k] = "(" .. k .. "," .. (s[k]-b)*delta .. ")"
end
- paths[tagname] = table.concat(s,"--")
+ paths[tagname] = concat(s,"--")
end
- for _, tag in pairs(params) do
+ for _, tag in next, params do
path(tag)
end
- for tag, _ in pairs(keys) do
+ for tag, _ in next, keys do
path("node_memory",tag)
names[#names+1] = tag
end
pages = pages - 1
end
end
- table.sort(names)
+ sort(names)
processed[name] = {
names = names,
top = top,
@@ -161,3 +137,24 @@ function progress.convert(name)
end
return processed[name]
end
+
+progress.convert = convert
+
+function progress.bot(name,tag)
+ return convert(name).bot[tag] or 0
+end
+function progress.top(name,tag)
+ return convert(name).top[tag] or 0
+end
+function progress.pages(name,tag)
+ return convert(name).pages or 0
+end
+function progress.path(name,tag)
+ return convert(name).paths[tag] or "origin"
+end
+function progress.nodes(name)
+ return convert(name).names or { }
+end
+function progress.parameters(name)
+ return params -- shared
+end
diff --git a/Master/texmf-dist/tex/context/base/trac-tra.lua b/Master/texmf-dist/tex/context/base/trac-tra.lua
index aa18c3d98e9..052e4bba78f 100644
--- a/Master/texmf-dist/tex/context/base/trac-tra.lua
+++ b/Master/texmf-dist/tex/context/base/trac-tra.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['trac-tra'] = {
version = 1.001,
- comment = "companion to luat-lib.tex",
+ comment = "companion to trac-tra.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -10,12 +10,17 @@ if not modules then modules = { } end modules ['trac-tra'] = {
-- bound to a variable, like node.new, node.copy etc (contrary to for instance
-- node.has_attribute which is bound to a has_attribute local variable in mkiv)
+local debug = require "debug"
+
+local getinfo = debug.getinfo
+local type, next = type, next
+local concat = table.concat
+local format, find, lower, gmatch, gsub = string.format, string.find, string.lower, string.gmatch, string.gsub
+
debugger = debugger or { }
local counters = { }
local names = { }
-local getinfo = debug.getinfo
-local format, find, lower, gmatch = string.format, string.find, string.lower, string.gmatch
-- one
@@ -54,10 +59,10 @@ function debugger.showstats(printer,threshold)
local total, grandtotal, functions = 0, 0, 0
printer("\n") -- ugly but ok
-- table.sort(counters)
- for func, count in pairs(counters) do
+ for func, count in next, counters do
if count > threshold then
local name = getname(func)
- if not name:find("for generator") then
+ if not find(name,"for generator") then
printer(format("%8i %s", count, name))
total = total + count
end
@@ -89,7 +94,7 @@ end
--~ local total, grandtotal, functions = 0, 0, 0
--~ printer("\n") -- ugly but ok
--~ -- table.sort(counters)
---~ for func, count in pairs(counters) do
+--~ for func, count in next, counters do
--~ if count > threshold then
--~ printer(format("%8i %s", count, func))
--~ total = total + count
@@ -143,38 +148,77 @@ end
--~ print("")
--~ debugger.showstats(print,3)
-trackers = trackers or { }
+setters = setters or { }
+setters.data = setters.data or { }
-local data, done = { }, { }
+--~ local function set(t,what,value)
+--~ local data, done = t.data, t.done
+--~ if type(what) == "string" then
+--~ what = aux.settings_to_array(what) -- inefficient but ok
+--~ end
+--~ for i=1,#what do
+--~ local w = what[i]
+--~ for d, f in next, data do
+--~ if done[d] then
+--~ -- prevent recursion due to wildcards
+--~ elseif find(d,w) then
+--~ done[d] = true
+--~ for i=1,#f do
+--~ f[i](value)
+--~ end
+--~ end
+--~ end
+--~ end
+--~ end
-local function set(what,value)
+local function set(t,what,value)
+ local data, done = t.data, t.done
if type(what) == "string" then
- what = aux.settings_to_array(what)
+ what = aux.settings_to_hash(what) -- inefficient but ok
end
- for i=1,#what do
- local w = what[i]
+ for w, v in next, what do
+ if v == "" then
+ v = value
+ else
+ v = toboolean(v)
+ end
for d, f in next, data do
if done[d] then
-- prevent recursion due to wildcards
elseif find(d,w) then
done[d] = true
for i=1,#f do
- f[i](value)
+ f[i](v)
end
end
end
end
end
-local function reset()
- for d, f in next, data do
+local function reset(t)
+ for d, f in next, t.data do
for i=1,#f do
f[i](false)
end
end
end
-function trackers.register(what,...)
+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
+
+function setters.register(t,what,...)
+ local data = t.data
what = lower(what)
local w = data[what]
if not w then
@@ -186,32 +230,32 @@ function trackers.register(what,...)
if typ == "function" then
w[#w+1] = fnc
elseif typ == "string" then
- w[#w+1] = function(value) set(fnc,value,nesting) end
+ w[#w+1] = function(value) set(t,fnc,value,nesting) end
end
end
end
-function trackers.enable(what)
- done = { }
- set(what,true)
+function setters.enable(t,what)
+ local e = t.enable
+ t.enable, t.done = enable, { }
+ enable(t,string.simpleesc(tostring(what)))
+ t.enable, t.done = e, { }
end
-function trackers.disable(what)
- done = { }
- if not what or what == "" then
- trackers.reset(what)
- else
- set(what,false)
- end
+function setters.disable(t,what)
+ local e = t.disable
+ t.disable, t.done = disable, { }
+ disable(t,string.simpleesc(tostring(what)))
+ t.disable, t.done = e, { }
end
-function trackers.reset(what)
- done = { }
- reset()
+function setters.reset(t)
+ t.done = { }
+ reset(t)
end
-function trackers.list() -- pattern
- local list = table.sortedkeys(data)
+function setters.list(t) -- pattern
+ local list = table.sortedkeys(t.data)
local user, system = { }, { }
for l=1,#list do
local what = list[l]
@@ -223,3 +267,75 @@ function trackers.list() -- pattern
end
return user, system
end
+
+function setters.show(t)
+ commands.writestatus("","")
+ local list = setters.list(t)
+ for k=1,#list do
+ commands.writestatus(t.name,list[k])
+ end
+ commands.writestatus("","")
+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
+
+function setters.new(name)
+ local t
+ t = {
+ data = { },
+ name = name,
+ enable = function(...) setters.enable (t,...) end,
+ disable = function(...) setters.disable (t,...) end,
+ register = function(...) setters.register(t,...) end,
+ list = function(...) setters.list (t,...) end,
+ show = function(...) setters.show (t,...) end,
+ }
+ setters.data[name] = t
+ return t
+end
+
+trackers = setters.new("trackers")
+directives = setters.new("directives")
+experiments = setters.new("experiments")
+
+-- 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)
+
+local e = directives.enable
+local d = directives.disable
+
+function directives.enable(...)
+ commands.writestatus("directives","enabling: %s",concat({...}," "))
+ e(...)
+end
+
+function directives.disable(...)
+ commands.writestatus("directives","disabling: %s",concat({...}," "))
+ d(...)
+end
+
+local e = experiments.enable
+local d = experiments.disable
+
+function experiments.enable(...)
+ commands.writestatus("experiments","enabling: %s",concat({...}," "))
+ e(...)
+end
+
+function experiments.disable(...)
+ commands.writestatus("experiments","disabling: %s",concat({...}," "))
+ d(...)
+end
+
+-- a useful example
+
+directives.register("system.nostatistics", function(v)
+ statistics.enable = not v
+end)
+
diff --git a/Master/texmf-dist/tex/context/base/type-buy.tex b/Master/texmf-dist/tex/context/base/type-buy.mkii
index a973fb7b1c9..56fc92e62d6 100644
--- a/Master/texmf-dist/tex/context/base/type-buy.tex
+++ b/Master/texmf-dist/tex/context/base/type-buy.mkii
@@ -17,231 +17,6 @@
\starttypescriptcollection[commercial fonts]
-% temporary code, replaced by setups
-
-\starttypescript [serif] [fallback]
- \definefontsynonym [SerifBold] [Serif]
- \definefontsynonym [SerifItalic] [Serif]
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldItalic] [SerifBold]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [Serif]
-\stoptypescript
-
-\starttypescript [sans] [fallback]
- \definefontsynonym [SansBold] [Sans]
- \definefontsynonym [SansItalic] [Sans]
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldItalic] [SansBold]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [Sans]
-\stoptypescript
-
-\starttypescript [mono] [fallback]
- \definefontsynonym [MonoBold] [Mono]
- \definefontsynonym [MonoItalic] [Mono]
- \definefontsynonym [MonoSlanted] [MonoItalic]
- \definefontsynonym [MonoBoldItalic] [MonoBold]
- \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic]
- \definefontsynonym [MonoCaps] [Mono]
-\stoptypescript
-
-% Lucida Bright : Biggelow and Holmes
-
-\starttypescript [serif] [lucida] [name]
- \definefontsynonym [Serif] [LucidaBright]
- \definefontsynonym [SerifBold] [LucidaBright-Demi]
- \definefontsynonym [SerifItalic] [LucidaBright-Italic]
- \definefontsynonym [SerifSlanted] [LucidaBright-Oblique]
- \definefontsynonym [SerifBoldItalic] [LucidaBright-DemiItalic]
- \definefontsynonym [SerifBoldSlanted] [LucidaBright-DemiItalic]
- \definefontsynonym [SerifCaps] [LucidaBrightSmallcaps]
- \definefontsynonym [SerifBoldCaps] [LucidaBrightSmallcaps-Demi]
-\stoptypescript
-
-\starttypescript [sans] [lucida] [name]
- \definefontsynonym [Sans] [LucidaSans]
- \definefontsynonym [SansBold] [LucidaSans-Demi]
- \definefontsynonym [SansItalic] [LucidaSans-Italic]
- \definefontsynonym [SansSlanted] [LucidaSans-Italic]
- \definefontsynonym [SansBoldItalic] [LucidaSans-DemiItalic]
- \definefontsynonym [SansBoldSlanted] [LucidaSans-DemiItalic]
- \definefontsynonym [SansCaps] [LucidaSans]
-\stoptypescript
-
-\starttypescript [mono] [lucida] [name]
- \definefontsynonym [Mono] [LucidaSans-Typewriter]
- \definefontsynonym [MonoBold] [LucidaSans-TypewriterBold]
- \definefontsynonym [MonoItalic] [LucidaSans-TypewriterOblique]
- \definefontsynonym [MonoSlanted] [LucidaSans-TypewriterOblique]
- \definefontsynonym [MonoBoldItalic] [LucidaSans-TypewriterBoldOblique]
- \definefontsynonym [MonoBoldSlanted] [LucidaSans-TypewriterBoldOblique]
- \definefontsynonym [MonoCaps] [LucidaSans-Typewriter]
-\stoptypescript
-
-\starttypescript [math] [lucida] [name]
- \definefontsynonym [MathRoman] [LucidaBright]
- \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 [handwriting] [lucida] [name]
- \definefontsynonym [Handwriting] [LucidaHandwriting-Italic]
-\stoptypescript
-
-\starttypescript [calligraphy] [lucida] [name]
- \definefontsynonym [Calligraphy] [LucidaCalligraphy-Italic]
-\stoptypescript
-
-\starttypescript [serif] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaBright] [\typescriptthree-lbr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Demi] [\typescriptthree-lbd] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-DemiItalic] [\typescriptthree-lbdi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Italic] [\typescriptthree-lbi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBrightSmallcaps] [\typescriptthree-lbrsc] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBrightSmallcaps-Demi] [\typescriptthree-lbdsc] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Oblique] [\typescriptthree-lbsl] [encoding=\typescriptthree]
-\stoptypescript
-
-\starttypescript [sans] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaSans] [\typescriptthree-lsr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Demi] [\typescriptthree-lsd] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-DemiItalic] [\typescriptthree-lsdi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Italic] [\typescriptthree-lsi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Bold] [\typescriptthree-lsb] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-BoldItalic] [\typescriptthree-lsbi] [encoding=\typescriptthree]
-\stoptypescript
-
-\starttypescript [mono] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaSans-Typewriter] [\typescriptthree-lstr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterBold] [\typescriptthree-lstb] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterBoldOblique] [\typescriptthree-lstbo] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterOblique] [\typescriptthree-lsto] [encoding=\typescriptthree]
- \loadmapfile [\typescriptthree-bh-lucida.map]
- \fakecontrolspace
-\stoptypescript
-
-\starttypescript [math] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaBright] [\typescriptthree-lbr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaNewMath-AltItalic] [lbmo]
- \definefontsynonym [LucidaNewMath-Arrows] [lbma]
- \definefontsynonym [LucidaNewMath-Extension] [lbme]
- \definefontsynonym [LucidaNewMath-Roman] [lbmr]
- \definefontsynonym [LucidaNewMath-Italic] [lbmi]
- \definefontsynonym [LucidaNewMath-Symbol] [lbms]
- \definefontsynonym [LucidaBlackletter] [lbl]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [boldmath,bfmath] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaNewMath-AltDemiItalic] [lbmdo]
- \definefontsynonym [LucidaNewMath-Arrows-Demi] [lbmad]
- \definefontsynonym [LucidaNewMath-Extension] [lbme]
- \definefontsynonym [LucidaNewMath-Demi] [lbmd]
- \definefontsynonym [LucidaNewMath-DemiItalic] [lbmdi]
- \definefontsynonym [LucidaNewMath-Symbol-Demi] [lbmsd]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [calligraphy] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaCalligraphy-Italic] [\typescriptthree-lbc] [encoding=\typescriptthree]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [casual] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaCasual] [\typescriptthree-lbkr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaCasual-Italic] [\typescriptthree-lbki] [encoding=\typescriptthree]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [handwriting] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaHandwriting-Italic] [\typescriptthree-lbh] [encoding=\typescriptthree]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [fax] [lucida] [texnansi,ec,8r]
- \definefontsynonym [LucidaFax] [\typescriptthree-lfr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaFax-Demi] [\typescriptthree-lfd] [encoding=\typescriptthree]
- \definefontsynonym [LucidaFax-DemiItalic] [\typescriptthree-lfdi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaFax-Italic] [\typescriptthree-lfi] [encoding=\typescriptthree]
- \loadmapfile [\typescriptthree-bh-lucida.map]
-\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 [\typescripttwo-bh-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 [\typescripttwo-bh-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 [\typescripttwo-bh-lucida.map]
-\stoptypescript
-
-\starttypescript [lucida,lucidabfm,lucidaboldmath] [texnansi,ec,8r]
- \usemathcollection[lbr]
- \quittypescriptscanning % last in the row
-\stoptypescript
-
% Informal : Vulis
\starttypescript [casual] [informal] [name]
@@ -516,6 +291,11 @@
\loadmapfile[\typescriptthree-adobe-frutiger.map]
\stoptypescript
+\starttypescript [frutiger] [texnansi,ec,8r,uc]
+ \definetypeface [frutiger] [ss] [sans] [frutiger] [default] [encoding=\typescripttwo]
+% \loadmapfile [\typescripttwo-adobe-frutiger.map]
+\stoptypescript
+
% kabel
\starttypescript [sans] [kabel] [ec,8r,texnansi]
diff --git a/Master/texmf-dist/tex/context/base/type-buy.mkiv b/Master/texmf-dist/tex/context/base/type-buy.mkiv
new file mode 100644
index 00000000000..becc4361c4a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-buy.mkiv
@@ -0,0 +1,82 @@
+%D \module
+%D [ file=type-buy,
+%D version=2003.07.08, % 2001.04.12,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=A Few Commercial Fonts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\starttypescriptcollection[commercial fonts]
+
+% Informal : Vulis
+
+\starttypescript [casual] [informal]
+ \definefontsynonym [Serif] [Informal-Regular]
+ \definefontsynonym [SerifBold] [Informal-Bold]
+ \definefontsynonym [SerifSlanted] [Informal-Oblique]
+ \definefontsynonym [SerifItalic] [Informal-Oblique]
+ \definefontsynonym [SerifBoldSlanted] [Informal-BoldOblique]
+ \definefontsynonym [SerifBoldItalic] [Informal-BoldOblique]
+ \definefontsynonym [SerifCaps] [Informal-Regular]
+\stoptypescript
+
+\starttypescript [math] [informal] [name]
+ \definefontsynonym [MathRoman] [Informal-Regular]
+ \definefontsynonym [MathExtension] [Informal-MathExtendedSymbols]
+ \definefontsynonym [MathItalic] [Informal-MathItalics]
+ \definefontsynonym [MathSymbol] [Informal-MathSymbols]
+\stoptypescript
+
+\starttypescript [casual] [informal]
+ \definefontsynonym [Informal-Regular] [file:ifrg]
+ \definefontsynonym [Informal-Bold] [file:ifb]
+ \definefontsynonym [Informal-Oblique] [file:ifo]
+ \definefontsynonym [Informal-BoldOblique] [file:ifbo]
+\stoptypescript
+
+\starttypescript [math] [informal] [default]
+ \loadfontgoodies[informal-math]
+ \definefontsynonym[MathRoman][informalmath@informal-math]
+\stoptypescript
+
+\starttypescript [informal]
+ \definetypeface[informal][rm][casual][informal][default]
+ \definetypeface[informal][tt][mono] [modern] [default][rscale=0.95]
+ \definetypeface[informal][mm][math] [informal][default]
+\stoptypescript
+
+% Sabon
+
+\starttypescript [serif] [sabon] [name]
+
+ \definefontsynonym [Serif] [SabonMT]
+ \definefontsynonym [SerifItalic] [SabonMT-Italic]
+ \definefontsynonym [SerifSlanted] [SabonMT-Italic]
+ \definefontsynonym [SerifBold] [SabonMT-SemiBold]
+ \definefontsynonym [SerifBoldItalic] [SabonMT-SemiBoldItalic]
+ \definefontsynonym [SerifBoldSlanted] [SabonMT-SemiBoldItalic]
+ \definefontsynonym [SerifCaps] [SabonMT-RegularSC]
+
+ \definefontsynonym[SabonMT] [sab_____]
+ \definefontsynonym[SabonMT-Italic] [sabi____]
+ \definefontsynonym[SabonMT-ItalicOsF] [saboi___]
+ \definefontsynonym[SabonMT-SemiBoldOsF] [sabos___]
+ \definefontsynonym[SabonMT-SemiBold] [sabs____]
+ \definefontsynonym[SabonMT-RegularSC] [sabsc___]
+ \definefontsynonym[SabonMT-SemiBoldItalic] [sabsi___]
+ \definefontsynonym[SabonMT-SemiBoldItalicOsF][sasio___]
+\stoptypescript
+
+% \definetypeface[sabon][rm][serif][sabon][default]
+% \setupbodyfont[sabon]
+% \starttext
+% \input tufte
+% \stoptext
+
+\stoptypescriptcollection
+
diff --git a/Master/texmf-dist/tex/context/base/type-cbg.tex b/Master/texmf-dist/tex/context/base/type-cbg.mkii
index 93cfa077ece..93cfa077ece 100644
--- a/Master/texmf-dist/tex/context/base/type-cbg.tex
+++ b/Master/texmf-dist/tex/context/base/type-cbg.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-cow.tex b/Master/texmf-dist/tex/context/base/type-cow.mkii
index 507386443d7..507386443d7 100644
--- a/Master/texmf-dist/tex/context/base/type-cow.tex
+++ b/Master/texmf-dist/tex/context/base/type-cow.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-cow.mkiv b/Master/texmf-dist/tex/context/base/type-cow.mkiv
new file mode 100644
index 00000000000..5215e7122f5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-cow.mkiv
@@ -0,0 +1,85 @@
+%D \module
+%D [ file=type-cow,
+%D version=2006.06.23,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Cow Fonts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D The cow fonts are a project of Duane Bibby, Hans Hagen and Taco
+%D Hoekwater.
+
+\starttypescriptcollection[cow]
+
+\starttypescript [math,serif] [cow,sheep]
+ \setups[font:fallback:serif]
+ % \usemathcollection[cow]
+ \loadmapfile[koeieletters.map]
+ \definefontsynonym [Serif] [Cows]
+ \definefontsynonym [SerifContour] [CowsContour]
+ \definefontsynonym [SerifLogo] [CowsLogo]
+ \definefontsynonym [SerifLogoContour][CowsLogoContour]
+ \definefontsynonym [MathRoman] [CowsMathRoman]
+ \definefontsynonym [MathItalic] [CowsMathItalic]
+ \definefontsynonym [MathSymbol] [CowsMathSymbol]
+ \definefontsynonym [MathExtension] [CowsMathExtensions]
+\stoptypescript
+
+\starttypescript [math,serif] [sheep]
+ \setups[font:fallback:serif]
+ % \usemathcollection[cow]
+ \loadmapfile[koeieletters.map]
+ \definefontsynonym [Serif] [Sheep]
+ \definefontsynonym [SerifContour] [SheepContour]
+ \definefontsynonym [SerifLogo] [SheepLogo]
+ \definefontsynonym [SerifLogoContour][SheepLogoContour]
+ \definefontsynonym [MathRoman] [SheepMathRoman]
+ \definefontsynonym [MathItalic] [SheepMathItalic]
+ \definefontsynonym [MathSymbol] [SheepMathSymbol]
+ \definefontsynonym [MathExtension] [SheepMathExtensions]
+\stoptypescript
+
+\starttypescript [all] [cow,sheep]
+ \definefontsynonym [Cows] [koeielett]
+ \definefontsynonym [CowsContour] [koeielett-contour]
+ \definefontsynonym [CowsLogo] [koeielogos]
+ \definefontsynonym [CowsLogoContour] [koeielogos-contour]
+ \definefontsynonym [CowsMathRoman] [koeielett]
+ \definefontsynonym [CowsMathItalic] [koeieletter-mi]
+ \definefontsynonym [CowsMathSymbol] [koeieletter-sy]
+ \definefontsynonym [CowsMathExtensions][koeieletter-ex]
+\stoptypescript
+
+\starttypescript [all] [sheep]
+ \definefontsynonym [Sheep] [koeielett]
+ \definefontsynonym [SheepContour] [koeielett-contour]
+ \definefontsynonym [SheepLogo] [koeielogos]
+ \definefontsynonym [SheepLogoContour] [koeielogos-contour]
+ \definefontsynonym [SheepMathRoman] [koeielettx]
+ \definefontsynonym [SheepMathItalic] [koeieletter-mi]
+ \definefontsynonym [SheepMathSymbol] [koeieletter-syx]
+ \definefontsynonym [SheepMathExtensions][koeieletter-ex]
+\stoptypescript
+
+\starttypescript [cow]
+ \definetypeface [cow][rm][serif][cow] [default]
+ \definetypeface [cow][ss][serif][cow] [default]
+ \definetypeface [cow][mm][math] [cow] [default]
+ \definetypeface [cow][tt][mono] [modern][default][rscale=0.85]
+\stoptypescript
+
+\starttypescript [sheep]
+ \definetypeface [sheep][rm][serif][sheep] [default]
+ \definetypeface [sheep][ss][serif][sheep] [default]
+ \definetypeface [sheep][mm][math] [sheep] [default]
+ \definetypeface [sheep][tt][mono] [modern][default][,rscale=0.85]
+\stoptypescript
+
+\stoptypescriptcollection
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-def.mkii b/Master/texmf-dist/tex/context/base/type-def.mkii
new file mode 100644
index 00000000000..f31c93e504e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-def.mkii
@@ -0,0 +1,86 @@
+%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 / 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.
+
+\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/type-def.mkiv b/Master/texmf-dist/tex/context/base/type-def.mkiv
new file mode 100644
index 00000000000..c980a4ee528
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-def.mkiv
@@ -0,0 +1,48 @@
+%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 / 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.
+
+\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
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-def.tex b/Master/texmf-dist/tex/context/base/type-def.tex
deleted file mode 100644
index 6469a5925d8..00000000000
--- a/Master/texmf-dist/tex/context/base/type-def.tex
+++ /dev/null
@@ -1,128 +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 / 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.
-
-\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
-
-\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
-
-% handy
-
-% \starttypescript [serif] [simple] [name]
-% \definefontsynonym [Simple] [cmvtt10]
-% \setupfontsynonym [Simple] [handling=pure]
-% \stoptypescript
-
-\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
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-exp.tex b/Master/texmf-dist/tex/context/base/type-exp.mkii
index dae770e98c0..dae770e98c0 100644
--- a/Master/texmf-dist/tex/context/base/type-exp.tex
+++ b/Master/texmf-dist/tex/context/base/type-exp.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-fsf.tex b/Master/texmf-dist/tex/context/base/type-fsf.mkii
index 7813b7b5dbd..7813b7b5dbd 100644
--- a/Master/texmf-dist/tex/context/base/type-fsf.tex
+++ b/Master/texmf-dist/tex/context/base/type-fsf.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-ghz.tex b/Master/texmf-dist/tex/context/base/type-ghz.mkii
index 7e31096ee4a..7e31096ee4a 100644
--- a/Master/texmf-dist/tex/context/base/type-ghz.tex
+++ b/Master/texmf-dist/tex/context/base/type-ghz.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-hgz.tex b/Master/texmf-dist/tex/context/base/type-ghz.mkiv
index 59b5eefd803..e6a12d7e33b 100644
--- a/Master/texmf-dist/tex/context/base/type-hgz.tex
+++ b/Master/texmf-dist/tex/context/base/type-ghz.mkiv
@@ -270,7 +270,7 @@
\definetypeface[palatino][rm][serif][palatino-nova][default][features=default]
\definetypeface[palatino][ss][sans] [palatino-sans][default][features=default]
\definetypeface[palatino][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino][mm][math] [latin-modern] [default][features=default,rscale=1.1]
+ \definetypeface[palatino][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
@@ -278,7 +278,7 @@
\definetypeface[palatino][ss][sans] [palatino-sans][default][features=default]
\definetypeface[palatino][rm][serif][palatino-nova][default][features=default]
\definetypeface[palatino][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino][mm][math] [latin-modern] [default][features=default,rscale=1.1]
+ \definetypeface[palatino][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
@@ -286,7 +286,7 @@
\definetypeface[palatino-informal][ss][sans] [palatino-informal][default][features=default]
\definetypeface[palatino-informal][rm][serif][palatino-nova] [default][features=default]
\definetypeface[palatino-informal][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino-informal][mm][math] [latin-modern] [default][features=default,rscale=1.1]
+ \definetypeface[palatino-informal][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
diff --git a/Master/texmf-dist/tex/context/base/type-hgz.mkii b/Master/texmf-dist/tex/context/base/type-hgz.mkii
new file mode 100644
index 00000000000..4d3e495b065
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-hgz.mkii
@@ -0,0 +1 @@
+\input type-ghz.mkii \endinput % can be file synonym
diff --git a/Master/texmf-dist/tex/context/base/type-hgz.mkiv b/Master/texmf-dist/tex/context/base/type-hgz.mkiv
new file mode 100644
index 00000000000..a3c2a78418c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-hgz.mkiv
@@ -0,0 +1 @@
+\input type-ghz.mkiv \endinput % can be file synonym
diff --git a/Master/texmf-dist/tex/context/base/type-husayni-default.mkiv b/Master/texmf-dist/tex/context/base/type-husayni-default.mkiv
new file mode 100644
index 00000000000..b3c1af5b708
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-husayni-default.mkiv
@@ -0,0 +1,146 @@
+\definefontfeature
+ [husayni-default]
+ [analyze=yes,mode=node,
+ language=dflt,script=arab,
+ ccmp=yes, % adds identity dots to unicode letters; includes dynamic dot placement
+ init=yes,medi=yes,fina=yes, % contextual analysis
+ % dlig=yes, % Hamzahbelow under YaaHamzahabove
+ rlig=yes, % indispensable
+ calt=yes, % ayah+numerals
+ salt=yes, % includes manual justification with Tatwiil
+ % fchr=yes % formatting chars
+ anum=yes, % replace latin numerals with arabic-script ones
+ ss01=yes, % Allah, Muhammad,
+ % ss02=yes, % ss01 + Allah_final
+ ss03=yes, % level-1 stack over Jiim, initial entry only
+ % ss04=yes, % level-1 stack over Jiim, initial/medial entry
+ % ss05=yes, % multi-level Jiim stacking, initial/medial entry
+ % ss06=yes, % aesthetic Faa/Qaaf for FJ_mm, FJ_mf connection
+ ss07=yes, % initial-entry stacking over Haa
+ % ss08=yes, % initial/medial stacking over Haa, minus HM_mf strings
+ % ss09=yes, % initial/medial Haa stacking plus HM_mf strings
+ ss10=yes, % basic dipped Miim, initial-entry B_S-stack over Miim
+ % ss11=yes, % full dipped Miim, initial-entry B_S-stack over Miim
+ ss12=yes, % XBM_im initial-medial entry B_S-stack over Miim,
+ % ss13=yes, % full initial-medial entry B_S-stacked Miim
+ % ss14=yes, initial entry, stacked Laam on Miim
+ ss15=yes, % full stacked Laam-on-Miim
+ ss16=yes, % initial entry, stacked Ayn-on-Miim
+ % ss17=yes, % full stacked Ayn-on-Miim
+ % ss18=yes, % LMJ_im % already contained in ss03--05, may remove
+ ss19=yes, % LM_im
+ % ss20=yes, % KLM_m, sloped Miim
+ % ss21=yes, % KLM_i_mm/LM_mm, sloped Miim
+ % ss22=yes, % filled sloped Miim
+ % ss23=yes, % LM_mm, non-sloped Miim
+ ss24=yes, % BR_i_mf, BN_i_mf
+ ss25=yes, % basic LH_im % might merge with ss24
+ ss26=yes, % full Yaa.final special strings: BY_if, BY_mf, LY_mf
+ ss27=yes, % basic thin Miim.final
+ % ss28=yes, % full thin Miim.final % to be moved to jsnn
+ % ss29=yes, % basic short Miim.final
+ % ss30=yes, % full short Miim.final % to be moved to jsnn
+ ss31=yes, % basic Raa.final strings: JR and SR
+ % ss32=yes, % basic Raa.final strings: JR, SR, and BR
+ % ss33=yes, % TtR % to be moved to jsnn
+ ss34=yes, % AyR style % also available in jsnn
+ ss35=yes, % full Kaaf contexts
+ ss36=yes, % full Laam contexts
+ ss37=yes, % Miim-Miim contexts
+ ss38=yes, % basic dipped Haa, B_SH_mm
+ % ss39=yes, % full dipped Haa, B_S_LH_i_mm_Mf
+ % ss40=yes, % aesthetic dipped medial Haa
+ ss41=yes, % high and low Baa strings
+ ss42=yes, % diagonal entry
+ ss43=yes, % initial alternates
+ % ss44=yes, % hooked final alif
+ % ss45=yes, % BMA_f
+ % ss46=yes, % BM_mm_alt, for JBM combinations
+ % ss47=yes, % Shaddah-<kasrah> combo
+ % ss48=yes, % Auto-sukuun
+ % ss49=yes, % No vowels
+ % ss50=yes, % Shaddah/MaaddahHamzah only
+ % ss51=yes, % No Skuun
+ % ss52=yes, % No Waslah
+ % ss53=yes, % No Waslah
+ % ss54=yes, % chopped finals
+ % ss55=yes, % idgham-tanwin
+ ss60=yes, %
+ % js01=yes, % Raawide
+ % js02=yes, % Yaawide
+ % js03=yes, % Kaafwide
+ % js04=yes, % Nuunwide
+ % js05=yes, % Kaafwide Nuunwide Siinwide Baawide
+ % js06=yes, % final Haa wide
+ % js07=yes, % thin Miim
+ % js08=yes, % short Miim
+ % js09=yes, % wide Siin
+ % js10=yes, % thuluth-style initial Haa, final Miim, MRw_mf
+ % js11=yes, % level-1 stretching
+ % js12=yes, % level-2 stretching
+ % js13=yes, % level-3 stretching
+ % js14=yes, % final Alif
+ % js15=yes, % hooked final Alif
+ js16=yes, % aesthetic medial Faa/Qaaf
+ % js17=yes, % fancy isol Haa after Daal, Raa, and Waaw
+ % js18=yes, % Laamwide, alternate substitution
+ % js19=yes, % level-4 stretching, only siin and Hhaa for basmalah
+ % js20=yes, % level-5 stretching, only siin and Hhaa for basmalah
+ % js21=yes, % Haa.final_alt2
+ % calt=yes, % to be used for vowel/dot-based dynamics
+ % ttwl=yes, % for simple, horizontal stretching, not yet implemented in luatex/mkiv
+ % flts=yes, % Final Glyph On Line Alternates Short: Baa-like
+ % fltw=yes, % Final Glyph On Line Alternates Wide: Baa-like
+ % gclr=yes, % Geometric Cursive LR : for testing GPOS only!
+ % gcrl=yes, % Geometric Cursive RL
+ % gklr=yes, % Geometric Kerning LR
+ % gkrl=yes, % Geometric Kerning RL
+ kern=yes, % includes kerning of dot-base pairs, and final pairs in continuous strings
+ curs=yes, % we don't curs final pairs, padj for that
+ mark=yes, % vowels
+ mkmk=yes, % stacked vowels
+ tlig=yes,
+ colorscheme=husayni:default]
+
+\definefontfeature
+ [husayni-tt]
+ [analyze=yes,mode=node,
+ language=dflt,script=arab,
+ ccmp=yes, % adds identity dots to unicode letters; includes dynamic dot placement
+ init=yes,medi=yes,fina=yes, % contextual analysis
+ rlig=yes, % indispensable
+ fchr=yes,
+ kern=yes, % includes kerning of dot-base pairs, and final pairs in continuous strings
+ curs=yes, % we don't curs final pairs, padj for that
+ mark=yes, % vowels
+ mkmk=yes] % stacked vowels
+
+\definefontfeature
+ [husayni-mono]
+ [analyze=yes,mode=node,
+ language=dflt,script=arab,ccmp=no,
+ init=yes,medi=yes,fina=yes,isol=yes,
+ rlig=yes,liga=yes,
+ mset=yes]
+
+\definedelimitedtext
+ [ornatequote]
+ [left={‏\char"FD3F\penalty10000},
+ right={‏\char"FD3E\penalty10000}]
+
+\definedelimitedtext
+ [arparenthesis]
+ [left={‏\char"0028},
+ right={‏\char"0029}]
+
+\definedelimitedtext
+ [arquotation]
+ [left={‏\symbol[rightquotation]},
+ right={‏\symbol[leftquotation]},
+ leftmargin=standard]
+
+\definedelimitedtext
+ [arquote]
+ [left={‏\symbol[rightquote]},
+ right={‏\symbol[leftquote]},
+ leftmargin=standard] \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/type-ini.mkii b/Master/texmf-dist/tex/context/base/type-ini.mkii
index 9372f8dc395..ac1e243f248 100644
--- a/Master/texmf-dist/tex/context/base/type-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/type-ini.mkii
@@ -76,19 +76,6 @@
{\splitfiletype{#1}%
\addtocommalist\splitoffname\typescriptfiles}}
-\usetypescriptfile[\f!typeprefix tmf]
-\usetypescriptfile[\f!typeprefix siz]
-
-\ifnum\texengine=\xetexengine
- \usetypescriptfile[\f!typeprefix otf]
- \usetypescriptfile[\f!typeprefix xtx]
-\else
- \usetypescriptfile[\f!typeprefix one]
- %usetypescriptfile[\f!typeprefix akb] % we have gyre now
-\fi
-
-\usetypescriptfile[\f!typeprefix loc]
-
% SO FAR
\let\currenttypescripts\empty
@@ -171,7 +158,7 @@
\startreadingfile
\pushendofline
\unprotect
- \readfile\currenttypefile\donothing\donothing
+ \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
\protect
\popendofline
\stopreadingfile
@@ -185,7 +172,7 @@
\startreadingfile
\pushendofline
\unprotect
- \readfile\currenttypefile\donothing\donothing
+ \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
\protect
\popendofline
\stopreadingfile
@@ -650,7 +637,7 @@
\fi \fi
\ifmmode\mr\else\tf\fi} % needed ?
-\def\usetypefile[#1]% recurses on path !
+\def\usetypefile[#1]% recurses on path ! ?
{\readfile{\f!typeprefix#1}\donothing\donothing}
%D For Taco:
diff --git a/Master/texmf-dist/tex/context/base/type-ini.mkiv b/Master/texmf-dist/tex/context/base/type-ini.mkiv
index 4076cf7b8ae..cd65f8abb4a 100644
--- a/Master/texmf-dist/tex/context/base/type-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-ini.mkiv
@@ -59,13 +59,13 @@
\unprotect
-\def\starttypescriptcollection
+\unexpanded\def\starttypescriptcollection
{\dosingleempty\dostarttypescriptcollection}
\def\dostarttypescriptcollection[#1]%
{}
-\def\stoptypescriptcollection
+\unexpanded\def\stoptypescriptcollection
{}
\let\typescriptfiles\empty
@@ -76,20 +76,6 @@
{\splitfiletype{#1}%
\addtocommalist\splitoffname\typescriptfiles}}
-% \usetypescriptfile[\f!typeprefix exa] % some examples
-% \usetypescriptfile[\f!typeprefix syn] % font file synonyms
-% \usetypescriptfile[\f!typeprefix enc] % files and encodings
-% %usetypescriptfile[\f!typeprefix dis] % funny name remappings, obsolete
-% \usetypescriptfile[\f!typeprefix siz] % specific font sizes
-% \usetypescriptfile[\f!typeprefix map] % pdftex mapping
-% \usetypescriptfile[\f!typeprefix spe] % special macros
-% \usetypescriptfile[\f!typeprefix akb] % adobe karl berry names
-
-\usetypescriptfile[\f!typeprefix tmf]
-\usetypescriptfile[\f!typeprefix siz]
-\usetypescriptfile[\f!typeprefix otf]
-\usetypescriptfile[\f!typeprefix loc]
-
% SO FAR
\let\currenttypescripts\empty
@@ -183,7 +169,8 @@
{\startreadingfile
\pushendofline
\unprotect
- \readfile\currenttypefile\donothing\donothing
+ % we could have something readfilewithMKfallback
+ \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
\protect
\popendofline
\stopreadingfile}
@@ -199,7 +186,7 @@
% \definetypescriptsynonym[lbr][cmr]
-\def\definetypescriptsynonym
+\unexpanded\def\definetypescriptsynonym
{\dodoubleempty\dodefinetypescriptsynonym}
\def\dodefinetypescriptsynonym[#1][#2]%
@@ -226,7 +213,9 @@
\newif\iftracetypescripts
-\def\starttypescript
+\let\stoptypescript\relax
+
+\unexpanded\def\starttypescript
{\ifcase\typescriptstate
% 0 = skip
\@EA\gobbleuntil\@EA\stoptypescript
@@ -294,7 +283,7 @@
\def\doprocesstypescript
{\pushmacro\fontclass}
-\def\stoptypescript
+\unexpanded\def\stoptypescript
{\popmacro\fontclass}
\long\def\noprocesstypescript#1\stoptypescript
@@ -339,117 +328,31 @@
\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]{\processcommacommand[#1]\dopreloadmapfile}
-\def\loadmapfile [#1]{\processcommacommand[#1]\loadthemapfile}
-\def\unloadmapfile [#1]{\processcommacommand[#1]\unloadthemapfile}
-
-% too soon, no driver known, \ifproductionrun \loadallfontmapfiles \fi
-
-\def\loadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\addtocommalist\splitoffname\allfontmapsfiles}
-
-\def\unloadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\removefromcommalist\splitoffname\allfontmapsfiles}
-
-\let\usedmapfile \gobbletwoarguments
-\let\usedmapline \gobbletwoarguments
-\let\doregisterloadedmapfile\gobbleoneargument
-
-\def\doloadfontmapfile#1%
- {\ifcsname#1\c!state\endcsname\else
- \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%
- {\ifcsname#1\c!state\endcsname\else
- \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
- \doloadmapline{#1}{#2}% special
- \else
- \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
+%D Map files will go away in \LUATEX, but till that happens we
+%D use stripped down support for loading them.
-% hm, the timing of when pdftex needs the map file info keeps changing;
-% it's really time to move to map line support
+\def\loadmapfile{\dosingleempty\doloadmapfile}
+\def\loadmapline{\dodoubleempty\doloadmapline}
-% \everybeforeshipout \expandafter % will move as it is backend dependent
-% {\expandafter\appendtoks
-% \expandafter\loadallfontmapfiles
-% \expandafter\to
-% \expandafter\pageboundsettings
-% \the\everybeforeshipout}
+\def\doloadmapfile [#1]{\ctxlua{fonts.map.loadfile("#1")}}
+\def\doloadmapline [#1][#2]{\ctxlua{fonts.map.loadline("#1","#2")}}
+\def\forgetmapfiles {\ctxlua{fonts.map.reset()}}
-\appendtoks
- \loadallfontmapfiles
-\to \pageboundsettings
+\let\loadallfontmapfiles\relax
+\let\allfontmapsfiles \empty
+\let\preloadmapfile \loadmapfile
+\let\resetmapfiles \forgetmapfiles
+\let\disablemapfiles \forgetmapfiles
\newif\ifautoloadmapfiles
-\let\allfontmapsfiles\empty
-
-\def\forgetmapfiles
- {\globallet\allfontmapsfiles\empty}
-
-\newconditional\resettingmapfile
-
-\def\resetmapfiles
- {\global\settrue\resettingmapfile}
+% \appendtoks
+% \pdfmapfile{}% somehow does not work at the lua end
+% \to \everyjob
-\def\disablemapfiles
- {\resetmapfiles
- \forgetmapfiles}
+\prependtoks
+ \loadmapfile[mkiv-base.map]%
+\to \everystarttext
%D A handy shortcut:
@@ -461,7 +364,7 @@
% \setupfontsynonym [\typescriptprefix\typescriptone] [handling=\typescriptthree]
% \stoptypescript
-\def\definetypescriptprefix
+\unexpanded\def\definetypescriptprefix
{\dodoubleargument\dodefinetypescriptprefix}
\def\dodefinetypescriptprefix[#1][#2]%
@@ -483,7 +386,7 @@
% \definetypeface [#1:joke] [#2:rm] [#3:...]
% \definetypeface [#1:joke] [#2:rm] [#3:serif] [#4:lucida] [#5:size] [#6:...]
-\def\definetypeface
+\unexpanded\def\definetypeface
{\dosixtupleargument\dodefinetypeface}
\def\tsvar#1#2% \executeifdefined{\??ts#1}{#2}
@@ -499,65 +402,71 @@
\def\typefaceencoding{\defaultencoding}
-\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
- \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,\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]}\fi
- % we need to keep typefaceencoding for a while as it can still be used to filter
- % old scripts as we just strip the texnansi- prefix
- \ifx\typefaceencoding\t!default
- \usetypescript[#3][#4][\t!name,\t!default]% will be default some day
- \else
- \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]%
- \fi
- \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}
+% we need to keep typefaceencoding for a while as it can still be used to filter
+% old scripts as we just strip the texnansi- prefix
-% will become (once we've adapted the typescripts):
+% \def\dostarttypefacedefining#1#2%
+% {\pushmacro\fontclass
+% \setcurrentfontclass{#1}%
+% \pushmacro\relativefontsize
+% \let\relativefontsize\@@tsrscale % still needed ?
+% \savefontclassparameters{#2}\@@tsrscale\@@tsfeatures\@@tsfallbacks}
+%
+% \def\dostoptypefacedefining
+% {\popmacro\relativefontsize
+% \popmacro\fontclass}
%
% \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
-% \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,\s!text=,#6]}% \geteparameters
-% \pushmacro\relativefontsize
-% \pushmacro\fontclass
-% \let\relativefontsize\@@tsrscale
-% \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)
+% \iffifthargument % sixth is optional, we need to expand since in #6 there can be a \typescripttwo
+% % \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,#6]}% \geteparameters
+% \geteparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!fallbacks=,#6]%
+% \dostarttypefacedefining{#1}{#2}%
+% \pushmacro\typefaceencoding
+% \let\typefaceencoding\@@tsencoding
% \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi
-% \usetypescript[#3][#4][\t!name,\t!default,\empty]% brr, this empty, no encoding
+% \ifx\typefaceencoding\t!default
+% \usetypescript[#3][#4][\t!name,\t!default]% will be default some day
+% \else
+% \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]%
+% \fi
% \usetypescript[#3][#5][\t!size]%
-% \popmacro\fontclass
-% \popmacro\relativefontsize
+% %
+% \dostoptypefacedefining
+% %
+% \popmacro\typefaceencoding
% \else\iffourthargument
% \definetypeface[#1][#2][#3][#4][\s!default]%
% \else\ifthirdargument
% \getparameters[\??tf#1#2][#3]%
% \fi\fi\fi}
+\def\dostarttypefacedefining#1#2#3%
+ {\geteparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,#3]%
+ \pushmacro\fontclass
+ \setcurrentfontclass{#1}%
+ \pushmacro\relativefontsize
+ \let\relativefontsize\@@tsrscale % still needed ?
+ \savefontclassparameters{#2}\@@tsrscale\@@tsfeatures\@@tsfallbacks}
+
+\def\dostoptypefacedefining
+ {\popmacro\relativefontsize
+ \popmacro\fontclass}
+
+\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
+ \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi
+ \dostarttypefacedefining{#1}{#2}{#6}%
+ \usetypescript[#3][#4][\t!name,\t!default]%
+ \usetypescript[#3][#5][\t!size]%
+ \dostoptypefacedefining
+ \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
@@ -565,10 +474,10 @@
\setgvalue{\??tf#1\s!default}{#2}%
\fi
\ifcsname#1\endcsname \else
- \unexpanded\setgvalue{#1}{\switchtotypeface[#1][#2]}%
+ \setugvalue{#1}{\switchtotypeface[#1][#2]}%
\fi}}
-\def\setuptypeface% [class] [settings]
+\unexpanded\def\setuptypeface% [class] [settings]
{\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]}
\unexpanded\def\switchtotypeface% [class] [settings]
@@ -592,7 +501,8 @@
\ifmmode\mr\else\tf\fi} % needed ?
\def\usetypefile[#1]% recurses on path !
- {\readfile{\f!typeprefix#1}\donothing\donothing}
+ {\edef\currenttypefile{\f!typeprefix#1}%
+ \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}}
%D For Taco:
%D
@@ -632,3 +542,37 @@
\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkiv} % will become module
\protect \endinput
+
+% Computer Modern Roman : Donald Knuth
+% Latin Modern: LM Font Revision Team
+
+% LM math vs CM math (analysis by Taco):
+%
+% lmex10.tfm % identical
+% lmmi5.tfm % identical
+% lmmi6.tfm % identical
+% lmmi7.tfm % identical
+% lmmi8.tfm % identical
+% lmmi9.tfm % identical
+% lmmi10.tfm % identical
+% lmmi12.tfm % identical
+% lmmib10.tfm % identical
+% lmsy5.tfm % extra chars: 254,255 (octal)
+% lmsy6.tfm % extra chars: 254,255 (octal)
+% lmsy7.tfm % extra chars: 254,255 (octal)
+% lmsy8.tfm % extra chars: 254,255 (octal)
+% lmsy9.tfm % extra chars: 254,255 (octal)
+% lmsy10.tfm % extra chars: 254,255 (octal)
+% lmbsy10.tfm % extra chars: 254,255 (octal)
+%
+% From the 'AMS' set:
+%
+% lmmib5.tfm % identical
+% lmmib7.tfm % identical
+% lmbsy5.tfm % extra chars: 254,255 (octal)
+% lmbsy7.tfm % extra chars: 254,255 (octal)
+%
+% The two extra characters are:
+%
+% /lessorequalslant
+% /greaterorequalslant
diff --git a/Master/texmf-dist/tex/context/base/type-lua.mkiv b/Master/texmf-dist/tex/context/base/type-lua.mkiv
new file mode 100644
index 00000000000..a6799671edc
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-lua.mkiv
@@ -0,0 +1,88 @@
+%D \module
+%D [ file=type-lua,
+%D version=2009.11.27,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=\MKIV\ goodies,
+%D author=Hans Hagen \& Wolfgang Schuster,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\starttypescriptcollection [luatex]
+
+\starttypescript [specserif] [all] [name]
+ \definefontsynonym [Serif] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!default]
+ \definefontsynonym [SerifItalic] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SerifSlanted] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SerifBold] [spec:\cleanfontname\typescripttwo-\s!bold -\s!normal] [\s!features=\s!default]
+ \definefontsynonym [SerifBoldItalic] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SerifBoldSlanted] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SerifCaps] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!smallcaps]
+\stoptypescript
+
+\starttypescript [specsans] [all] [name]
+ \definefontsynonym [Sans] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!default]
+ \definefontsynonym [SansItalic] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SansSlanted] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SansBold] [spec:\cleanfontname\typescripttwo-\s!bold -\s!normal] [\s!features=\s!default]
+ \definefontsynonym [SansBoldItalic] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SansBoldSlanted] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [SansCaps] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!smallcaps]
+\stoptypescript
+
+\starttypescript [specmono] [all] [name]
+ \definefontsynonym [Mono] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!default]
+ \definefontsynonym [MonoItalic] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [MonoSlanted] [spec:\cleanfontname\typescripttwo-\s!normal-\s!italic] [\s!features=\s!default]
+ \definefontsynonym [MonoBold] [spec:\cleanfontname\typescripttwo-\s!bold -\s!normal] [\s!features=\s!default]
+ \definefontsynonym [MonoBoldItalic] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [MonoBoldSlanted] [spec:\cleanfontname\typescripttwo-\s!bold -\s!italic] [\s!features=\s!default]
+ \definefontsynonym [MonoCaps] [spec:\cleanfontname\typescripttwo-\s!normal-\s!normal] [\s!features=\s!smallcaps]
+\stoptypescript
+
+% we could combine these in the normal serif settings
+
+\starttypescript [specserif] [default] [size]
+ \definebodyfont
+ [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt] [rm]
+ [\s!default]
+\stoptypescript
+
+\starttypescript [specsans] [default] [size]
+ \definebodyfont
+ [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
+ [ss] [\s!default]
+\stoptypescript
+
+\starttypescript [specmono] [default] [size]
+ \definebodyfont
+ [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
+ [tt] [\s!default]
+\stoptypescript
+
+\starttypescript [specserif] [dtp] [size]
+ \definebodyfont
+ [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
+ [rm] [\s!default]
+\stoptypescript
+
+\starttypescript [specsans] [dtp] [size]
+ \definebodyfont
+ [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
+ [ss] [\s!default]
+\stoptypescript
+
+\starttypescript [specmono] [dtp] [size]
+ \definebodyfont
+ [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
+ [tt] [\s!default]
+\stoptypescript
+
+\stoptypescriptcollection
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-mac.mkii b/Master/texmf-dist/tex/context/base/type-mac.mkii
index feedcd43d7d..ac57726cb9c 100644
--- a/Master/texmf-dist/tex/context/base/type-mac.mkii
+++ b/Master/texmf-dist/tex/context/base/type-mac.mkii
@@ -23,6 +23,21 @@
\definetypescriptprefix [f:trebuchet] [Trebuchet MS]
\definetypescriptprefix [f:verdana] [Verdana]
+\definetypescriptprefix [n:andalemono] [AndaleMono]
+\definetypescriptprefix [n:chalkboard] [Chalkboard]
+\definetypescriptprefix [n:cochin] [Cochin]
+\definetypescriptprefix [n:comicsans] [ComicSans]
+\definetypescriptprefix [n:couriernew] [CourierNew]
+\definetypescriptprefix [n:georgia] [Georgia]
+\definetypescriptprefix [n:lucidagrande] [LucidaGrande]
+\definetypescriptprefix [n:monaco] [Monaco]
+\definetypescriptprefix [n:tahoma] [Tahoma]
+\definetypescriptprefix [n:timesnewroman] [TimesNewRoman]
+\definetypescriptprefix [n:trebuchet] [Trebuchet]
+\definetypescriptprefix [n:verdana] [Verdana]
+
+\starttypescriptcollection [macosx]
+
% American Typewriter
\starttypescript [serif] [americantypewriter-light-condensed,americantypewriter-condensed,americantypewriter-light,americantypewriter]
@@ -34,6 +49,34 @@
\definefontsynonym [AmericanTypewriter-BoldCond] [name:American Typewriter Condensed Bold] [features=default]
\stoptypescript
+\starttypescript [serif] [americantypewriter-light-condensed]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-LightCond] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Condensed] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter-condensed]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Condensed] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-BoldCond] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter-light]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Light] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Regular] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [americantypewriter-light-condensed,americantypewriter-condensed,americantypewriter-light,americantypewriter]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Arial / Arial Narrow / Arial Rounded / Arial Unicode
\starttypescript [sans] [arial-narrow,arial-condensed,arial,arial-rounded,arial-unicode]
@@ -50,6 +93,36 @@
\definefontsynonym [Arial-Rounded] [name:Arial Rounded MT Bold] [features=default]
\stoptypescript
+\starttypescript [sans] [arial-narrow,arial-condensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Condensed] [features=default]
+ \definefontsynonym [SansItalic] [Arial-ItalicCond] [features=default]
+ \definefontsynonym [SansBold] [Arial-BoldCond] [features=default]
+ \definefontsynonym [SansBoldItalic] [Arial-BoldItalicCond] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Regular] [features=default]
+ \definefontsynonym [SansItalic] [Arial-Italic] [features=default]
+ \definefontsynonym [SansBold] [Arial-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [Arial-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial-rounded]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Rounded] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial-unicode]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Unicode] [features=default]
+\stoptypescript
+
+\starttypescript [arial-narrow,arial-condensed,arial,arial-rounded,arial-unicode]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Baskerville
\starttypescript [serif] [baskerville]
@@ -61,12 +134,33 @@
\definefontsynonym [Baskerville-BoldItalic] [name:Baskerville Bold Italic] [features=default]
\stoptypescript
+\starttypescript [serif] [baskerville]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [Baskerville-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [Baskerville-Italic] [features=default]
+ \definefontsynonym [SerifBold] [Baskerville-Medium] [features=default]
+ \definefontsynonym [SerifBoldItalic] [Baskerville-MediumItalic] [features=default]
+\stoptypescript
+
+\starttypescript [baskerville]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Big Caslon
\starttypescript [serif] [caslon,bigcaslon]
\definefontsynonym [BigCaslon-Medium] [name:Big Caslon Medium] [features=default]
\stoptypescript
+\starttypescript [serif] [caslon,bigcaslon]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [BigCaslon-Medium] [features=default]
+\stoptypescript
+
+\starttypescript [caslon,bigcaslon]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Copperplate
\starttypescript [sans] [copperplate-light,copperplate]
@@ -75,6 +169,22 @@
\definefontsynonym [Copperplate-Bold] [name:Copperplate Bold] [features=default]
\stoptypescript
+\starttypescript [sans] [copperplate-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Copperplate-Light] [features=default]
+ \definefontsynonym [SansBold] [Copperplate-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [copperplate]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Copperplate-Regular] [features=default]
+ \definefontsynonym [SansBold] [Copperplate-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [copperplate-light,copperplate]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Futura
\starttypescript [sans] [futura-condensed,futura]
@@ -84,6 +194,22 @@
\definefontsynonym [Futura-BoldCond] [name:Futura Condensed ExtraBold] [features=default]
\stoptypescript
+\starttypescript [sans] [futura-condensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Futura-MediumCond] [features=default]
+ \definefontsynonym [SansBold] [Futura-BoldCond] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [futura]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Futura-Medium] [features=default]
+ \definefontsynonym [SansItalic] [Futura-MediumItalic] [features=default]
+\stoptypescript
+
+\starttypescript [futura-condensed,futura]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Gill Sans
\starttypescript [sans] [gillsans-light,gillsans]
@@ -95,6 +221,26 @@
\definefontsynonym [GillSans-BoldItalic] [name:Gill Sans Bold Italic] [features=default]
\stoptypescript
+\starttypescript [sans] [gillsans-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [GillSans-Light] [features=default]
+ \definefontsynonym [SansItalic] [GillSans-LightItalic] [features=default]
+ \definefontsynonym [SansBold] [GillSans-Regular] [features=default]
+ \definefontsynonym [SansBoldItalic] [GillSans-Italic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [gillsans]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [GillSans-Regular] [features=default]
+ \definefontsynonym [SansItalic] [GillSans-Italic] [features=default]
+ \definefontsynonym [SansBold] [GillSans-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [GillSans-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [gillsans-light,gillsans]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Helvetica Neuse
\starttypescript [sans] [helvetica-neue-ultralight,helvetica-neue-light,helvetica-neue,helvetica-neue-boldcondensed]
@@ -110,6 +256,40 @@
\definefontsynonym [HelveticaNeue-BlackCond] [name:Helvetica Neue Condensed Black] [features=default]
\stoptypescript
+\starttypescript [sans] [helvetica-neue-ultralight]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-UltraLight] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-UltraLightItalic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Light] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-LightItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-Light] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-LightItalic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Regular] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-Italic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-Regular] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-Italic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue-boldcondensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-BoldCond] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-BlackCond] [features=default]
+\stoptypescript
+
+\starttypescript [helvetica-neue-ultralight,helvetica-neue-light,helvetica-neue,helvetica-neue-boldcondensed]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Mincho
\starttypescript [serif] [hiragino-mincho]
@@ -119,6 +299,22 @@
\definefontsynonym [HiraginoMinchoProN-Bold] [name:Hiragino Mincho ProN W6] [features=japanese]
\stoptypescript
+\starttypescript [serif] [hiragino-mincho]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [HiraginoMinchoPro-Regular] [features=japanese]
+ \definefontsynonym [SerifBold] [HiraginoMinchoPro-Bold] [features=japanese]
+\stoptypescript
+
+% \starttypescript [serif] [hiragino-mincho]
+% \setups[font:fallback:serif]
+% \definefontsynonym [Serif] [HiraginoMinchoProN-Regular] [features=japanese]
+% \definefontsynonym [SerifBold] [HiraginoMinchoProN-Bold] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-mincho]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Maru
\starttypescript [sans] [hiragino-maru]
@@ -126,6 +322,20 @@
\definefontsynonym [HiraginoMaruGothicProN-Regular] [name:Hiragino Maru Gothic ProN W4] [features=japanese]
\stoptypescript
+\starttypescript [sans] [hiragino-maru]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HiraginoMaruGothicPro-Regular] [features=japanese]
+\stoptypescript
+
+% \starttypescript [sans] [hiragino-maru]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [HiraginoMaruGothicProN-Regular] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-maru]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Kaku
\starttypescript [sans] [hiragino-kaku]
@@ -137,6 +347,22 @@
\definefontsynonym [HiraginoKakuGothicStdN-Black] [name:Hiragino Kaku Gothic StdN W8] [features=japanese]
\stoptypescript
+\starttypescript [sans] [hiragino-kaku]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HiraginoKakuGothicPro-Regular] [features=japanese]
+ \definefontsynonym [SansBold] [HiraginoKakuGothicPro-Bold] [features=japanese]
+\stoptypescript
+
+% \starttypescript [sans] [hiragino-kaku]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [HiraginoKakuGothicProN-Regular] [features=japanese]
+% \definefontsynonym [SansBold] [HiraginoKakuGothicProN-Bold] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-kaku]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hoefler Text
\starttypescript [serif] [hoefler]
@@ -147,18 +373,48 @@
\definefontsynonym [HoeflerText-Ornaments] [name:Hoefler Text Ornaments] [features=default]
\stoptypescript
+\starttypescript [serif] [hoefler]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [HoeflerText-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [HoeflerText-Italic] [features=default]
+ \definefontsynonym [SerifBold] [HoeflerText-Black] [features=default]
+ \definefontsynonym [SerifBoldItalic] [HoeflerText-BlackItalic] [features=default]
+\stoptypescript
+
+\starttypescript [hoefler]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Impact
\starttypescript [sans] [impact]
\definefontsynonym [Impact-Regular] [name:Impact] [features=default]
\stoptypescript
+\starttypescript [sans] [impact]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Impact-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [impact]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Andale Mono / Monaco
\starttypescript [mono] [andalemono,monaco]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [name:\typescriptprefix{f:\typescripttwo}] [features=default]
\stoptypescript
+\starttypescript [mono] [andalemono,monaco]
+ \setups[font:fallback:mono]
+ \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [andalemono,monaco]
+ \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+\stoptypescript
+
% Optima
\starttypescript [sans] [optima,optima-bold]
@@ -169,6 +425,25 @@
\definefontsynonym [Optima-Black] [name:Optima ExtraBlack] [features=default]
\stoptypescript
+\starttypescript [sans] [optima]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Optima-Regular] [features=default]
+ \definefontsynonym [SansItalic] [Optima-Italic] [features=default]
+ \definefontsynonym [SansBold] [Optima-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [Optima-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [optima-bold]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Optima-Bold] [features=default]
+ \definefontsynonym [SansItalic] [Optima-BoldItalic] [features=default]
+ \definefontsynonym [SansBold] [Optima-Black] [features=default]
+\stoptypescript
+
+\starttypescript [optima,optima-bold]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Papyrus
\starttypescript [sans] [papyrus]
@@ -176,12 +451,30 @@
\definefontsynonym [Papyrus-Condensed] [name:Papyrus Condensed] [features=default]
\stoptypescript
+\starttypescript [sans] [papyrus]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Papyrus-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [papyrus]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% STFangsong
\starttypescript [serif] [stfangsong]
\definefontsynonym [STFangsong-Regular] [name:STFangsong] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stfangsong]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STFangsong-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stfangsong]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% STHeiti
\starttypescript [sans] [stheiti]
@@ -189,18 +482,46 @@
\definefontsynonym [STHeiti-Regular] [name:STHeiti Regular] [features=chinese]
\stoptypescript
+\starttypescript [sans] [stheiti]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [STXihei-Light] [features=chinese]
+ \definefontsynonym [SansBold] [STKaiti-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stheiti]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% STKaiti
\starttypescript [serif] [stkaiti]
\definefontsynonym [STKaiti-Regular] [name:STKaiti] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stkaiti]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STKaiti-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stkaiti]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% STSong
\starttypescript [serif] [stsong]
\definefontsynonym [STSong-Regular] [name:STSong] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stsong]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STSong-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stsong]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Chalkboard / Comic Sans / Tahoma
\starttypescript [sans] [chalkboard,comicsans,lucidagrande,tahoma]
@@ -208,6 +529,16 @@
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [name:\typescriptprefix{f:\typescripttwo} Bold] [features=default]
\stoptypescript
+\starttypescript [sans] [chalkboard,comicsans,lucidagrande,tahoma]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+ \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [chalkboard,comicsans,tahoma]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Cochin / Courier New / Georgia / Times New Roman / Trebuchet / Verdana
\starttypescript [serif,sans,mono] [cochin,georgia,timesnewroman,trebuchet,verdana,couriernew]
@@ -217,4 +548,46 @@
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [name:\typescriptprefix{f:\typescripttwo} Bold Italic] [features=default]
\stoptypescript
+\starttypescript [serif] [cochin,georgia,timesnewroman]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+ \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+ \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [cochin,georgia,timesnewroman]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
+% Courier New
+
+% \starttypescript [mono] [couriernew]
+% \setups[font:fallback:mono]
+% \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+% \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+% \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+% \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+% \stoptypescript
+
+% \starttypescript [couriernew]
+% \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+% \stoptypescript
+
+% Trebuchet / Verdana
+
+% \starttypescript [sans] [trebuchet,verdana]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+% \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+% \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+% \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+% \stoptypescript
+
+% \starttypescript [trebuchet,verdana]
+% \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+% \stoptypescript
+
+\stoptypescriptcollection
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-mac.mkiv b/Master/texmf-dist/tex/context/base/type-mac.mkiv
index 10a41588390..9856439da44 100644
--- a/Master/texmf-dist/tex/context/base/type-mac.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-mac.mkiv
@@ -23,6 +23,21 @@
\definetypescriptprefix [f:trebuchet] [trebuchetms]
\definetypescriptprefix [f:verdana] [verdana]
+\definetypescriptprefix [n:andalemono] [AndaleMono]
+\definetypescriptprefix [n:chalkboard] [Chalkboard]
+\definetypescriptprefix [n:cochin] [Cochin]
+\definetypescriptprefix [n:comicsans] [ComicSans]
+\definetypescriptprefix [n:couriernew] [CourierNew]
+\definetypescriptprefix [n:georgia] [Georgia]
+\definetypescriptprefix [n:lucidagrande] [LucidaGrande]
+\definetypescriptprefix [n:monaco] [Monaco]
+\definetypescriptprefix [n:tahoma] [Tahoma]
+\definetypescriptprefix [n:timesnewroman] [TimesNewRoman]
+\definetypescriptprefix [n:trebuchet] [Trebuchet]
+\definetypescriptprefix [n:verdana] [Verdana]
+
+\starttypescriptcollection [macosx]
+
% American Typewriter
\starttypescript [serif] [americantypewriter-light-condensed,americantypewriter-condensed,americantypewriter-light,americantypewriter]
@@ -34,6 +49,34 @@
\definefontsynonym [AmericanTypewriter-BoldCond] [name:americantypewritercondensedbold] [features=default]
\stoptypescript
+\starttypescript [serif] [americantypewriter-light-condensed]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-LightCond] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Condensed] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter-condensed]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Condensed] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-BoldCond] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter-light]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Light] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [serif] [americantypewriter]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [AmericanTypewriter-Regular] [features=default]
+ \definefontsynonym [SerifBold] [AmericanTypewriter-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [americantypewriter-light-condensed,americantypewriter-condensed,americantypewriter-light,americantypewriter]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Arial / Arial Narrow / Arial Rounded / Arial Unicode
\starttypescript [sans] [arial-narrow,arial-condensed,arial,arial-rounded,arial-unicode]
@@ -50,6 +93,36 @@
\definefontsynonym [Arial-Rounded] [name:arialroundedmtbold] [features=default]
\stoptypescript
+\starttypescript [sans] [arial-narrow,arial-condensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Condensed] [features=default]
+ \definefontsynonym [SansItalic] [Arial-ItalicCond] [features=default]
+ \definefontsynonym [SansBold] [Arial-BoldCond] [features=default]
+ \definefontsynonym [SansBoldItalic] [Arial-BoldItalicCond] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Regular] [features=default]
+ \definefontsynonym [SansItalic] [Arial-Italic] [features=default]
+ \definefontsynonym [SansBold] [Arial-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [Arial-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial-rounded]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Rounded] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [arial-unicode]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Arial-Unicode] [features=default]
+\stoptypescript
+
+\starttypescript [arial-narrow,arial-condensed,arial,arial-rounded,arial-unicode]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Baskerville
\starttypescript [serif] [baskerville]
@@ -61,12 +134,33 @@
\definefontsynonym [Baskerville-BoldItalic] [name:baskervillebolditalic] [features=default]
\stoptypescript
+\starttypescript [serif] [baskerville]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [Baskerville-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [Baskerville-Italic] [features=default]
+ \definefontsynonym [SerifBold] [Baskerville-Medium] [features=default]
+ \definefontsynonym [SerifBoldItalic] [Baskerville-MediumItalic] [features=default]
+\stoptypescript
+
+\starttypescript [baskerville]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Big Caslon
\starttypescript [serif] [caslon,bigcaslon]
\definefontsynonym [BigCaslon-Medium] [name:bigcaslonmedium] [features=default]
\stoptypescript
+\starttypescript [serif] [caslon,bigcaslon]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [BigCaslon-Medium] [features=default]
+\stoptypescript
+
+\starttypescript [caslon,bigcaslon]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Copperplate
\starttypescript [sans] [copperplate-light,copperplate]
@@ -75,6 +169,22 @@
\definefontsynonym [Copperplate-Bold] [name:copperplatebold] [features=default]
\stoptypescript
+\starttypescript [sans] [copperplate-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Copperplate-Light] [features=default]
+ \definefontsynonym [SansBold] [Copperplate-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [copperplate]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Copperplate-Regular] [features=default]
+ \definefontsynonym [SansBold] [Copperplate-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [copperplate-light,copperplate]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Futura
\starttypescript [sans] [futura-condensed,futura]
@@ -84,6 +194,22 @@
\definefontsynonym [Futura-BoldCond] [name:futuracondensedextrabold] [features=default]
\stoptypescript
+\starttypescript [sans] [futura-condensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Futura-MediumCond] [features=default]
+ \definefontsynonym [SansBold] [Futura-BoldCond] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [futura]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Futura-Medium] [features=default]
+ \definefontsynonym [SansItalic] [Futura-MediumItalic] [features=default]
+\stoptypescript
+
+\starttypescript [futura-condensed,futura]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Gill Sans
\starttypescript [sans] [gillsans-light,gillsans]
@@ -95,6 +221,26 @@
\definefontsynonym [GillSans-BoldItalic] [name:gillsansbolditalic] [features=default]
\stoptypescript
+\starttypescript [sans] [gillsans-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [GillSans-Light] [features=default]
+ \definefontsynonym [SansItalic] [GillSans-LightItalic] [features=default]
+ \definefontsynonym [SansBold] [GillSans-Regular] [features=default]
+ \definefontsynonym [SansBoldItalic] [GillSans-Italic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [gillsans]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [GillSans-Regular] [features=default]
+ \definefontsynonym [SansItalic] [GillSans-Italic] [features=default]
+ \definefontsynonym [SansBold] [GillSans-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [GillSans-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [gillsans-light,gillsans]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Helvetica Neuse
\starttypescript [sans] [helvetica-neue-ultralight,helvetica-neue-light,helvetica-neue,helvetica-neue-boldcondensed]
@@ -110,6 +256,40 @@
\definefontsynonym [HelveticaNeue-BlackCond] [name:helveticaneuecondensedblack] [features=default]
\stoptypescript
+\starttypescript [sans] [helvetica-neue-ultralight]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-UltraLight] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-UltraLightItalic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Light] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-LightItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue-light]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-Light] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-LightItalic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Regular] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-Italic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-Regular] [features=default]
+ \definefontsynonym [SansItalic] [HelveticaNeue-Italic] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [HelveticaNeue-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [helvetica-neue-boldcondensed]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HelveticaNeue-BoldCond] [features=default]
+ \definefontsynonym [SansBold] [HelveticaNeue-BlackCond] [features=default]
+\stoptypescript
+
+\starttypescript [helvetica-neue-ultralight,helvetica-neue-light,helvetica-neue,helvetica-neue-boldcondensed]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Mincho
\starttypescript [serif] [hiragino-mincho]
@@ -119,6 +299,22 @@
\definefontsynonym [HiraginoMinchoProN-Bold] [name:hiraminpronw6] [features=japanese]
\stoptypescript
+\starttypescript [serif] [hiragino-mincho]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [HiraginoMinchoPro-Regular] [features=japanese]
+ \definefontsynonym [SerifBold] [HiraginoMinchoPro-Bold] [features=japanese]
+\stoptypescript
+
+% \starttypescript [serif] [hiragino-mincho]
+% \setups[font:fallback:serif]
+% \definefontsynonym [Serif] [HiraginoMinchoProN-Regular] [features=japanese]
+% \definefontsynonym [SerifBold] [HiraginoMinchoProN-Bold] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-mincho]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Maru
\starttypescript [sans] [hiragino-maru]
@@ -126,6 +322,20 @@
\definefontsynonym [HiraginoMaruGothicProN-Regular] [name:hiramarupronw4] [features=japanese]
\stoptypescript
+\starttypescript [sans] [hiragino-maru]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HiraginoMaruGothicPro-Regular] [features=japanese]
+\stoptypescript
+
+% \starttypescript [sans] [hiragino-maru]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [HiraginoMaruGothicProN-Regular] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-maru]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hiragino Kaku
\starttypescript [sans] [hiragino-kaku]
@@ -137,6 +347,22 @@
\definefontsynonym [HiraginoKakuGothicStdN-Black] [name:hirakakustdnw8] [features=japanese]
\stoptypescript
+\starttypescript [sans] [hiragino-kaku]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [HiraginoKakuGothicPro-Regular] [features=japanese]
+ \definefontsynonym [SansBold] [HiraginoKakuGothicPro-Bold] [features=japanese]
+\stoptypescript
+
+% \starttypescript [sans] [hiragino-kaku]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [HiraginoKakuGothicProN-Regular] [features=japanese]
+% \definefontsynonym [SansBold] [HiraginoKakuGothicProN-Bold] [features=japanese]
+% \stoptypescript
+
+\starttypescript [hiragino-kaku]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Hoefler Text
\starttypescript [serif] [hoefler]
@@ -147,18 +373,48 @@
\definefontsynonym [HoeflerText-Ornaments] [name:hoeflertextornaments] [features=default]
\stoptypescript
+\starttypescript [serif] [hoefler]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [HoeflerText-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [HoeflerText-Italic] [features=default]
+ \definefontsynonym [SerifBold] [HoeflerText-Black] [features=default]
+ \definefontsynonym [SerifBoldItalic] [HoeflerText-BlackItalic] [features=default]
+\stoptypescript
+
+\starttypescript [hoefler]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Impact
\starttypescript [sans] [impact]
\definefontsynonym [Impact-Regular] [name:impact] [features=default]
\stoptypescript
+\starttypescript [sans] [impact]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Impact-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [impact]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Andale Mono / Monaco
\starttypescript [mono] [andalemono,monaco]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [name:\typescriptprefix{f:\typescripttwo}] [features=default]
\stoptypescript
+\starttypescript [mono] [andalemono,monaco]
+ \setups[font:fallback:mono]
+ \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [andalemono,monaco]
+ \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+\stoptypescript
+
% Optima
\starttypescript [sans] [optima,optima-bold]
@@ -169,6 +425,25 @@
\definefontsynonym [Optima-Black] [name:optimaextrablack] [features=default]
\stoptypescript
+\starttypescript [sans] [optima]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Optima-Regular] [features=default]
+ \definefontsynonym [SansItalic] [Optima-Italic] [features=default]
+ \definefontsynonym [SansBold] [Optima-Bold] [features=default]
+ \definefontsynonym [SansBoldItalic] [Optima-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [sans] [optima-bold]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Optima-Bold] [features=default]
+ \definefontsynonym [SansItalic] [Optima-BoldItalic] [features=default]
+ \definefontsynonym [SansBold] [Optima-Black] [features=default]
+\stoptypescript
+
+\starttypescript [optima,optima-bold]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Papyrus
\starttypescript [sans] [papyrus]
@@ -176,12 +451,30 @@
\definefontsynonym [Papyrus-Condensed] [name:papyruscondensed] [features=default]
\stoptypescript
+\starttypescript [sans] [papyrus]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Papyrus-Regular] [features=default]
+\stoptypescript
+
+\starttypescript [papyrus]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% STFangsong
\starttypescript [serif] [stfangsong]
\definefontsynonym [STFangsong-Regular] [name:stfangsong] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stfangsong]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STFangsong-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stfangsong]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% STHeiti
\starttypescript [sans] [stheiti]
@@ -189,18 +482,46 @@
\definefontsynonym [STHeiti-Regular] [name:stheiti] [features=chinese]
\stoptypescript
+\starttypescript [sans] [stheiti]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [STXihei-Light] [features=chinese]
+ \definefontsynonym [SansBold] [STKaiti-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stheiti]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% STKaiti
\starttypescript [serif] [stkaiti]
\definefontsynonym [STKaiti-Regular] [name:stkaiti] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stkaiti]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STKaiti-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stkaiti]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% STSong
\starttypescript [serif] [stsong]
\definefontsynonym [STSong-Regular] [name:stsong] [features=chinese]
\stoptypescript
+\starttypescript [serif] [stsong]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Serif] [STSong-Regular] [features=chinese]
+\stoptypescript
+
+\starttypescript [stsong]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
% Chalkboard / Comic Sans / Tahoma
\starttypescript [sans] [chalkboard,comicsans,tahoma]
@@ -208,6 +529,16 @@
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [name:\typescriptprefix{f:\typescripttwo}bold] [features=default]
\stoptypescript
+\starttypescript [sans] [chalkboard,comicsans,lucidagrande,tahoma]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+ \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+\stoptypescript
+
+\starttypescript [chalkboard,comicsans,tahoma]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+\stoptypescript
+
% Cochin / Courier New / Georgia / Times New Roman / Trebuchet / Verdana
\starttypescript [serif,sans,mono] [cochin,georgia,timesnewroman,trebuchet,verdana,couriernew]
@@ -217,4 +548,46 @@
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [name:\typescriptprefix{f:\typescripttwo}bolditalic] [features=default]
\stoptypescript
+\starttypescript [serif] [cochin,georgia,timesnewroman]
+ \setups[font:fallback:serif]
+ \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+ \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+ \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+ \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+\stoptypescript
+
+\starttypescript [cochin,georgia,timesnewroman]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+\stoptypescript
+
+% Courier New
+
+% \starttypescript [mono] [couriernew]
+% \setups[font:fallback:mono]
+% \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+% \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+% \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+% \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+% \stoptypescript
+
+% \starttypescript [couriernew]
+% \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+% \stoptypescript
+
+% Trebuchet / Verdana
+
+% \starttypescript [sans] [trebuchet,verdana]
+% \setups[font:fallback:sans]
+% \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
+% \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
+% \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
+% \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
+% \stoptypescript
+
+% \starttypescript [trebuchet,verdana]
+% \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+% \stoptypescript
+
+\stoptypescriptcollection
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-mac.tex b/Master/texmf-dist/tex/context/base/type-mac.tex
deleted file mode 100644
index 04ac6139b2f..00000000000
--- a/Master/texmf-dist/tex/context/base/type-mac.tex
+++ /dev/null
@@ -1,434 +0,0 @@
-%D \module
-%D [ file=type-mac,
-%D version=2009.03.10,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Mac OS X Definitions,
-%D author=Wolfgang Schuster,
-%D date=\currentdate,
-%D copyright=Wolfgang Schuster]
-%C
-%C This module is part of the \CONTEXT\ macro||package. See
-%C mreadme.pdf for details.
-
-\starttypescriptcollection [macosx]
-
-\definetypescriptprefix [n:andalemono] [AndaleMono]
-\definetypescriptprefix [n:chalkboard] [Chalkboard]
-\definetypescriptprefix [n:cochin] [Cochin]
-\definetypescriptprefix [n:comicsans] [ComicSans]
-\definetypescriptprefix [n:couriernew] [CourierNew]
-\definetypescriptprefix [n:georgia] [Georgia]
-\definetypescriptprefix [n:lucidagrande] [LucidaGrande]
-\definetypescriptprefix [n:monaco] [Monaco]
-\definetypescriptprefix [n:tahoma] [Tahoma]
-\definetypescriptprefix [n:timesnewroman] [TimesNewRoman]
-\definetypescriptprefix [n:trebuchet] [Trebuchet]
-\definetypescriptprefix [n:verdana] [Verdana]
-
-% American Typewriter
-
-\starttypescript [serif] [americantypewriter-light-condensed]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [AmericanTypewriter-LightCond] [features=default]
- \definefontsynonym [SerifBold] [AmericanTypewriter-Condensed] [features=default]
-\stoptypescript
-
-\starttypescript [serif] [americantypewriter-condensed]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [AmericanTypewriter-Condensed] [features=default]
- \definefontsynonym [SerifBold] [AmericanTypewriter-BoldCond] [features=default]
-\stoptypescript
-
-\starttypescript [serif] [americantypewriter-light]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [AmericanTypewriter-Light] [features=default]
- \definefontsynonym [SerifBold] [AmericanTypewriter-Regular] [features=default]
-\stoptypescript
-
-\starttypescript [serif] [americantypewriter]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [AmericanTypewriter-Regular] [features=default]
- \definefontsynonym [SerifBold] [AmericanTypewriter-Bold] [features=default]
-\stoptypescript
-
-\starttypescript [americantypewriter-light-condensed,americantypewriter-condensed,americantypewriter-light,americantypewriter]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Arial / Arial Narrow / Arial Rounded / Arial Unicode
-
-\starttypescript [sans] [arial-narrow,arial-condensed]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Arial-Condensed] [features=default]
- \definefontsynonym [SansItalic] [Arial-ItalicCond] [features=default]
- \definefontsynonym [SansBold] [Arial-BoldCond] [features=default]
- \definefontsynonym [SansBoldItalic] [Arial-BoldItalicCond] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [arial]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Arial-Regular] [features=default]
- \definefontsynonym [SansItalic] [Arial-Italic] [features=default]
- \definefontsynonym [SansBold] [Arial-Bold] [features=default]
- \definefontsynonym [SansBoldItalic] [Arial-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [arial-rounded]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Arial-Rounded] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [arial-unicode]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Arial-Unicode] [features=default]
-\stoptypescript
-
-\starttypescript [arial-narrow,arial-condensed,arial,arial-rounded,arial-unicode]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Baskerville
-
-\starttypescript [serif] [baskerville]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [Baskerville-Regular] [features=default]
- \definefontsynonym [SerifItalic] [Baskerville-Italic] [features=default]
- \definefontsynonym [SerifBold] [Baskerville-Medium] [features=default]
- \definefontsynonym [SerifBoldItalic] [Baskerville-MediumItalic] [features=default]
-\stoptypescript
-
-\starttypescript [baskerville]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Big Caslon
-
-\starttypescript [serif] [caslon,bigcaslon]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [BigCaslon-Medium] [features=default]
-\stoptypescript
-
-\starttypescript [caslon,bigcaslon]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Copperplate
-
-\starttypescript [sans] [copperplate-light]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Copperplate-Light] [features=default]
- \definefontsynonym [SansBold] [Copperplate-Regular] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [copperplate]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Copperplate-Regular] [features=default]
- \definefontsynonym [SansBold] [Copperplate-Bold] [features=default]
-\stoptypescript
-
-\starttypescript [copperplate-light,copperplate]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Courier New
-
-\starttypescript [mono] [couriernew]
- \setups[font:fallback:mono]
- \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
- \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
- \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
- \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [couriernew]
- \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
-\stoptypescript
-
-% Futura
-
-\starttypescript [sans] [futura-condensed]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Futura-MediumCond] [features=default]
- \definefontsynonym [SansBold] [Futura-BoldCond] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [futura]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Futura-Medium] [features=default]
- \definefontsynonym [SansItalic] [Futura-MediumItalic] [features=default]
-\stoptypescript
-
-\starttypescript [futura-condensed,futura]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Gill Sans
-
-\starttypescript [sans] [gillsans-light]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [GillSans-Light] [features=default]
- \definefontsynonym [SansItalic] [GillSans-LightItalic] [features=default]
- \definefontsynonym [SansBold] [GillSans-Regular] [features=default]
- \definefontsynonym [SansBoldItalic] [GillSans-Italic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [gillsans]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [GillSans-Regular] [features=default]
- \definefontsynonym [SansItalic] [GillSans-Italic] [features=default]
- \definefontsynonym [SansBold] [GillSans-Bold] [features=default]
- \definefontsynonym [SansBoldItalic] [GillSans-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [gillsans-light,gillsans]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Helvetica Neuse
-
-\starttypescript [sans] [helvetica-neue-ultralight]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HelveticaNeue-UltraLight] [features=default]
- \definefontsynonym [SansItalic] [HelveticaNeue-UltraLightItalic] [features=default]
- \definefontsynonym [SansBold] [HelveticaNeue-Light] [features=default]
- \definefontsynonym [SansBoldItalic] [HelveticaNeue-LightItalic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [helvetica-neue-light]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HelveticaNeue-Light] [features=default]
- \definefontsynonym [SansItalic] [HelveticaNeue-LightItalic] [features=default]
- \definefontsynonym [SansBold] [HelveticaNeue-Regular] [features=default]
- \definefontsynonym [SansBoldItalic] [HelveticaNeue-Italic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [helvetica-neue]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HelveticaNeue-Regular] [features=default]
- \definefontsynonym [SansItalic] [HelveticaNeue-Italic] [features=default]
- \definefontsynonym [SansBold] [HelveticaNeue-Bold] [features=default]
- \definefontsynonym [SansBoldItalic] [HelveticaNeue-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [helvetica-neue-boldcondensed]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HelveticaNeue-BoldCond] [features=default]
- \definefontsynonym [SansBold] [HelveticaNeue-BlackCond] [features=default]
-\stoptypescript
-
-\starttypescript [helvetica-neue-ultralight,helvetica-neue-light,helvetica-neue,helvetica-neue-boldcondensed]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Hiragino Mincho
-
-\starttypescript [serif] [hiragino-mincho]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [HiraginoMinchoPro-Regular] [features=japanese]
- \definefontsynonym [SerifBold] [HiraginoMinchoPro-Bold] [features=japanese]
-\stoptypescript
-
-% \starttypescript [serif] [hiragino-mincho]
-% \setups[font:fallback:serif]
-% \definefontsynonym [Serif] [HiraginoMinchoProN-Regular] [features=japanese]
-% \definefontsynonym [SerifBold] [HiraginoMinchoProN-Bold] [features=japanese]
-% \stoptypescript
-
-\starttypescript [hiragino-mincho]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Hiragino Maru
-
-\starttypescript [sans] [hiragino-maru]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HiraginoMaruGothicPro-Regular] [features=japanese]
-\stoptypescript
-
-% \starttypescript [sans] [hiragino-maru]
-% \setups[font:fallback:sans]
-% \definefontsynonym [Sans] [HiraginoMaruGothicProN-Regular] [features=japanese]
-% \stoptypescript
-
-\starttypescript [hiragino-maru]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Hiragino Kaku
-
-\starttypescript [sans] [hiragino-kaku]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [HiraginoKakuGothicPro-Regular] [features=japanese]
- \definefontsynonym [SansBold] [HiraginoKakuGothicPro-Bold] [features=japanese]
-\stoptypescript
-
-% \starttypescript [sans] [hiragino-kaku]
-% \setups[font:fallback:sans]
-% \definefontsynonym [Sans] [HiraginoKakuGothicProN-Regular] [features=japanese]
-% \definefontsynonym [SansBold] [HiraginoKakuGothicProN-Bold] [features=japanese]
-% \stoptypescript
-
-\starttypescript [hiragino-kaku]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Hoefler Text
-
-\starttypescript [serif] [hoefler]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [HoeflerText-Regular] [features=default]
- \definefontsynonym [SerifItalic] [HoeflerText-Italic] [features=default]
- \definefontsynonym [SerifBold] [HoeflerText-Black] [features=default]
- \definefontsynonym [SerifBoldItalic] [HoeflerText-BlackItalic] [features=default]
-\stoptypescript
-
-\starttypescript [hoefler]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Impact
-
-\starttypescript [sans] [impact]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Impact-Regular] [features=default]
-\stoptypescript
-
-\starttypescript [impact]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Andale Mono / Monaco
-
-\starttypescript [mono] [andalemono,monaco]
- \setups[font:fallback:mono]
- \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
-\stoptypescript
-
-\starttypescript [andalemono,monaco]
- \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
-\stoptypescript
-
-% Optima
-
-\starttypescript [sans] [optima]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Optima-Regular] [features=default]
- \definefontsynonym [SansItalic] [Optima-Italic] [features=default]
- \definefontsynonym [SansBold] [Optima-Bold] [features=default]
- \definefontsynonym [SansBoldItalic] [Optima-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [sans] [optima-bold]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Optima-Bold] [features=default]
- \definefontsynonym [SansItalic] [Optima-BoldItalic] [features=default]
- \definefontsynonym [SansBold] [Optima-Black] [features=default]
-\stoptypescript
-
-\starttypescript [optima,optima-bold]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Papyrus
-
-\starttypescript [sans] [papyrus]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Papyrus-Regular] [features=default]
-\stoptypescript
-
-\starttypescript [papyrus]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% STFangsong
-
-\starttypescript [serif] [stfangsong]
- \setups[font:fallback:sans]
- \definefontsynonym [Serif] [STFangsong-Regular] [features=chinese]
-\stoptypescript
-
-\starttypescript [stfangsong]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% STHeiti
-
-\starttypescript [sans] [stheiti]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [STXihei-Light] [features=chinese]
- \definefontsynonym [SansBold] [STKaiti-Regular] [features=chinese]
-\stoptypescript
-
-\starttypescript [stheiti]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% STKaiti
-
-\starttypescript [serif] [stkaiti]
- \setups[font:fallback:sans]
- \definefontsynonym [Serif] [STKaiti-Regular] [features=chinese]
-\stoptypescript
-
-\starttypescript [stkaiti]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% STSong
-
-\starttypescript [serif] [stsong]
- \setups[font:fallback:sans]
- \definefontsynonym [Serif] [STSong-Regular] [features=chinese]
-\stoptypescript
-
-\starttypescript [stsong]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Chalkboard / Comic Sans / Tahoma
-
-\starttypescript [sans] [chalkboard,comicsans,lucidagrande,tahoma]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
- \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
-\stoptypescript
-
-\starttypescript [chalkboard,comicsans,tahoma]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-% Cochin / Georgia / Times New Roman
-
-\starttypescript [serif] [cochin,georgia,timesnewroman]
- \setups[font:fallback:serif]
- \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
- \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
- \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
- \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [cochin,georgia,timesnewroman]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
-\stoptypescript
-
-% Trebuchet / Verdana
-
-\starttypescript [sans] [trebuchet,verdana]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] [features=default]
- \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] [features=default]
- \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] [features=default]
- \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] [features=default]
-\stoptypescript
-
-\starttypescript [trebuchet,verdana]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
-\stoptypescript
-
-\stoptypescriptcollection
-
-% XeTeX / LuaTeX font names
-
-\loadmarkfile{type-mac}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-msw.mkii b/Master/texmf-dist/tex/context/base/type-msw.mkii
new file mode 100644
index 00000000000..26ec190cbee
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-msw.mkii
@@ -0,0 +1 @@
+\input type-win.mkii \endinput % could be a file synonym
diff --git a/Master/texmf-dist/tex/context/base/type-msw.mkiv b/Master/texmf-dist/tex/context/base/type-msw.mkiv
new file mode 100644
index 00000000000..2e741f7a04b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-msw.mkiv
@@ -0,0 +1 @@
+\input type-win.mkiv \endinput % could be a file synonym
diff --git a/Master/texmf-dist/tex/context/base/type-one.mkii b/Master/texmf-dist/tex/context/base/type-one.mkii
index b456d7e6438..efe31ed2114 100644
--- a/Master/texmf-dist/tex/context/base/type-one.mkii
+++ b/Master/texmf-dist/tex/context/base/type-one.mkii
@@ -24,1161 +24,2724 @@
% \setupbodyfont[reset] \setupbodyfont[cmr]
% \starttext \showfont[Serif] \stoptext
-\starttypescriptcollection[examples]
-
-\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 [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
-
-\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 [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
-
-% handy
-
-\starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it
- \definefontsynonym [Simple] [cmvtt10]
- \setupfontsynonym [Simple] [handling=pure]
-\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 [optima] [texnansi,ec,qx]
- \definetypeface[optima][ss][sans] [optima-nova][default][encoding=\typescripttwo]
- \definetypeface[optima][rm][serif][palatino] [default][encoding=\typescripttwo]
- \definetypeface[optima][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1]
- \definetypeface[optima][mm][math] [palatino] [default][encoding=\typescripttwo]
- \quittypescriptscanning
-\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
-
-\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 [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
-
-\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
+\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[typeone]
-
-\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
-
-% Euler (AMS)
-
-\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
-
-% AMS (AMS)
-
-\starttypescript [math] [modern,computer-modern,latin-modern,ams] [default]
- \definefontsynonym [AMS-SymbolA] [msam10]
- \definefontsynonym [AMS-SymbolB] [msbm10]
- \usemathcollection[default]
-\stoptypescript
-
-% Fourier (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] [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
-
-% 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
-
-% Antykwa Poltawskiego (GUST)
-
-\starttypescript [serif] [antykwa-poltawskiego] [texnansi,ec,8r]
- \definefontsynonym [AntykwaPoltawskiego-Regular] [\typescriptthree-antpr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Bold] [\typescriptthree-antpb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Italic] [\typescriptthree-antpri] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\typescriptthree-antpbi] [encoding=\typescriptthree]
- \loadmapfile[\typescriptthree-public-antp.map]
-\stoptypescript
-
-% Iwona (JMN)
-
-% 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-iwonarcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsLight-Regular] [\typescriptthree-iwonalcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsLight-Italic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsMedium-Regular] [\typescriptthree-iwonamcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsMedium-Italic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsHeavy-Regular] [\typescriptthree-iwonahcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsHeavy-Italic] [\typescriptthree-iwonahicap] [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-iwonacrcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondLight-Regular] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondLight-Italic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondMedium-Regular][\typescriptthree-iwonacmcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondMedium-Italic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondHeavy-Regular] [\typescriptthree-iwonachcap] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondHeavy-Italic] [\typescriptthree-iwonachicap] [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
-
-% Kurier (JMN)
-
-\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 [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
-
-% Utopia (Adobe)
-
-\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
-
-% Charter (Bitstream)
-
-\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
-
-% Whatever else we need:
-
-\starttypescript
- \definefontsynonym [ZapfDingbats] [uzdr]
- \definefontsynonym [RalfSmithFormalScript] [rsfs10]
- \definefontsynonym [MartinVogel] [fmvr8x]
-\stoptypescript
-
-%
-% TeXGyre
-%
-% We now use tex-gyre fonts by default ...
-
-\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] [chorus,chancery] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definefontsynonym [TeXGyreChorus-MediumItalic] [\typescriptthree-qzcmi] [encoding=\typescriptthree]
- \loadmapfile[qzc-\typescriptthree.map]
-\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
-
-% Palatino Math (px)
-
-\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
-
-% Times Math (tx)
-
-\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
-
-%D These are just fallbacks in case anyone stil uses the 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
-%
-% 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
-%
-% 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
-%
-% 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
-%
-% 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
-%
-% 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
-%
-% TeXGyreChorus
-%
-\starttypescript [calligraphy] [chancery]
- \definefontsynonym [Chancery] [TeXGyreChorus-MediumItalic]
-\stoptypescript
+\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-SemiExtended-Light] [\typescriptthree-antpl8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-LightItalic] [\typescriptthree-antpli8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Regular] [\typescriptthree-antpr8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Italic] [\typescriptthree-antpri8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Medium] [\typescriptthree-antpm8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-MediumItalic] [\typescriptthree-antpmi8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Bold] [\typescriptthree-antpb8] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-BoldItalic] [\typescriptthree-antpbi8] [encoding=\typescriptthree]
+
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLight] [\typescriptthree-antpl8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLightItalic] [\typescriptthree-antpli8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsRegular] [\typescriptthree-antpr8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsItalic] [\typescriptthree-antpri8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMedium] [\typescriptthree-antpm8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMediumItalic] [\typescriptthree-antpmi8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBold] [\typescriptthree-antpb8-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBoldItalic] [\typescriptthree-antpbi8-sc] [encoding=\typescriptthree]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Light] [\typescriptthree-antpl6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-LightItalic] [\typescriptthree-antpli6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Regular] [\typescriptthree-antpr6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Italic] [\typescriptthree-antpri6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Medium] [\typescriptthree-antpm6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-MediumItalic] [\typescriptthree-antpmi6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Bold] [\typescriptthree-antpb6] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-BoldItalic] [\typescriptthree-antpbi6] [encoding=\typescriptthree]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLight] [\typescriptthree-antpl6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLightItalic] [\typescriptthree-antpli6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsRegular] [\typescriptthree-antpr6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsItalic] [\typescriptthree-antpri6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMedium] [\typescriptthree-antpm6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMediumItalic] [\typescriptthree-antpmi6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBold] [\typescriptthree-antpb6-sc] [encoding=\typescriptthree]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBoldItalic] [\typescriptthree-antpbi6-sc] [encoding=\typescriptthree]
+
+ \loadmapfile[poltawski-\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-iwonarcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsLight-Regular] [\typescriptthree-iwonalcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsLight-Italic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsMedium-Regular] [\typescriptthree-iwonamcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsMedium-Italic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsHeavy-Regular] [\typescriptthree-iwonahcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsHeavy-Italic] [\typescriptthree-iwonahicap] [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-iwonacrcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondLight-Regular] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondLight-Italic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondMedium-Regular][\typescriptthree-iwonacmcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondMedium-Italic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondHeavy-Regular] [\typescriptthree-iwonachcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsCondHeavy-Italic] [\typescriptthree-iwonachicap] [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] [fmvr8x]
+ \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] [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]
+
+ \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
diff --git a/Master/texmf-dist/tex/context/base/type-one.mkiv b/Master/texmf-dist/tex/context/base/type-one.mkiv
index 6f64dff0a4a..fa5d9b08a70 100644
--- a/Master/texmf-dist/tex/context/base/type-one.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-one.mkiv
@@ -11,6 +11,103 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% We use open type fonts in \MKIV.
+% We use open type fonts in \MKIV. However we can still use type
+% one fonts but there are not that many useful left that only
+% come in type one.
+
+\starttypescriptcollection[allkindofafm]
+
+ % \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
+
+ % \starttypescript [calligraphy] [chancery] [name]
+ % \definefontsynonym [Calligraphy] [Chancery]
+ % \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
+
+ % \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] [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
+
+ % \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 [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
+
+ % \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
+
+ % \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
+
+\stoptypescriptcollection
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-otf.mkii b/Master/texmf-dist/tex/context/base/type-otf.mkii
index 869555688b6..1e22a9df244 100644
--- a/Master/texmf-dist/tex/context/base/type-otf.mkii
+++ b/Master/texmf-dist/tex/context/base/type-otf.mkii
@@ -16,519 +16,2017 @@
%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]
+ \definetypeface [] [ss] [sans] [modern] [computer-modern]
+ \definetypeface [] [tt] [mono] [modern] [computer-modern]
+ \definetypeface [] [mm] [math] [modern] [computer-modern]
+ \quittypescriptscanning
+\stoptypescript
+
+% faster
+%
+% \starttypescript [fallback]
+% \definetypeface [] [rm] [serif] [modern] [default]
+% \definetypeface [] [ss] [sans] [modern] [default]
+% \definetypeface [] [tt] [mono] [modern] [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[opentype]
-
-%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
+\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]
+ \definetypeface [modern] [ss] [sans] [modern] [computer-modern]
+ \definetypeface [modern] [tt] [mono] [modern] [computer-modern]
+ \definetypeface [modern] [mm] [math] [modern] [computer-modern]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modern-base]
+ \definetypeface [modern] [rm] [serif] [modern] [default]
+ \definetypeface [modern] [ss] [sans] [modern] [default]
+ \definetypeface [modern] [tt] [mono] [modern] [default]
+ \definetypeface [modern] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modernvariable]
+ \definetypeface [modernvariable] [rm] [serif] [simple] [default]
+ \definetypeface [modernvariable] [ss] [sans] [modern] [default]
+ \definetypeface [modernvariable] [tt] [mono] [modern] [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
-\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
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[concrete]
-\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
+ % Computer Concrete (AMS)
-\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 [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
-\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
+\stoptypescriptcollection
-% Computer Concrete (AMS)
+\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
-\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
-% Euler (AMS)
+\starttypescriptcollection[amssymbols]
-\starttypescript [math] [euler]
- \definefontsynonym [Euler-Roman] [zeurm10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol] [zeusm10]
- \definefontsynonym [Euler-Fraktur] [eufm10]
+ \starttypescript [math] [modern,computer-modern,latin-modern,ams] [name]
+ \definefontsynonym [MathAlpha] [AMS-SymbolA]
+ \definefontsynonym [MathBeta] [AMS-SymbolB]
+ \stoptypescript
- \loadmapfile[original-ams-euler.map]
-\stoptypescript
+ \starttypescript [math] [modern,computer-modern,latin-modern,ams]
+ \definefontsynonym [AMS-SymbolA] [msam10]
+ \definefontsynonym [AMS-SymbolB] [msbm10]
+ \stoptypescript
-\starttypescript [boldmath,bfmath] [euler]
- \definefontsynonym [Euler-Roman-Bold] [zeurb10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol-Bold] [zeusb10]
- \definefontsynonym [Euler-Fraktur-Bold] [eufb10]
+\stoptypescriptcollection
- \loadmapfile[original-ams-euler.map]
-\stoptypescript
+\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]
+ \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [rscale=0.9]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [mm] [math] [times] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [palatino,pagella]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.075]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.075]
+ \definetypeface [\typescriptone] [mm] [math] [palatino] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [schoolbook,schola]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [bookman,bonum]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [chancery,chorus]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [helvetica,heros]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.15]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [avantgarde,adventor]
+ \definetypeface [\typescriptone] [ss] [sans] [adventor] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [courier,cursor]
+ \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
-% AMS (AMS)
+\stoptypescriptcollection
-\starttypescript [math] [modern,computer-modern,latin-modern,ams]
- \definefontsynonym [AMS-SymbolA] [msam10]
- \definefontsynonym [AMS-SymbolB] [msbm10]
-\stoptypescript
+\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] [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
-% 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
-
-% name definitions & prefixes
-% \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
+\stoptypescriptcollection
-\starttypescript [serif,calligraphy] [chorus,chancery]
- \definefontsynonym [TeXGyreChorus-MediumItalic] [file:texgyrechorus-mediumitalic] [features=default]
-\stoptypescript
+\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]
+ \definetypeface[antykwa][ss][sans] [modern] [default,rscale=1.05]
+ \definetypeface[antykwa][tt][mono] [modern] [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
+
+ \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:AntPoltMdCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Condensed-MediumItalic] [\s!file:AntPoltMdCond-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:AntPoltMdCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMediumItalic] [\s!file:AntPoltMdCond-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-Regular] [\s!file:AntPoltLtSemiCond-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Italic] [\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:AntPoltMdSemiCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-MediumItalic] [\s!file:AntPoltMdSemiCond-BdItalic] [\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-CapsRegular] [\s!file:AntPoltLtSemiCond-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsItalic] [\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:AntPoltMdSemiCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMediumItalic] [\s!file:AntPoltMdSemiCond-BdItalic] [\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:AntPoltMd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-MediumItalic] [\s!file:AntPoltMd-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:AntPoltLt-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-CapsLightItalic] [\s!file:AntPoltLt-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:AntPoltMd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-CapsMediumItalic] [\s!file:AntPoltMd-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-SemiExtended-Light] [\s!file:AntPoltLtSemiExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-LightItalic] [\s!file:AntPoltLtSemiExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Regular] [\s!file:AntPoltSemiExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Italic] [\s!file:AntPoltSemiExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Medium] [\s!file:AntPoltMdSemiExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-MediumItalic] [\s!file:AntPoltMdSemiExtd-BdItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Bold] [\s!file:AntPoltSemiExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-BoldItalic] [\s!file:AntPoltSemiExtd-BoldItalic] [\s!features=\s!default]
+
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLight] [\s!file:AntPoltLtSemiExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLightItalic] [\s!file:AntPoltLtSemiExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsRegular] [\s!file:AntPoltSemiExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsItalic] [\s!file:AntPoltSemiExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMedium] [\s!file:AntPoltMdSemiExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMediumItalic] [\s!file:AntPoltMdSemiExtd-BdItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBold] [\s!file:AntPoltSemiExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBoldItalic] [\s!file:AntPoltSemiExtd-BoldItalic] [\s!features=\s!smallcaps]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Light] [\s!file:AntPoltLtExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-LightItalic] [\s!file:AntPoltLtExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Regular] [\s!file:AntPoltExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Italic] [\s!file:AntPoltExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Medium] [\s!file:AntPoltMdExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-MediumItalic] [\s!file:AntPoltMdExtd-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Bold] [\s!file:AntPoltExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-BoldItalic] [\s!file:AntPoltExtd-BoldItalic] [\s!features=\s!default]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLight] [\s!file:AntPoltLtExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLightItalic] [\s!file:AntPoltLtExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsRegular] [\s!file:AntPoltExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsItalic] [\s!file:AntPoltExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMedium] [\s!file:AntPoltMdExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMediumItalic] [\s!file:AntPoltMdExtd-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBold] [\s!file:AntPoltExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBoldItalic] [\s!file:AntPoltExtd-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]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.05]
+ \quittypescriptscanning
+ \stoptypescript
-% Times Math (tx)
-
-\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
+\stoptypescriptcollection
-% Palatino Math (px)
-
-\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
+\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]
+ \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]
+ \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default]
+ \definetypeface[\typescriptone][rm][serif][modern] [default]
+ \definetypeface[\typescriptone][tt][mono] [modern] [default]
+ \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][text=ss]
+ \quittypescriptscanning
+ \stoptypescript
-% 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
+\stoptypescriptcollection
-\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
+\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
-\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
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[symbols]
-\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
+ \definefontsynonym [ZapfDingbats] [uzdr]
+ \definefontsynonym [RalfSmithFormalScript] [rsfs10]
+ \definefontsynonym [MartinVogel] [fmvr8x]
+ \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
+\stoptypescriptcollection
-% Antykwa Poltawskiego (GUST)
+\starttypescriptcollection[charter]
-\starttypescript [serif] [antykwa-poltawskiego]
- \definefontsynonym [AntykwaPoltawskiego-Regular] [antpr]
- \definefontsynonym [AntykwaPoltawskiego-Bold] [antpb]
- \definefontsynonym [AntykwaPoltawskiego-Italic] [antpri]
- \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [antpbi]
-\stoptypescript
+ % is this ok?
-% Iwona (JMN)
-
-% 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]
+ \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
-\stoptypescript
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[postscript]
-\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 [postscript]
+ \definetypeface [postscript] [rm] [serif] [times] [default]
+ \definetypeface [postscript] [ss] [sans] [helvetica] [default] [rscale=0.9]
+ \definetypeface [postscript] [tt] [mono] [courier] [default] [rscale=1.1]
+ \definetypeface [postscript] [mm] [math] [times] [default]
+ \quittypescriptscanning
+ \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
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[lucida]
-\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
+ \definetypescriptprefix [e:ec] [8t]
+ \definetypescriptprefix [e:texnansi] [8y]
+ \definetypescriptprefix [e:8r] [8r]
-% Kurier (JMN) / no open type fonts
-
-\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
+ % Lucida Bright
-\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 [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
-\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
+ \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]
-\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
+ \loadmapfile[lucida.map]
+ \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
+ % Lucida Bright Sans
-\starttypescript [iwona,iwona-light,iwona-medium,iwona-heavy]
- \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default]
- \definetypeface[\typescriptone][rm][serif][modern] [default]
- \definetypeface[\typescriptone][tt][mono] [modern] [default][rscale=1.05]
- \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][text=ss]
- \quittypescriptscanning
-\stoptypescript
+ \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
-% Whatever else we need:
+ \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]
-\starttypescript
- \definefontsynonym [ZapfDingbats] [uzdr]
- \definefontsynonym [RalfSmithFormalScript] [rsfs10]
- \definefontsynonym [MartinVogel] [fmvr8x]
-\stoptypescript
+ \loadmapfile[lucida.map]
+ \stoptypescript
-% Temp here
+ % Lucida Bright Typewriter
-\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
+ \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] [texnansi,ec,8r]
+ \definefontsynonym [LucidaBright] [hlcrm] % [encoding=\typescriptthree]
+ \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
+ \loadmapfile [lucida.map]
+ \stoptypescript
+
+ \starttypescript [boldmath,bfmath] [lucida] [texnansi,ec,8r]
+ \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 [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[lucida.map]
+ \stoptypescript
\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/type-otf.mkiv b/Master/texmf-dist/tex/context/base/type-otf.mkiv
index 1efd5448870..486fa1a57f0 100644
--- a/Master/texmf-dist/tex/context/base/type-otf.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-otf.mkiv
@@ -16,487 +16,1781 @@
%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.
-% if a fontname equals the filename, then use
+
+% \starttypescriptcollection[myfonts]
%
-% \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[opentype]
-
-%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 [serif] [myserif] [name]
+% \setups[font:fallback:serif]
+% \definefontsynonym [Serif] [file:myserif.ttf] [features=default]
+% \definefontsynonym [SerifBold] [file:myserifbold.ttf] [features=default]
+% \definefontsynonym [SerifItalic] [file:myserifitalic.ttf] [features=default]
+% \definefontsynonym [SerifBoldItalic] [file:myserifbolditalic.ttf] [features=default]
+% \stoptypescript
+%
+% \starttypescript[myfont]
+% \definetypeface [myfont] [rm] [serif] [myserif] [default]
+% \stoptypescript
+%
+% \stoptypescriptcollection
+%
+% \setupbodyfont[myfont]
-\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
+\starttypescriptcollection[fallback]
-\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]
+\starttypescript [fallback]
+ \definetypeface [] [rm] [serif] [modern] [computer-modern]
+ \definetypeface [] [ss] [sans] [modern] [computer-modern]
+ \definetypeface [] [tt] [mono] [modern] [computer-modern]
+ \definetypeface [] [mm] [math] [modern] [computer-modern]
+ \quittypescriptscanning
\stoptypescript
-\starttypescript [math] [modern,latin-modern,computer-modern]
- \definefontsynonym[LMMathRoman5-Regular] [LMMath5-Regular@lmroman5-math]
- \definefontsynonym[LMMathRoman6-Regular] [LMMath6-Regular@lmroman6-math]
- \definefontsynonym[LMMathRoman7-Regular] [LMMath7-Regular@lmroman7-math]
- \definefontsynonym[LMMathRoman8-Regular] [LMMath8-Regular@lmroman8-math]
- \definefontsynonym[LMMathRoman9-Regular] [LMMath9-Regular@lmroman9-math]
- \definefontsynonym[LMMathRoman10-Regular][LMMath10-Regular@lmroman10-math]
- \definefontsynonym[LMMathRoman12-Regular][LMMath12-Regular@lmroman12-math]
- \definefontsynonym[LMMathRoman17-Regular][LMMath17-Regular@lmroman17-math]
-
- \definefontsynonym[LMMathRoman5-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman6-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman7-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman8-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman9-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman10-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman12-Bold] [LMMath10-Bold@lmroman10-boldmath]
- \definefontsynonym[LMMathRoman17-Bold] [LMMath10-Bold@lmroman10-boldmath]
-
- % are these needed?
- %
- % \definefontsynonym[MathRoman][LMMath10-Regular@lmroman10-math]
- % \definefontsynonym[MathBold] [LMMath10-Bold@lmroman10-boldmath]
+% faster
+%
+% \starttypescript [fallback]
+% \definetypeface [] [rm] [serif] [modern] [default]
+% \definetypeface [] [ss] [sans] [modern] [default]
+% \definetypeface [] [tt] [mono] [modern] [default]
+% \definetypeface [] [mm] [math] [modern] [default]
+% \quittypescriptscanning
+% \stoptypescript
- \loadmapfile[lm-math.map]
- \loadmapfile[lm-rm.map]
-\stoptypescript
+\stoptypescriptcollection
-% 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
-
-% name definitions & prefixes
-% \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
+% if a fontname equals the filename, then use
+%
+% \setupfontsynonym [LMRoman10-DemiOblique] [\s!features=\s!default] % file is lowercase, so fails
+% \definefontsynonym [LMRoman10-DemiOblique] [\s!name:LMRoman10-DemiOblique] [\s!features=\s!default]
+% \definefontsynonym [LMRoman10-DemiOblique] [lmroman10-demioblique] [\s!features=\s!default]
-\starttypescript [serif,calligraphy] [chorus,chancery]
- \definefontsynonym [TeXGyreChorus-MediumItalic] [file:texgyrechorus-mediumitalic] [features=default]
-\stoptypescript
+\unprotect
-% Times Math (tx)
+% \starttypescript [math] [modern,computer-modern,latin-modern]
+% \definefontsynonym[MathSymbol][MathSymbol-Regular@symbol-math]
+% \loadfontgoodies[symbol-math]
+% \stoptypescript
-\starttypescript [math][times][all]
- \definefontsynonym[MathRoman][txmath@tx-math]
- \loadmapfile[original-youngryu-tx.map]
-\stoptypescript
+\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,computer-modern]
+ \definefontsynonym [LMRoman5-Regular] [\s!file:lmroman5-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman6-Regular] [\s!file:lmroman6-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman7-Regular] [\s!file:lmroman7-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman8-Regular] [\s!file:lmroman8-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman9-Regular] [\s!file:lmroman9-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Regular] [\s!file:lmroman10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman12-Regular] [\s!file:lmroman12-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman17-Regular] [\s!file:lmroman17-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman5-Bold] [\s!file:lmroman5-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman6-Bold] [\s!file:lmroman6-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman7-Bold] [\s!file:lmroman7-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman8-Bold] [\s!file:lmroman8-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman9-Bold] [\s!file:lmroman9-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Bold] [\s!file:lmroman10-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman12-Bold] [\s!file:lmroman12-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman7-Italic] [\s!file:lmroman7-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman8-Italic] [\s!file:lmroman8-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman9-Italic] [\s!file:lmroman9-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Italic] [\s!file:lmroman10-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman12-Italic] [\s!file:lmroman12-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-BoldItalic] [\s!file:lmroman10-bolditalic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman8-Oblique] [\s!file:lmromanslant8-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman9-Oblique] [\s!file:lmromanslant9-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Oblique] [\s!file:lmromanslant10-regular][\s!features=\s!default]
+ \definefontsynonym [LMRoman12-Oblique] [\s!file:lmromanslant12-regular][\s!features=\s!default]
+ \definefontsynonym [LMRoman17-Oblique] [\s!file:lmromanslant17-regular][\s!features=\s!default]
+ \definefontsynonym [LMRoman10-BoldOblique] [\s!file:lmromanslant10-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Demi] [\s!file:lmromandemi10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-DemiOblique] [\s!file:lmromandemi10-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-CapsRegular] [\s!file:lmromancaps10-regular] [\s!features=\s!default] % features=smallcaps?
+ \definefontsynonym [LMRoman10-CapsOblique] [\s!file:lmromancaps10-oblique] [\s!features=\s!default]
+
+ \definefontsynonym [LMRoman10-Dunhill] [\s!file:lmromandunh10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-DunhillOblique] [\s!file:lmromandunh10-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMRoman10-Unslanted] [\s!file:lmromanunsl10-regular] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [modern,latin-modern,computer-modern]
+ \definefontsynonym [LMSans8-Regular] [\s!file:lmsans8-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans9-Regular] [\s!file:lmsans9-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans10-Regular] [\s!file:lmsans10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans12-Regular] [\s!file:lmsans12-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans17-Regular] [\s!file:lmsans17-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans10-Bold] [\s!file:lmsans10-bold] [\s!features=\s!default]
+ \definefontsynonym [LMSans8-Oblique] [\s!file:lmsans8-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSans9-Oblique] [\s!file:lmsans9-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSans10-Oblique] [\s!file:lmsans10-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSans12-Oblique] [\s!file:lmsans12-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSans17-Oblique] [\s!file:lmsans17-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSans10-BoldOblique] [\s!file:lmsans10-boldoblique] [\s!features=\s!default]
+
+ \definefontsynonym [LMSans10-DemiCondensed] [\s!file:lmsansdemicond10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSans10-DemiCondensedOblique] [\s!file:lmsansdemicond10-oblique] [\s!features=\s!default]
+
+ \definefontsynonym [LMSansQuotation8-Regular] [\s!file:lmsansquot8-regular] [\s!features=\s!default]
+ \definefontsynonym [LMSansQuotation8-Bold] [\s!file:lmsansquot8-bold] [\s!features=\s!default]
+ \definefontsynonym [LMSansQuotation8-Oblique] [\s!file:lmsansquot8-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMSansQuotation8-BoldOblique] [\s!file:lmsansquot8-boldoblique] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [mono] [modern,modern-variable,modern-condensed,latin-modern,latin-modern-variable,latin-modern-condensed,computer-modern]
+
+ \definefontsynonym [LMTypewriter8-Regular] [\s!file:lmmono8-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter9-Regular] [\s!file:lmmono9-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-Regular] [\s!file:lmmono10-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter12-Regular] [\s!file:lmmono12-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-Italic] [\s!file:lmmono10-italic] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-Oblique] [\s!file:lmmonoslant10-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-CapsRegular] [\s!file:lmmonocaps10-regular] [\s!features=\s!none] % features=smallcaps?
+ \definefontsynonym [LMTypewriter10-CapsOblique] [\s!file:lmmonocaps10-oblique] [\s!features=\s!none]
+
+ \definefontsynonym [LMTypewriter10-Light] [\s!file:lmmonolt10-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-LightOblique] [\s!file:lmmonolt10-oblique] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-LightCondensed] [\s!file:lmmonoltcond10-regular] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-LightCondensedOblique] [\s!file:lmmonoltcond10-oblique] [\s!features=\s!none]
+
+ \definefontsynonym [LMTypewriter10-Dark] [\s!file:lmmonolt10-bold] [\s!features=\s!none]
+ \definefontsynonym [LMTypewriter10-DarkOblique] [\s!file:lmmonolt10-boldoblique] [\s!features=\s!none]
+
+ \definefontsynonym [LMTypewriterVarWd10-Regular] [\s!file:lmmonoproplt10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMTypewriterVarWd10-Oblique] [\s!file:lmmonoproplt10-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMTypewriterVarWd10-Light] [\s!file:lmmonoprop10-regular] [\s!features=\s!default]
+ \definefontsynonym [LMTypewriterVarWd10-LightOblique] [\s!file:lmmonoprop10-oblique] [\s!features=\s!default]
+ \definefontsynonym [LMTypewriterVarWd10-Dark] [\s!file:lmmonoproplt10-bold] [\s!features=\s!default]
+ \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [\s!file:lmmonoproplt10-boldoblique] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [math] [modern,latin-modern,computer-modern]
+ \definefontsynonym[LMMathRoman5-Regular] [LMMath5-Regular@lmroman5-math]
+ \definefontsynonym[LMMathRoman6-Regular] [LMMath6-Regular@lmroman6-math]
+ \definefontsynonym[LMMathRoman7-Regular] [LMMath7-Regular@lmroman7-math]
+ \definefontsynonym[LMMathRoman8-Regular] [LMMath8-Regular@lmroman8-math]
+ \definefontsynonym[LMMathRoman9-Regular] [LMMath9-Regular@lmroman9-math]
+ \definefontsynonym[LMMathRoman10-Regular][LMMath10-Regular@lmroman10-math]
+ \definefontsynonym[LMMathRoman12-Regular][LMMath12-Regular@lmroman12-math]
+ \definefontsynonym[LMMathRoman17-Regular][LMMath17-Regular@lmroman17-math]
+
+ \definefontsynonym[LMMathRoman5-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman6-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman7-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman8-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman9-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman10-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman12-Bold] [LMMath10-Bold@lmroman10-boldmath]
+ \definefontsynonym[LMMathRoman17-Bold] [LMMath10-Bold@lmroman10-boldmath]
+
+ % are these needed?
+ %
+ % \definefontsynonym[MathRoman][LMMath10-Regular@lmroman10-math]
+ % \definefontsynonym[MathBold] [LMMath10-Bold@lmroman10-boldmath]
+
+ \loadfontgoodies[lm-math]
+ \stoptypescript
+
+ \starttypescript [serif] [modern,latin-modern,computer-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,latin-modern,computer-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,latin-modern,computer-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,latin-modern,computer-modern] [name]
+ \definefontsynonym [MathRoman] [LMMathRoman-Regular]
+ %definefontsynonym [MathExtension] [LMMathExtension-Regular]
+ %definefontsynonym [MathItalic] [LMMathItalic-Italic]
+ %definefontsynonym [MathSymbol] [LMMathSymbols-Italic]
+ \stoptypescript
+
+ \starttypescript [serif] [modern-variable,latin-modern-variable] [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-condensed,latin-modern-condensed,modern-light-condensed,latin-modern-light-condensed] [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,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,computer-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,computer-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-variable,latin-modern-variable,modern-condensed,latin-modern-condensed]
+ \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,latin-modern,computer-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,latin-modern,computer-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,latin-modern,computer-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 [mono] [modern-light,latin-modern-light]
+ \definefontsynonym [ComputerModernMono] [LMTypewriter-Light]
+ \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-LightOblique]
+ \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-LightOblique]
+ \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark]
+ \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique]
+ \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique]
+ \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-Light]
+ \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-LightOblique]
+ \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Light]
+ \stoptypescript
+
+ \starttypescript [serif] [modern-variable,latin-modern-variable]
+ \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 [serif] [modern-variable-light,latin-modern-variable-light]
+ \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Light]
+ \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-LightOblique]
+ \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-LightOblique]
+ \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark]
+ \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique]
+ \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique]
+ \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Light]
+ \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-LightOblique]
+ \stoptypescript
+
+ \starttypescript [math] [modern,latin-modern]
+ % isn't this obsolete now?
+ \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
+
+ \starttypescript [modern]
+ \definetypeface [modern] [rm] [serif] [modern] [computer-modern]
+ \definetypeface [modern] [ss] [sans] [modern] [computer-modern]
+ \definetypeface [modern] [tt] [mono] [modern] [computer-modern]
+ \definetypeface [modern] [mm] [math] [modern] [computer-modern]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modern-base]
+ \definetypeface [modern] [rm] [serif] [modern] [default]
+ \definetypeface [modern] [ss] [sans] [modern] [default]
+ \definetypeface [modern] [tt] [mono] [modern] [default]
+ \definetypeface [modern] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modernvariable,modern-variable]
+ \definetypeface [modernvariable] [rm] [serif] [modern-variable] [default]
+ \definetypeface [modernvariable] [tt] [mono] [modern-variable] [default]
+ \definetypeface [modernvariable] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modernvariablelight,modern-variable-light]
+ \definetypeface [modernvariable] [rm] [serif] [modern-variable-light] [default]
+ \definetypeface [modernvariable] [tt] [mono] [modern-variable-light] [default]
+ \definetypeface [modernvariable] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modern-mono]
+ \definetypeface [modern] [rm] [serif] [modern] [computer-modern]
+ \definetypeface [modern] [ss] [sans] [modern] [computer-modern]
+ \definetypeface [modern] [tt] [mono] [modern-light] [computer-modern]
+ \definetypeface [modern] [mm] [math] [modern] [computer-modern]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [modern-base-mono]
+ \definetypeface [modern] [rm] [serif] [modern] [computer-modern] [default]
+ \definetypeface [modern] [ss] [sans] [modern] [computer-modern] [default]
+ \definetypeface [modern] [tt] [mono] [modern-light] [computer-modern] [default]
+ \definetypeface [modern] [mm] [math] [modern] [computer-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
-% Palatino Math (px)
+\stoptypescriptcollection
-\starttypescript [math][palatino][all]
- \definefontsynonym[MathRoman][pxmath@px-math]
- \loadmapfile[original-youngryu-px.map]
-\stoptypescript
+\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,bookman,cursor,courier,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!default]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!smallcaps]
+ \stoptypescript
+
+ \starttypescript [serif,calligraphy] [chorus,chancery]
+ \definefontsynonym [TeXGyreChorus-MediumItalic] [\s!file:texgyrechorus-mediumitalic] [\s!features=\s!default]
+ \stoptypescript
+
+ \definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella]
+ \definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes]
+ \definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros]
+ \definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum]
+ \definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola]
+ \definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor]
+ \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor]
+ \definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set
+
+ \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]
+
+ \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]
+
+ \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]
+
+ \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]
+ \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [rscale=0.9]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [mm] [math] [times] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [palatino,pagella]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.075]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.075]
+ \definetypeface [\typescriptone] [mm] [math] [palatino] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [schoolbook,schola]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [bookman,bonum]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.1]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [chancery,chorus]
+ \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [helvetica,heros]
+ \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.15]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [avantgarde,adventor]
+ \definetypeface [\typescriptone] [ss] [sans] [adventor] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [courier,cursor]
+ \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
+ \definetypeface [\typescriptone] [rm] [serif] [modern] [default]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default]
+ \quittypescriptscanning
+ \stoptypescript
-% 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
+\stoptypescriptcollection
-% \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
+\starttypescriptcollection[xmath]
-% Antykwa Poltawskiego (GUST)
+ % Times Math (tx)
-\starttypescript [serif] [antykwa-poltawskiego]
- \definefontsynonym [AntykwaPoltawskiego-Regular] [antpr]
- \definefontsynonym [AntykwaPoltawskiego-Bold] [antpb]
- \definefontsynonym [AntykwaPoltawskiego-Italic] [antpri]
- \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [antpbi]
-\stoptypescript
+ \starttypescript [math][times][all]
+ \loadfontgoodies[tx-math]
+ \definefontsynonym[MathRoman][txmath@tx-math]
+ \stoptypescript
-% Iwona (JMN)
-
-% 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]
+ % Palatino Math (px)
-\stoptypescript
+ \starttypescript [math][palatino][all]
+ \loadfontgoodies[px-math]
+ \definefontsynonym[MathRoman][pxmath@px-math]
+ \stoptypescript
-% [all] is redundant
+\stoptypescriptcollection
-\starttypescript [math][iwona][all]
- \definefontsynonym[MathRoman][iwonamath@iwona-math]
-\stoptypescript
-\starttypescript [math][iwona-light][all]
- \definefontsynonym[MathRoman][iwonalightmath@iwona-light-math]
-\stoptypescript
-\starttypescript [math][iwona-medium][all]
- \definefontsynonym[MathRoman][iwonamediummath@iwona-medium-math]
-\stoptypescript
-\starttypescript [math][iwona-heavy][all]
- \definefontsynonym[MathRoman][iwonaheavymath@iwona-heavy-math]
-\stoptypescript
+\starttypescriptcollection[antykwa]
+
+ % Antykwa Torunska (GUST)
+
+ \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond]
+ \definefontsynonym [AntykwaTorunska-Regular] [\s!file:AntykwaTorunska-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-Italic] [\s!file:AntykwaTorunska-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-Bold] [\s!file:AntykwaTorunska-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-BoldItalic] [\s!file:AntykwaTorunska-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-Light] [\s!file:AntykwaTorunskaLight-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-LightItalic] [\s!file:AntykwaTorunskaLight-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-Medium] [\s!file:AntykwaTorunskaMed-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-MedItalic] [\s!file:AntykwaTorunskaMed-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondRegular] [\s!file:AntykwaTorunskaCond-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondItalic] [\s!file:AntykwaTorunskaCond-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondBold] [\s!file:AntykwaTorunskaCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondBoldItalic] [\s!file:AntykwaTorunskaCond-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondLight] [\s!file:AntykwaTorunskaCondLight-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondLightItalic] [\s!file:AntykwaTorunskaCondLight-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondMedium] [\s!file:AntykwaTorunskaCondMed-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaTorunska-CondMedItalic] [\s!file:AntykwaTorunskaCondMed-Italic] [\s!features=\s!default]
+
+ \definefontsynonym [AntykwaTorunska-Cap] [\s!file:AntykwaTorunska-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-ItalicCap] [\s!file:AntykwaTorunska-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-BoldCap] [\s!file:AntykwaTorunska-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\s!file:AntykwaTorunska-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-LightCap] [\s!file:AntykwaTorunskaLight-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-LightItalicCap] [\s!file:AntykwaTorunskaLight-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-MediumCap] [\s!file:AntykwaTorunskaMed-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-MedItalicCap] [\s!file:AntykwaTorunskaMed-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondCap] [\s!file:AntykwaTorunskaCond-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondItalicCap] [\s!file:AntykwaTorunskaCond-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondBoldCap] [\s!file:AntykwaTorunskaCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\s!file:AntykwaTorunskaCond-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondLightCap] [\s!file:AntykwaTorunskaCondLight-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\s!file:AntykwaTorunskaCondLight-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondMediumCap] [\s!file:AntykwaTorunskaCondMed-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\s!file:AntykwaTorunskaCondMed-Italic] [\s!features=\s!smallcaps]
+ \stoptypescript
+
+ \starttypescript [math][antykwa-torunska][all]
+ \loadfontgoodies[antykwa-math]
+ \definefontsynonym[MathRoman][antykwamath@antykwa-math]
+ \stoptypescript
+
+ \starttypescript [math][antykwa-torunska-light][all]
+ \loadfontgoodies[antykwa-math]
+ \definefontsynonym[MathRoman][antykwalightmath@antykwa-light-math]
+ \stoptypescript
+
+ \starttypescript [math][antykwa-torunska-cond][all]
+ \loadfontgoodies[antykwa-math]
+ \definefontsynonym[MathRoman][antykwacondmath@antykwa-cond-math]
+ \stoptypescript
+
+ \starttypescript [math][antykwa-torunska-lightcond][all]
+ \loadfontgoodies[antykwa-math]
+ \definefontsynonym[MathRoman][antykwalightcondmath@antykwa-lightcond-math]
+ \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]
+
+ \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]
+
+ \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]
+ \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]
+
+ \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]
+
+ \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]
+ \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]
+
+ \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]
+
+ \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]
+ \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]
+
+ \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]
+
+ \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]
+ \stoptypescript
+
+ \starttypescript [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond]
+ \definetypeface[antykwa][rm][serif][\typescriptone] [default]
+ \definetypeface[antykwa][ss][sans] [modern] [default] [rscale=1.05]
+ \definetypeface[antykwa][tt][mono] [modern] [default] [rscale=1.05]
+ \definetypeface[antykwa][mm][math] [\typescriptone] [default]
+ \quittypescriptscanning
+ \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:AntPoltMdCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Condensed-MediumItalic] [\s!file:AntPoltMdCond-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:AntPoltMdCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMediumItalic] [\s!file:AntPoltMdCond-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-Regular] [\s!file:AntPoltLtSemiCond-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Italic] [\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:AntPoltMdSemiCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-MediumItalic] [\s!file:AntPoltMdSemiCond-BdItalic] [\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-CapsRegular] [\s!file:AntPoltLtSemiCond-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsItalic] [\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:AntPoltMdSemiCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMediumItalic] [\s!file:AntPoltMdSemiCond-BdItalic] [\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:AntPoltMd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-MediumItalic] [\s!file:AntPoltMd-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:AntPoltLt-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-CapsLightItalic] [\s!file:AntPoltLt-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:AntPoltMd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-CapsMediumItalic] [\s!file:AntPoltMd-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-SemiExtended-Light] [\s!file:AntPoltLtSemiExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-LightItalic] [\s!file:AntPoltLtSemiExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Regular] [\s!file:AntPoltSemiExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Italic] [\s!file:AntPoltSemiExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Medium] [\s!file:AntPoltMdSemiExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-MediumItalic] [\s!file:AntPoltMdSemiExtd-BdItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-Bold] [\s!file:AntPoltSemiExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-BoldItalic] [\s!file:AntPoltSemiExtd-BoldItalic] [\s!features=\s!default]
+
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLight] [\s!file:AntPoltLtSemiExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsLightItalic] [\s!file:AntPoltLtSemiExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsRegular] [\s!file:AntPoltSemiExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsItalic] [\s!file:AntPoltSemiExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMedium] [\s!file:AntPoltMdSemiExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsMediumItalic] [\s!file:AntPoltMdSemiExtd-BdItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBold] [\s!file:AntPoltSemiExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-SemiExtended-CapsBoldItalic] [\s!file:AntPoltSemiExtd-BoldItalic] [\s!features=\s!smallcaps]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Light] [\s!file:AntPoltLtExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-LightItalic] [\s!file:AntPoltLtExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Regular] [\s!file:AntPoltExtd-Regular] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Italic] [\s!file:AntPoltExtd-Italic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Medium] [\s!file:AntPoltMdExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-MediumItalic] [\s!file:AntPoltMdExtd-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-Bold] [\s!file:AntPoltExtd-Bold] [\s!features=\s!default]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-BoldItalic] [\s!file:AntPoltExtd-BoldItalic] [\s!features=\s!default]
+
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLight] [\s!file:AntPoltLtExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsLightItalic] [\s!file:AntPoltLtExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsRegular] [\s!file:AntPoltExtd-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsItalic] [\s!file:AntPoltExtd-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMedium] [\s!file:AntPoltMdExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsMediumItalic] [\s!file:AntPoltMdExtd-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBold] [\s!file:AntPoltExtd-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [AntykwaPoltawskiego-Extended-CapsBoldItalic] [\s!file:AntPoltExtd-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]
+ \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.05]
+ \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.05]
+ \quittypescriptscanning
+ \stoptypescript
-\starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [all]
- \loadmapfile[iwona-rm.map]
- \loadmapfile[iwona-mi.map]
- \loadmapfile[iwona-sy.map]
- \loadmapfile[iwona-ex.map]
-\stoptypescript
+\stoptypescriptcollection
-% Kurier (JMN) / no open type fonts
-
-\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
+\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] [\s!file:Iwona-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Italic] [\s!file:Iwona-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Bold] [\s!file:Iwona-Bold] [\s!features=\s!default]
+ \definefontsynonym [Iwona-BoldItalic] [\s!file:Iwona-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Light-Regular] [\s!file:IwonaLight-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Light-Italic] [\s!file:IwonaLight-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Medium-Regular] [\s!file:IwonaMedium-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Medium-Italic] [\s!file:IwonaMedium-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Heavy-Regular] [\s!file:IwonaHeavy-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-Heavy-Italic] [\s!file:IwonaHeavy-Italic] [\s!features=\s!default]
+
+ \definefontsynonym [Iwona-CapsRegular] [\s!file:Iwona-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsItalic] [\s!file:Iwona-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsBold] [\s!file:Iwona-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsBoldItalic] [\s!file:Iwona-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsLight] [\s!file:IwonaLight-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsLight-Italic] [\s!file:IwonaLight-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsMedium] [\s!file:IwonaMedium-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsMedium-Italic] [\s!file:IwonaMedium-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsHeavy] [\s!file:IwonaHeavy-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsHeavy-Italic] [\s!file:IwonaHeavy-Italic] [\s!features=\s!smallcaps]
+
+ \definefontsynonym [Iwona-CondRegular] [\s!file:IwonaCond-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondItalic] [\s!file:IwonaCond-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondBold] [\s!file:IwonaCond-Bold] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondBoldItalic] [\s!file:IwonaCond-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondLight-Regular] [\s!file:IwonaCondLight-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondLight-Italic] [\s!file:IwonaCondLight-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondMedium-Regular] [\s!file:IwonaCondMedium-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondMedium-Italic] [\s!file:IwonaCondMedium-Italic] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondHeavy-Regular] [\s!file:IwonaCondHeavy-Regular] [\s!features=\s!default]
+ \definefontsynonym [Iwona-CondHeavy-Italic] [\s!file:IwonaCondHeavy-Italic] [\s!features=\s!default]
+
+ \definefontsynonym [Iwona-CapsCondRegular] [\s!file:IwonaCond-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondItalic] [\s!file:IwonaCond-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondBold] [\s!file:IwonaCond-Bold] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondBoldItalic] [\s!file:IwonaCond-BoldItalic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondLight-Regular] [\s!file:IwonaCondLight-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondLight-Italic] [\s!file:IwonaCondLight-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondMedium-Regular][\s!file:IwonaCondMedium-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondMedium-Italic] [\s!file:IwonaCondMedium-Italic] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondHeavy-Regular] [\s!file:IwonaCondHeavy-Regular] [\s!features=\s!smallcaps]
+ \definefontsynonym [Iwona-CapsCondHeavy-Italic] [\s!file:IwonaCondHeavy-Italic] [\s!features=\s!smallcaps]
+
+ \stoptypescript
+
+ % [all] is redundant
+
+ \starttypescript [math][iwona][all]
+ \definefontsynonym[MathRoman][iwonamath@iwona-math]
+ \stoptypescript
+ \starttypescript [math][iwona-light][all]
+ \definefontsynonym[MathRoman][iwonalightmath@iwona-light-math]
+ \stoptypescript
+ \starttypescript [math][iwona-medium][all]
+ \definefontsynonym[MathRoman][iwonamediummath@iwona-medium-math]
+ \stoptypescript
+ \starttypescript [math][iwona-heavy][all]
+ \definefontsynonym[MathRoman][iwonaheavymath@iwona-heavy-math]
+ \stoptypescript
+
+ \starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [all]
+ \loadfontgoodies[iwona-math]
+ \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 [iwona,iwona-light,iwona-heavy,iwona-medium]
+ \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default]
+ \definetypeface[\typescriptone][rm][serif][modern] [default]
+ \definetypeface[\typescriptone][tt][mono] [modern] [default]
+ \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][text=ss]
+ \quittypescriptscanning
+ \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
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[kurier]
+
+ % Kurier (JMN) / no open type fonts yet so this should be in type-one.mkiv
+
+ \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 [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-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
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[symbols]
-\starttypescript [iwona,iwona-light,iwona-medium,iwona-heavy]
- \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default]
- \definetypeface[\typescriptone][rm][serif][modern] [default]
- \definetypeface[\typescriptone][tt][mono] [modern] [default][rscale=1.05]
- \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][text=ss]
- \quittypescriptscanning
-\stoptypescript
+ \starttypescript
+ \definefontsynonym [ZapfDingbats] [uzdr]
+ \definefontsynonym [RalfSmithFormalScript] [rsfs10]
+ \definefontsynonym [MartinVogel] [fmvr8x]
+ \stoptypescript
-% Whatever else we need:
+\stoptypescriptcollection
-\starttypescript
- \definefontsynonym [ZapfDingbats] [uzdr]
- \definefontsynonym [RalfSmithFormalScript] [rsfs10]
- \definefontsynonym [MartinVogel] [fmvr8x]
-\stoptypescript
+\starttypescriptcollection[charter]
+
+ \starttypescript [serif] [charter]
+ \definefontsynonym [Charter-Roman] [\s!name:CharterBT-Roman] % or: [bchr8a]
+ \definefontsynonym [Charter-Italic] [\s!name:CharterBT-Italic] % or: [bchri8a]
+ \definefontsynonym [Charter-Bold] [\s!name:CharterBT-Bold] % or: [bchb8a]
+ \definefontsynonym [Charter-BoldItalic] [\s!name:CharterBT-BoldItalic] % or: [bchbi8a]
+ \definefontsynonym [Charter-Slanted] [\s!name:CharterBT-Italic] % or: [bchri8a]
+ \definefontsynonym [Charter-BoldSlanted] [\s!name:CharterBT-BoldItalic] % or: [bchbi8a]
+ \definefontsynonym [Charter-Roman-Caps] [Charter-Roman] % not present
+ \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
-% Temp here
+\stoptypescriptcollection
-\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
+\starttypescriptcollection[mathtimes]
-% new
+ \starttypescript [math] [mathtimes] [all]
+ \loadfontgoodies[mathtimes-math]
+ \definefontsynonym[MathRoman][mathtimes@mathtimes-math]
+ \stoptypescript
-% cambria.ttc cambriab.ttf cambriai.ttf cambriaz.ttf
+ \starttypescript [mathtimes]
+ \definetypeface [mathtimes] [rm] [serif] [times] [default]
+ \definetypeface [mathtimes] [ss] [sans] [helvetica] [default] [rscale=0.9]
+ \definetypeface [mathtimes] [tt] [mono] [modern] [default] [rscale=1.05]
+ \definetypeface [mathtimes] [mm] [math] [mathtimes] [default]
+ \quittypescriptscanning
+ \stoptypescript
-\starttypescript [math] [cambria] [name]
- \definefontsynonym [MathRoman] [name:cambriamath] [features=math\mathsizesuffix]
-\stoptypescript
-\starttypescript [math] [cambria-x] [name]
- \definefontsynonym [MathRoman] [name:cambriamath] [features=math]
-\stoptypescript
-\starttypescript [math] [cambria-y] [name]
- \definefontsynonym [MathRoman] [name:cambriamath] [features=math-nostack\mathsizesuffix]
-\stoptypescript
+\stoptypescriptcollection
-\starttypescript [serif] [cambria] [name]
- \usetypescript[fallback:serif]
- \definefontsynonym [Serif] [name:cambria] [features=default]
- \definefontsynonym [SerifBold] [name:cambriabold] [features=default]
- \definefontsynonym [SerifItalic] [name:cambriaitalic] [features=default]
- \definefontsynonym [SerifBoldItalic] [name:cambriabolditalic] [features=default]
-\stoptypescript
+\starttypescriptcollection[lucida]
+
+ \starttypescript [serif] [lucida]
+ \definefontsynonym [LucidaBright] [\s!name:LucidaBright]
+ \definefontsynonym [LucidaBright-Demi] [\s!name:LucidaBright-Demi]
+ \definefontsynonym [LucidaBright-Italic] [\s!name:LucidaBright-Italic]
+ \definefontsynonym [LucidaBright-DemiItalic] [\s!name:LucidaBright-DemiItalic]
+ \definefontsynonym [LucidaBright-Oblique] [\s!name:LucidaBright-Oblique]
+ \definefontsynonym [LucidaBrightSmallcaps] [\s!name:LucidaBrightSmallcaps]
+ \definefontsynonym [LucidaBrightSmallcaps-Demi] [\s!name:LucidaBrightSmallcaps-Demi]
+ \stoptypescript
+
+ \starttypescript [sans] [lucida]
+ \definefontsynonym [LucidaSans] [\s!name:LucidaSans]
+ \definefontsynonym [LucidaSans-Demi] [\s!name:LucidaSans-Demi]
+ \definefontsynonym [LucidaSans-Bold] [\s!name:LucidaSans-Bold]
+ \definefontsynonym [LucidaSans-Italic] [\s!name:LucidaSans-Italic]
+ \definefontsynonym [LucidaSans-DemiItalic] [\s!name:LucidaSans-DemiItalic]
+ \definefontsynonym [LucidaSans-BoldItalic] [\s!name:LucidaSans-BoldItalic]
+ \stoptypescript
+
+ \starttypescript [mono] [lucida]
+ \definefontsynonym [LucidaTypewriter] [\s!name:LucidaTypewriter]
+ \definefontsynonym [LucidaTypewriterBold] [\s!name:LucidaTypewriterBold]
+ \definefontsynonym [LucidaTypewriterOblique] [\s!name:LucidaTypewriterOblique]
+ \definefontsynonym [LucidaTypewriterBoldOblique] [\s!name:LucidaTypewriterBoldOblique]
+ \stoptypescript
+
+ \starttypescript [mono] [lucida]
+ \definefontsynonym [LucidaSans-Typewriter] [\s!name:LucidaSans-Typewriter]
+ \definefontsynonym [LucidaSans-TypewriterBold] [\s!name:LucidaSans-TypewriterBold]
+ \definefontsynonym [LucidaSans-TypewriterOblique] [\s!name:LucidaSans-TypewriterOblique]
+ \definefontsynonym [LucidaSans-TypewriterBoldOblique] [\s!name:LucidaSans-TypewriterBoldOblique]
+ \stoptypescript
+
+ \starttypescript [calligraphy] [lucida]
+ \definefontsynonym [LucidaCalligraphy-Italic] [\s!name:LucidaCalligraphy-Italic]
+ \stoptypescript
+
+ \starttypescript [casual] [lucida]
+ \definefontsynonym [LucidaCasual] [\s!name:LucidaCasual]
+ \definefontsynonym [LucidaCasual-Italic] [\s!name:LucidaCasual-Italic]
+ \stoptypescript
+
+ \starttypescript [handwriting] [lucida]
+ \definefontsynonym [LucidaHandwriting-Italic] [\s!name:LucidaHandwriting-Italic]
+ \stoptypescript
+
+ \starttypescript [fax] [lucida]
+ \definefontsynonym [LucidaFax] [\s!name:LucidaFax]
+ \definefontsynonym [LucidaFax-Demi] [\s!name:LucidaFax-Demi]
+ \definefontsynonym [LucidaFax-Italic] [\s!name:LucidaFax-Italic]
+ \definefontsynonym [LucidaFax-DemiItalic] [\s!name:LucidaFax-DemiItalic]
+ \stoptypescript
+
+ \starttypescript [blackletter] [lucida]
+ \definefontsynonym [LucidaBlackletter] [\s!name:LucidaBlackletter]
+ \stoptypescript
+
+ \starttypescript [math] [lucida]
+ \loadfontgoodies[lucida-math]
+ \definefontsynonym[MathRoman][lucidamath@lucida-math]
+ \stoptypescript
+
+ \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
+
+ \starttypescript [lucida]
+ \definetypeface [lucida] [rm] [\s!serif] [lucida] [\s!default] [\s!features=\s!default]
+ \definetypeface [lucida] [ss] [\s!sans] [lucida] [\s!default] [\s!features=\s!default]
+ \definetypeface [lucida] [tt] [\s!mono] [lucida] [\s!default] [\s!features=\s!default]
+ \definetypeface [lucida] [hw] [\s!handwriting] [lucida] [\s!default] [\s!features=\s!default]
+ \definetypeface [lucida] [cg] [\s!calligraphy] [lucida] [\s!default] [\s!features=\s!default]
+ \definetypeface [lucida] [mm] [\s!math] [lucida] [\s!default]
+ \stoptypescript
-\starttypescript [cambria]
- \definetypeface [cambria] [rm] [serif] [cambria] [default]
- \definetypeface [cambria] [tt] [mono] [modern] [default]
- \definetypeface [cambria] [mm] [math] [cambria] [default]
-\stoptypescript
+\stoptypescriptcollection
-\starttypescript [cambria-x]
- \definetypeface [cambria-x] [rm] [serif] [cambria] [default]
- \definetypeface [cambria-x] [tt] [mono] [modern] [default]
- \definetypeface [cambria-x] [mm] [math] [cambria-x] [default]
-\stoptypescript
+\starttypescriptcollection [mathdesign]
-\starttypescript [cambria-y]
- \definetypeface [cambria-y] [rm] [serif] [cambria] [default]
- \definetypeface [cambria-y] [tt] [mono] [modern] [default]
- \definetypeface [cambria-y] [mm] [math] [cambria-y] [default]
-\stoptypescript
+ \starttypescript [math] [charter,mathdesignch] [all]
+ \loadfontgoodies[charter-math]
+ \definefontsynonym[MathRoman][chartermath@charter-math]
+ \stoptypescript
-% math times
+ \starttypescript [math] [garamond,mathdesigngm] [all]
+ \loadfontgoodies[garamond-math]
+ \definefontsynonym[MathRoman][garamondmath@garamond-math]
+ \stoptypescript
-\starttypescript [math] [mathtimes] [all]
- \definefontsynonym[MathRoman][mathtimes@mathtimes-math]
- \loadmapfile[mathtime.map]
-\stoptypescript
+ \starttypescript [math] [utopia,mathdesignut] [all]
+ \loadfontgoodies[utopia-math]
+ \definefontsynonym[MathRoman][utopiamath@utopia-math]
+ \stoptypescript
-\starttypescript [mathtimes]
- \definetypeface [mathtimes] [rm] [serif] [times] [default]
- \definetypeface [mathtimes] [ss] [sans] [helvetica] [default] [rscale=0.9]
- \definetypeface [mathtimes] [tt] [mono] [modern] [default] [rscale=1.05]
- \definetypeface [mathtimes] [mm] [math] [mathtimes] [default]
- \quittypescriptscanning
-\stoptypescript
+\stoptypescriptcollection
-% lucida
+\starttypescriptcollection [asanamath]
-\starttypescript [math] [lucida,lucidanewmath] [all]
- \definefontsynonym[MathRoman][lucidamath@lucida-math]
- \loadmapfile[lucida.map]
-\stoptypescript
+ \starttypescript [math] [asana]
+ \definefontsynonym [AsanaMath] [\s!name:asanamath]
+ \stoptypescript
-% mathdesign
+ \starttypescript [math] [asana] [name]
+ \definefontsynonym [MathRoman] [AsanaMath] [\s!features=math\mathsizesuffix]
+ \stoptypescript
-\starttypescript [math] [charter,mathdesignch] [all]
- \definefontsynonym[MathRoman][chartermath@charter-math]
- \loadmapfile[mdbch.map]
-\stoptypescript
+ \starttypescript[asana]
+ \definetypeface [\typescriptone] [rm] [\s!serif] [palatino] [\s!default]
+ \definetypeface [\typescriptone] [ss] [\s!sans] [modern] [\s!default] [rscale=1.075]
+ \definetypeface [\typescriptone] [tt] [\s!mono] [modern] [\s!default] [rscale=1.075]
+ \definetypeface [\typescriptone] [mm] [\s!math] [\typescriptone] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
-\starttypescript [math] [garamond,mathdesigngm] [all]
- \definefontsynonym[MathRoman][garamondmath@garamond-math]
- \loadmapfile[mdugm.map]
-\stoptypescript
+\stoptypescriptcollection
-\starttypescript [math] [utopia,mathdesignut] [all]
- \definefontsynonym[MathRoman][utopiamath@utopia-math]
- \loadmapfile[mdput.map]
-\stoptypescript
+\starttypescriptcollection[cleartype]
+
+ % microsoft: cambria.ttc cambriab.ttf cambriai.ttf cambriaz.ttf
+ % ascender : cambmath.ttf cambria.ttf cambriab.ttf cambriai.ttf cambriaz.ttf
+
+ \starttypescript [math,serif] [cambria,cambria-x,cambria-y]
+ % whatever matches
+ \definefontsynonym [CambriaMath] [\s!name:cambriamath]
+ \definefontsynonym [CambriaSerif] [\s!name:cambria]
+ \stoptypescript
+ \starttypescript [math,serif] [cambria-m]
+ % microsoft cabria
+ \definefontsynonym [CambriaMath] [\s!file:cambria.ttc(Cambria Math)]
+ \definefontsynonym [CambriaSerif] [\s!file:cambria.ttc(Cambria)]
+ \stoptypescript
+ \starttypescript [math,serif] [cambria-a]
+ % ascender cambria
+ \definefontsynonym [CambriaMath] [\s!file:cambmath.ttf]
+ \definefontsynonym [CambriaSerif] [\s!file:cambria.ttf]
+ \stoptypescript
+
+ \starttypescript [math] [cambria,cambria-m,cambria-a] [name]
+ \definefontsynonym [MathRoman] [CambriaMath] [\s!features=math\mathsizesuffix]
+ \stoptypescript
+ \starttypescript [math] [cambria-x] [name]
+ \definefontsynonym [MathRoman] [CambriaMath] [\s!features=math]
+ \stoptypescript
+ \starttypescript [math] [cambria-y] [name]
+ \definefontsynonym [MathRoman] [CambriaMath] [\s!features=math-nostack\mathsizesuffix]
+ \stoptypescript
+
+ \starttypescript [serif] [cambria,cambria-m,cambria-a] [name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [CambriaSerif] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!name:cambriabold] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifItalic] [\s!name:cambriaitalic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!name:cambriabolditalic] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [cambria,cambria-m,cambria-a]
+ % any
+ \definetypeface [cambria] [rm] [\s!serif] [\typescriptone] [\s!default]
+ \definetypeface [cambria] [tt] [\s!mono] [modern] [\s!default]
+ \definetypeface [cambria] [mm] [\s!math] [\typescriptone] [\s!default]
+ \stoptypescript
+ \starttypescript [cambria-x,cambria-y]
+ % test x
+ \definetypeface [\typescriptone] [rm] [\s!serif] [cambria] [\s!default]
+ \definetypeface [\typescriptone] [tt] [\s!mono] [modern] [\s!default]
+ \definetypeface [\typescriptone] [mm] [\s!math] [\typescriptone] [\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [candara] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:candara] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:candarab] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:candarai] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:candaraz] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [consolas] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:consola] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:consolab] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:consolai] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:consolaz] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [serif] [constantia] [name]
+ \setups[\s!font:\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [\s!file:constan] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!file:constanb] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifItalic] [\s!file:constani] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:constanz] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [corbel] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:corbel] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:corbelb] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:corbeli] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:corbelz] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [calibri] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:calibri] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:calibrib] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:calibrii] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:calibriz] [\s!features=\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\starttypescriptcollection[mscore]
+
+ % .ttf not really needed but we want to force the originals
+
+ \starttypescript [serif] [mscoretimes] [name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [\s!file:times.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!file:timesbd.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifItalic] [\s!file:timesi.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:timesbi.ttf] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [mscorearial] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:arial.ttf] [\s!features=default]
+ \definefontsynonym [\s!SansBold] [\s!file:arialbd.ttf] [\s!features=default]
+ \definefontsynonym [\s!SansItalic] [\s!file:ariali.ttf] [\s!features=default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:arialbi.ttf] [\s!features=default]
+ \stoptypescript
+
+ \starttypescript [mono] [mscorecourier] [name]
+ \setups[\s!font:\s!fallback:\s!mono]
+ \definefontsynonym [\s!Mono] [\s!file:cour.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoBold] [\s!file:courbd.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoItalic] [\s!file:couri.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoBoldItalic] [\s!file:courbi.ttf] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [mscoreverdana] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:verdana.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:verdanab.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:verdanai.ttf] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:verdanaz.ttf] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript[mscore]
+ \definetypeface [mscore] [rm] [serif] [mscoretimes] [default]
+ \definetypeface [mscore] [ss] [sans] [mscorearial] [default] [rscale=0.860]
+ \definetypeface [mscore] [tt] [mono] [mscorecourier] [default] [rscale=1.065]
+ \definetypeface [mscore] [mm] [math] [times] [default] [rscale=1.020]
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\starttypescriptcollection[liberation]
+
+ \starttypescript [serif] [liberationserif] [name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [\s!file:liberationserif-regular] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!file:liberationserif-bold] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifItalic] [\s!file:liberationserif-italic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:liberationserif-bolditalic] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [sans] [liberationsans] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:liberationsans-regular] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBold] [\s!file:liberationsans-bold] [\s!features=\s!default]
+ \definefontsynonym [\s!SansItalic] [\s!file:liberationsans-italic] [\s!features=\s!default]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:liberationsans-bolditalic] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [mono] [liberationmono] [name]
+ \setups[\s!font:\s!fallback:\s!mono]
+ \definefontsynonym [\s!Mono] [\s!file:liberationmono-regular] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoBold] [\s!file:liberationmono-bold] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoItalic] [\s!file:liberationmono-italic] [\s!features=\s!default]
+ \definefontsynonym [\s!MonoBoldItalic] [\s!file:liberationmono-bolditalic] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript[liberation]
+ \definetypeface [liberation] [rm] [serif] [liberationserif] [default]
+ \definetypeface [liberation] [ss] [sans] [liberationsans] [default] [rscale=0.870]
+ \definetypeface [liberation] [tt] [mono] [liberationmono] [default] [rscale=0.870]
+ \definetypeface [liberation] [mm] [math] [times] [default] [rscale=1.040]
+ \stoptypescript
+
+\stoptypescriptcollection
+
+%D For some reason the libertine collection has not retained its
+%D original names. We force the \OPENTYPE\ variant. Once these fonts
+%D are stable we might switch to the by then hopefully cleaner internal
+%D names.
+
+\starttypescriptcollection[libertine]
+
+% \starttypescript [serif] [libertine] [name]
+% \setups[\s!font:\s!fallback:\s!serif]
+% \definefontsynonym [\s!Serif] [\s!file:fxlr.otf] [\s!features=\s!default]
+% \definefontsynonym [\s!SerifBold] [\s!file:fxlb.otf] [\s!features=\s!default]
+% \definefontsynonym [\s!SerifItalic] [\s!file:fxlri.otf] [\s!features=\s!default]
+% \definefontsynonym [\s!SerifBoldItalic] [\s!file:fxlbi.otf] [\s!features=\s!default]
+% \stoptypescript
+
+ \starttypescript [serif] [libertine]
+ \definefontsynonym [Libertine-Regular] [\s!file:fxlr]
+ \definefontsynonym [Libertine-Italic] [\s!file:fxlri]
+ \definefontsynonym [Libertine-Bold] [\s!file:fxlb]
+ \definefontsynonym [Libertine-BoldItalic] [\s!file:fxlbi]
+ \definefontsynonym [Libertine-SmallCaps] [file:fxlrc]
+ \stoptypescript
+
+ \starttypescript [serif] [libertine] [name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [Libertine-Regular] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifItalic] [Libertine-Italic] [\s!features=\s!default]
+ % \definefontsynonym [\s!SerifSlanted] [Libertine-Italic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [Libertine-Bold] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBoldItalic] [Libertine-BoldItalic] [\s!features=\s!default]
+ % \definefontsynonym [\s!SerifBoldSlanted][Libertine-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifCaps] [Libertine-SmallCaps] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [libertine]
+ \definetypeface [libertine] [tt] [mono] [default] [default]
+ \definetypeface [libertine] [ss] [sans] [default] [default]
+ \definetypeface [libertine] [rm] [serif] [libertine] [default]
+ \stoptypescript
+
+ \starttypescript [sans] [biolinum] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:fxbr.otf] [\s!features=\s!default]
+ %definefontsynonym [\s!SansBold] [\s!file:fxbb.otf] [\s!features=\s!default] % unfinished
+ %definefontsynonym [\s!SansItalic] [\s!file:fxbri.otf] [\s!features=\s!default] % nonexistent
+ %definefontsynonym [\s!SansBoldItalic] [\s!file:fxbbi.otf] [\s!features=\s!default] % nonexistent
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\starttypescriptcollection[inconsolata]
+
+ \starttypescript [mono] [inconsolata]
+ \definefontsynonym [Inconsolata] [\s!file:inconsolata.otf]
+ \stoptypescript
+
+ \starttypescript [mono] [inconsolata] [name]
+ \setups[\s!font:\s!fallback:\s!mono]
+ \definefontsynonym [\s!Mono] [Inconsolata]
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\starttypescriptcollection[postscript]
+
+ \starttypescript [postscript]
+ \definetypeface [postscript] [rm] [\s!serif] [times] [\s!default]
+ \definetypeface [postscript] [ss] [\s!sans] [helvetica] [\s!default] [\s!rscale=0.9]
+ \definetypeface [postscript] [tt] [\s!mono] [courier] [\s!default] [\s!rscale=1.1]
+ \definetypeface [postscript] [mm] [\s!math] [times] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\starttypescriptcollection[pagella-euler]
+
+ \starttypescript [math] [euler]
+ \definefontsynonym [EulerMath] [\s!file:euler.otf]
+ \stoptypescript
+
+ \starttypescript [math] [euler] [name]
+ % \definefontsynonym [MathRoman] [EulerMath] [\s!features=math]
+ \definefontsynonym [MathRoman] [EulerMath] [\s!features=math\mathsizesuffix]
+ \stoptypescript
+
+ \starttypescript [pagella-euler]
+ \definetypeface [\typescriptone] [rm] [\s!serif] [pagella] [\s!default]
+ % \definetypeface [\typescriptone] [ss] [\s!sans] [pagella] [\s!default] [\s!rscale=auto]
+ \definetypeface [\typescriptone] [tt] [\s!mono] [modern] [\s!default] [\s!rscale=auto]
+ \definetypeface [\typescriptone] [mm] [\s!math] [euler] [\s!default] [\s!rscale=auto]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [serif] [euler] [name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [Serif] [\s!file:euler.otf] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [euler]
+ \definetypeface [euler] [rm] [\s!serif] [euler] [\s!default]
+ \definetypeface [euler] [tt] [\s!mono] [modern] [\s!default] [\s!rscale=auto]
+ \definetypeface [euler] [mm] [\s!math] [euler] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
\stoptypescriptcollection
-\endinput
+% \starttypescript [math] [hvmath]
+% \definefontsynonym[MathRoman][hvmath@hvmath-math]
+% \loadfontgoodies[hvmath-math]
+% \stoptypescript
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-otf.tex b/Master/texmf-dist/tex/context/base/type-otf.tex
deleted file mode 100644
index 720ffbaf93d..00000000000
--- a/Master/texmf-dist/tex/context/base/type-otf.tex
+++ /dev/null
@@ -1,155 +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 / 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 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[examples]
-
-\starttypescript [fallback]
- \definetypeface [] [rm] [serif] [modern] [computer-modern]
- \definetypeface [] [ss] [sans] [modern] [computer-modern]
- \definetypeface [] [tt] [mono] [modern] [computer-modern]
- \definetypeface [] [mm] [math] [modern] [computer-modern]
- \quittypescriptscanning
-\stoptypescript
-
-% faster
-%
-% \starttypescript [fallback]
-% \definetypeface [] [rm] [serif] [modern] [default]
-% \definetypeface [] [ss] [sans] [modern] [default]
-% \definetypeface [] [tt] [mono] [modern] [default]
-% \definetypeface [] [mm] [math] [modern] [default]
-% \quittypescriptscanning
-% \stoptypescript
-
-\starttypescript [modern]
- \definetypeface [modern] [rm] [serif] [modern] [computer-modern]
- \definetypeface [modern] [ss] [sans] [modern] [computer-modern]
- \definetypeface [modern] [tt] [mono] [modern] [computer-modern]
- \definetypeface [modern] [mm] [math] [modern] [computer-modern]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [modern-base]
- \definetypeface [modern] [rm] [serif] [modern] [default]
- \definetypeface [modern] [ss] [sans] [modern] [default]
- \definetypeface [modern] [tt] [mono] [modern] [default]
- \definetypeface [modern] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [postscript]
- \definetypeface [postscript] [rm] [serif] [times] [default]
- \definetypeface [postscript] [ss] [sans] [helvetica] [default] [rscale=0.9]
- \definetypeface [postscript] [tt] [mono] [courier] [default] [rscale=1.1]
- \definetypeface [postscript] [mm] [math] [times] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [times,termes]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
- \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [rscale=0.9]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.05]
- \definetypeface [\typescriptone] [mm] [math] [times] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [palatino,pagella]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [rscale=1.075]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.075]
- \definetypeface [\typescriptone] [mm] [math] [palatino] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [modernvariable]
- \definetypeface [modernvariable] [rm] [serif] [simple] [default]
- \definetypeface [modernvariable] [ss] [sans] [modern] [default]
- \definetypeface [modernvariable] [tt] [mono] [modern] [default]
- \definetypeface [modernvariable] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [antykwa-torunska]
- \definetypeface[antykwa][rm][serif][antykwa-torunska] [default]
- \definetypeface[antykwa][ss][sans] [modern] [default] [rscale=1.05]
- \definetypeface[antykwa][tt][mono] [modern] [default] [rscale=1.1]
- \definetypeface[antykwa][mm][math] [antykwa-torunska] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [schoolbook,schola]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [bookman,bonum]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [chancery,chorus]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium]
- \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default]
- \definetypeface[\typescriptone][rm][serif][modern] [default]
- \definetypeface[\typescriptone][tt][mono] [modern] [default]
- \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][text=ss]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [helvetica,heros]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.15]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [avantgarde,adventor]
- \definetypeface [\typescriptone] [ss] [sans] [adventor] [default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\starttypescript [courier,cursor]
- \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
-\stoptypescript
-
-\stoptypescriptcollection
-
-\loadmarkfile{type-otf}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-pre.tex b/Master/texmf-dist/tex/context/base/type-pre.mkii
index ad2109a65ca..ad2109a65ca 100644
--- a/Master/texmf-dist/tex/context/base/type-pre.tex
+++ b/Master/texmf-dist/tex/context/base/type-pre.mkii
diff --git a/Master/texmf-dist/tex/context/base/type-run.mkiv b/Master/texmf-dist/tex/context/base/type-run.mkiv
index 1b64c102ec6..e91398095ac 100644
--- a/Master/texmf-dist/tex/context/base/type-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-run.mkiv
@@ -25,7 +25,7 @@
\edef\typescriptone {\truetypescript{#1}}%
\edef\typescripttwo {\truetypescript{#2}}%
\edef\typescriptthree{\truetypescript{#3}}%
- \def\starttypescript
+ \unexpanded\def\starttypescript
{\bgroup
\obeylines % else we loose the first line due to lookahead
\dotripleempty\dostarttypescript}
@@ -35,7 +35,7 @@
\dochecktypescript{##2}\typescripttwo \ifdone
\dochecktypescript{##3}\typescriptthree\ifdone
\def\next%
- {\def\stoptypescript{\egroup\type{\stoptypescript}}
+ {\unexpanded\def\stoptypescript{\egroup\type{\stoptypescript}}
% what follows now is quite ugly
\skipfirstverbatimlinefalse
\type{\starttypescript}
diff --git a/Master/texmf-dist/tex/context/base/type-set.mkii b/Master/texmf-dist/tex/context/base/type-set.mkii
new file mode 100644
index 00000000000..0316f95c787
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-set.mkii
@@ -0,0 +1,81 @@
+%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 / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\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]
+ %usetypescriptfile[\f!typeprefix tmf]
+ \usetypescriptfile[\f!typeprefix siz]
+ \usetypescriptfile[\f!typeprefix otf]
+ \usetypescriptfile[\f!typeprefix xtx]
+ \usetypescriptfile[\f!typeprefix loc]
+\else
+ \usetypescriptfile[\f!typeprefix def]
+ %usetypescriptfile[\f!typeprefix tmf]
+ \usetypescriptfile[\f!typeprefix siz]
+ \usetypescriptfile[\f!typeprefix one]
+ \usetypescriptfile[\f!typeprefix loc]
+\fi
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-set.mkiv b/Master/texmf-dist/tex/context/base/type-set.mkiv
new file mode 100644
index 00000000000..d12c333fe3c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-set.mkiv
@@ -0,0 +1,77 @@
+%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 / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\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
+
+\starttypescript [serif,sans,mono] [fallback]
+ \setups[\s!font:\s!fallback:\typescriptone]
+\stoptypescript
+
+\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
+
+\usetypescriptfile[\f!typeprefix def]
+\usetypescriptfile[\f!typeprefix lua]
+%usetypescriptfile[\f!typeprefix tmf]
+\usetypescriptfile[\f!typeprefix siz]
+\usetypescriptfile[\f!typeprefix otf]
+\usetypescriptfile[\f!typeprefix loc]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-siz.mkii b/Master/texmf-dist/tex/context/base/type-siz.mkii
index 6bf7f01f45d..831019e9598 100644
--- a/Master/texmf-dist/tex/context/base/type-siz.mkii
+++ b/Master/texmf-dist/tex/context/base/type-siz.mkii
@@ -11,6 +11,163 @@
%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
diff --git a/Master/texmf-dist/tex/context/base/type-siz.mkiv b/Master/texmf-dist/tex/context/base/type-siz.mkiv
index 734c262b5ad..f513c7392a3 100644
--- a/Master/texmf-dist/tex/context/base/type-siz.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-siz.mkiv
@@ -11,6 +11,163 @@
%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-mkiv]
\starttypescript [serif] [computer-modern] [size]
@@ -218,6 +375,8 @@
\stoptypescript
+% ms=MathSymbol sa 1
+
\starttypescript [math] [modern,computer-modern,latin-modern] [size]
\definebodyfont [12pt] [mm] [mr=LMMathRoman12-Regular sa 1, mb=LMMathRoman12-Bold sa 1]
diff --git a/Master/texmf-dist/tex/context/base/type-siz.tex b/Master/texmf-dist/tex/context/base/type-siz.tex
deleted file mode 100644
index 56b54b3010a..00000000000
--- a/Master/texmf-dist/tex/context/base/type-siz.tex
+++ /dev/null
@@ -1,179 +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 / 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.
-
-% we need to use proper verbose names, which saves us a resolve
-
-\unprotect
-
-\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
-
-\protect
-
-\loadmarkfile{type-siz}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-tmf.mkii b/Master/texmf-dist/tex/context/base/type-tmf.mkii
index 3c17b0308b4..af9280c73c8 100644
--- a/Master/texmf-dist/tex/context/base/type-tmf.mkii
+++ b/Master/texmf-dist/tex/context/base/type-tmf.mkii
@@ -11,1151 +11,4 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\starttypescriptcollection[synonyms]
-
-% Computer Modern Roman : Donald Knuth
-% Latin Modern: LM Font Revision Team
-
-% LM math vs CM math (analysis by Taco):
-%
-% lmex10.tfm % identical
-% lmmi5.tfm % identical
-% lmmi6.tfm % identical
-% lmmi7.tfm % identical
-% lmmi8.tfm % identical
-% lmmi9.tfm % identical
-% lmmi10.tfm % identical
-% lmmi12.tfm % identical
-% lmmib10.tfm % identical
-% lmsy5.tfm % extra chars: 254,255 (octal)
-% lmsy6.tfm % extra chars: 254,255 (octal)
-% lmsy7.tfm % extra chars: 254,255 (octal)
-% lmsy8.tfm % extra chars: 254,255 (octal)
-% lmsy9.tfm % extra chars: 254,255 (octal)
-% lmsy10.tfm % extra chars: 254,255 (octal)
-% lmbsy10.tfm % extra chars: 254,255 (octal)
-%
-% From the 'AMS' set:
-%
-% lmmib5.tfm % identical
-% lmmib7.tfm % identical
-% lmbsy5.tfm % extra chars: 254,255 (octal)
-% lmbsy7.tfm % extra chars: 254,255 (octal)
-%
-% The two extra characters are:
-%
-% /lessorequalslant
-% /greaterorequalslant
-
-\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
-
-% Euler : Hermann Zapf
-
-\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
-
-% American Math Society : Michael Spivak
-
-\starttypescript [math] [modern,computer-modern,latin-modern,ams] [name]
- \definefontsynonym [MathAlpha] [AMS-SymbolA]
- \definefontsynonym [MathBeta] [AMS-SymbolB]
-\stoptypescript
-
-% Antykwa Torunska :
-
-\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 :
-
-\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
-
-% Iwona
-
-\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
-
-% Kurier
-
-\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
-
-% Bookman :
-
-\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
-
-% Chancery : Zapf
-
-\starttypescript [calligraphy] [chancery] [name]
- \definefontsynonym [Calligraphy] [Chancery]
-\stoptypescript
-
-% Schoolbook :
-
-\starttypescript [serif] [schoolbook] [name]
- \definefontsynonym [Serif] [Schoolbook-Roman]
- \definefontsynonym [SerifItalic] [Schoolbook-Italic]
- \definefontsynonym [SerifBold] [Schoolbook-Bold]
- \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic]
- \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted]
- \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted]
- \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps]
-\stoptypescript
-
-% Utopia : Adobe
-
-\starttypescript [serif] [utopia] [name]
- \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
-
-% Fourier : Michael Bovani
-
-\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
-
-% Charter :
-
-\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
-
-% Times :
-
-\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
-
-% Helvetica :
-
-\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
-
-% Courier :
-
-\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
-
-% Palatino : Hermann Zapf / URW
-
-\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
-
-% bonus definitions / will disappear
-
-\starttypescript [serif] [palatino] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC]
- \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF]
- \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF]
- \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF]
- \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC]
-\stoptypescript
-
-% TeXGyre
-
-% name definitions & prefixes
-
-\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
-
-\stoptypescriptcollection
-
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-tmf.mkiv b/Master/texmf-dist/tex/context/base/type-tmf.mkiv
index df7a180f07e..af9280c73c8 100644
--- a/Master/texmf-dist/tex/context/base/type-tmf.mkiv
+++ b/Master/texmf-dist/tex/context/base/type-tmf.mkiv
@@ -11,923 +11,4 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\starttypescriptcollection[synonyms]
-
-\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 [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
-
-% Antykwa Torunska :
-
-\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 :
-
-\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
-
-% Iwona
-
-\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
-
-% Kurier
-
-\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
-
-% Bookman :
-
-\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
-
-% Chancery : Zapf
-
-\starttypescript [calligraphy] [chancery] [name]
- \definefontsynonym [Calligraphy] [Chancery]
-\stoptypescript
-
-% Schoolbook :
-
-\starttypescript [serif] [schoolbook] [name]
- \definefontsynonym [Serif] [Schoolbook-Roman]
- \definefontsynonym [SerifItalic] [Schoolbook-Italic]
- \definefontsynonym [SerifBold] [Schoolbook-Bold]
- \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic]
- \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted]
- \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted]
- \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps]
-\stoptypescript
-
-% Utopia : Adobe
-
-\starttypescript [serif] [utopia] [name]
- \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
-
-% Fourier : Michael Bovani
-
-% \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
-
-% Charter :
-
-\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
-
-% Times :
-
-\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
-
-% Helvetica :
-
-\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
-
-% Courier :
-
-\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
-
-% Palatino : Hermann Zapf / URW
-
-\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
-
-% bonus definitions / will disappear
-
-\starttypescript [serif] [palatino] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC]
- \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF]
- \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF]
- \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF]
- \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC]
-\stoptypescript
-
-% TeXGyre
-
-% name definitions & prefixes
-
-\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
-
-\stoptypescriptcollection
-
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-msw.tex b/Master/texmf-dist/tex/context/base/type-win.mkii
index 4757b5008b0..cb0ad19f5dc 100644
--- a/Master/texmf-dist/tex/context/base/type-msw.tex
+++ b/Master/texmf-dist/tex/context/base/type-win.mkii
@@ -26,7 +26,7 @@
% {\tt test {\sl test} {\it test} {\bf test} {\bs test} {\bi test}}
% \stoplines
-\starttypescriptcollection[microsoft windows]
+\starttypescriptcollection[windows]
% verdana
diff --git a/Master/texmf-dist/tex/context/base/type-win.tex b/Master/texmf-dist/tex/context/base/type-win.mkiv
index bae89471fc3..3f06fa4db1d 100644
--- a/Master/texmf-dist/tex/context/base/type-win.tex
+++ b/Master/texmf-dist/tex/context/base/type-win.mkiv
@@ -63,23 +63,22 @@
\definefontsynonym [Mono] [\typescripttwo-Regular] [features=default]
\stoptypescript
-
-\definetypescriptprefix [f:arial] [Arial]
-\definetypescriptprefix [f:arialblack] [Arial Black]
-\definetypescriptprefix [f:comic] [Comic Sans MS]
-\definetypescriptprefix [f:courier] [Courier New]
-\definetypescriptprefix [f:franklin] [Franklin Gothic Medium]
-\definetypescriptprefix [f:georgia] [Georgia]
-\definetypescriptprefix [f:impact] [Impact]
-\definetypescriptprefix [f:lucidaconsole] [Lucida Console]
-\definetypescriptprefix [f:lucidasans] [Lucida Sans Unicode]
-\definetypescriptprefix [f:microsans] [Microsoft Sans Serif]
-\definetypescriptprefix [f:palatino] [Palatino Linotype]
-\definetypescriptprefix [f:sylfaen] [Sylfaen]
-\definetypescriptprefix [f:tahoma] [Tahoma]
-\definetypescriptprefix [f:times] [Times New Roman]
-\definetypescriptprefix [f:trebuchet] [Trebuchet MS]
-\definetypescriptprefix [f:verdana] [Verdana]
+\definetypescriptprefix [f:arial] [Arial]
+\definetypescriptprefix [f:arialblack] [Arial Black]
+\definetypescriptprefix [f:comic] [Comic Sans MS]
+\definetypescriptprefix [f:courier] [Courier New]
+\definetypescriptprefix [f:franklin] [Franklin Gothic Medium]
+\definetypescriptprefix [f:georgia] [Georgia]
+\definetypescriptprefix [f:impact] [Impact]
+\definetypescriptprefix [f:lucidaconsole] [Lucida Console]
+\definetypescriptprefix [f:lucidasans] [Lucida Sans Unicode]
+\definetypescriptprefix [f:microsans] [Microsoft Sans Serif]
+\definetypescriptprefix [f:palatino] [Palatino Linotype]
+\definetypescriptprefix [f:sylfaen] [Sylfaen]
+\definetypescriptprefix [f:tahoma] [Tahoma]
+\definetypescriptprefix [f:times] [Times New Roman]
+\definetypescriptprefix [f:trebuchet] [Trebuchet MS]
+\definetypescriptprefix [f:verdana] [Verdana]
\starttypescript [serif] [georgia,palatino,sylfaen,times]
\definefontsynonym [\typescripttwo-Regular] [name:\typescriptprefix{f:\typescripttwo}] [features=default]
@@ -102,7 +101,6 @@
\definefontsynonym [\typescripttwo-BoldItalic] [name:\typescriptprefix{f:\typescripttwo} Bold Italic] [features=default]
\stoptypescript
-
\starttypescript [georgia,palatino,sylfaen,times]
\definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default]
\stoptypescript
diff --git a/Master/texmf-dist/tex/context/base/type-xtx.tex b/Master/texmf-dist/tex/context/base/type-xtx.mkii
index 450beb6f2ec..0ee0130f776 100644
--- a/Master/texmf-dist/tex/context/base/type-xtx.tex
+++ b/Master/texmf-dist/tex/context/base/type-xtx.mkii
@@ -88,7 +88,6 @@
%D Here, there are no \type{<engine-options>}, because there is no
%D font discovery engine available to be queried.
-
%D TH: This \type{\xetexcolon} definition seems needed because the name/file \
%D parser otherwise drops the rest of the argument into oblivion.
diff --git a/Master/texmf-dist/tex/context/base/typo-brk.lua b/Master/texmf-dist/tex/context/base/typo-brk.lua
index 33837ab7ad8..8f7a00f9df9 100644
--- a/Master/texmf-dist/tex/context/base/typo-brk.lua
+++ b/Master/texmf-dist/tex/context/base/typo-brk.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['typo-brk'] = {
version = 1.001,
- comment = "companion to typo-brk.tex",
+ comment = "companion to typo-brk.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -9,33 +9,39 @@ if not modules then modules = { } end modules ['typo-brk'] = {
-- this code dates from the beginning and is kind of experimental; it
-- will be optimized and improved soon
-local next, type = next, type
+local next, type, tonumber = next, type, tonumber
+local utfbyte, utfchar = utf.byte, utf.char
local format = string.format
+local settings_to_array = aux.settings_to_array
local has_attribute = node.has_attribute
local unset_attribute = node.unset_attribute
local set_attribute = node.set_attribute
local copy_node = node.copy
+local free_node = node.free
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
local make_penalty_node = nodes.penalty
local make_glue_node = nodes.glue
local make_disc_node = nodes.disc
+local make_glyph_node = nodes.glyph
+local remove_node = nodes.remove -- ! nodes
+local tonodes = blobs.tonodes
-local glyph = node.id("glyph")
-local kern = node.id("kern")
+local glyph = node.id("glyph")
+local kern = node.id("kern")
breakpoints = breakpoints or { }
breakpoints.mapping = breakpoints.mapping or { }
breakpoints.methods = breakpoints.methods or { }
-breakpoints.enabled = false
breakpoints.attribute = attributes.private("breakpoint")
storage.register("breakpoints/mapping", breakpoints.mapping, "breakpoints.mapping")
local mapping = breakpoints.mapping
-function breakpoints.setreplacement(id,char,kind,before,after,language)
+function breakpoints.setreplacement(id,char,language,settings)
+ char = utfbyte(char)
local map = mapping[id]
if not map then
map = { }
@@ -46,75 +52,82 @@ function breakpoints.setreplacement(id,char,kind,before,after,language)
cmap = { }
map[char] = cmap
end
- cmap[language or ""] = { kind or 1, before or 1, after or 1 }
+ local left, right, middle = settings.left, settings.right, settings.middle
+ cmap[language or ""] = {
+ kind = tonumber(settings.kind) or 1,
+ nleft = tonumber(settings.nleft) or 1,
+ nright = tonumber(settings.nright) or 1,
+ left = left ~= "" and left or nil,
+ right = right ~= "" and right or nil,
+ middle = middle ~= "" and middle or nil,
+ } -- was { kind or 1, before or 1, after or 1 }
+end
+
+local function insert_break(head,start,before,after)
+ insert_node_before(head,start,make_penalty_node(before))
+ insert_node_before(head,start,make_glue_node(0))
+ insert_node_after(head,start,make_glue_node(0))
+ insert_node_after(head,start,make_penalty_node(after))
end
breakpoints.methods[1] = function(head,start)
if start.prev and start.next then
- insert_node_before(head,start,make_penalty_node(10000))
- insert_node_before(head,start,make_glue_node(0))
- insert_node_after(head,start,make_glue_node(0))
- insert_node_after(head,start,make_penalty_node(0))
+ insert_break(head,start,10000,0)
end
return head, start
end
breakpoints.methods[2] = function(head,start) -- ( => (-
if start.prev and start.next then
- local tmp = start
- start = make_disc_node()
- start.prev, start.next = tmp.prev, tmp.next
- tmp.prev.next, tmp.next.prev = start, start
- tmp.prev, tmp.next = nil, nil
+ local tmp
+ head, start, tmp = remove_node(head,start)
+ head, start = insert_node_before(head,start,make_disc_node())
start.replace = tmp
local tmp, hyphen = copy_node(tmp), copy_node(tmp)
hyphen.char = languages.prehyphenchar(tmp.lang)
tmp.next, hyphen.prev = hyphen, tmp
start.post = tmp
- insert_node_before(head,start,make_penalty_node(10000))
- insert_node_before(head,start,make_glue_node(0))
- insert_node_after(head,start,make_glue_node(0))
- insert_node_after(head,start,make_penalty_node(10000))
+ insert_break(head,start,10000,10000)
end
return head, start
end
breakpoints.methods[3] = function(head,start) -- ) => -)
if start.prev and start.next then
- local tmp = start
- start = make_disc_node()
- start.prev, start.next = tmp.prev, tmp.next
- tmp.prev.next, tmp.next.prev = start, start
- tmp.prev, tmp.next = nil, nil
+ local tmp
+ head, start, tmp = remove_node(head,start)
+ head, start = insert_node_before(head,start,make_disc_node())
start.replace = tmp
local tmp, hyphen = copy_node(tmp), copy_node(tmp)
hyphen.char = languages.prehyphenchar(tmp.lang)
tmp.prev, hyphen.next = hyphen, tmp
start.pre = hyphen
- insert_node_before(head,start,make_penalty_node(10000))
- insert_node_before(head,start,make_glue_node(0))
- insert_node_after(head,start,make_glue_node(0))
- insert_node_after(head,start,make_penalty_node(10000))
+ insert_break(head,start,10000,10000)
end
return head, start
end
breakpoints.methods[4] = function(head,start) -- - => - - -
if start.prev and start.next then
- local tmp = start
- start = make_disc_node()
- start.prev, start.next = tmp.prev, tmp.next
- tmp.prev.next, tmp.next.prev = start, start
- tmp.prev, tmp.next = nil, nil
- -- maybe prehyphenchar etc
- start.pre = copy_node(tmp)
- start.post = copy_node(tmp)
- start.replace = tmp
- insert_node_before(head,start,make_penalty_node(10000))
- insert_node_before(head,start,make_glue_node(0))
- insert_node_after(head,start,make_glue_node(0))
- insert_node_after(head,start,make_penalty_node(10000))
+ local tmp
+ head, start, tmp = remove_node(head,start)
+ head, start = insert_node_before(head,start,make_disc_node())
+ start.pre, start.post, start.replace = copy_node(tmp), copy_node(tmp), tmp
+ insert_break(head,start,10000,10000)
+ end
+ return head, start
+end
+breakpoints.methods[5] = function(head,start,settings) -- x => p q r
+ if start.prev and start.next then
+ local tmp
+ head, start, tmp = remove_node(head,start)
+ head, start = insert_node_before(head,start,make_disc_node())
+ start.pre, start.post, start.replace = tonodes(settings.right,tmp), tonodes(settings.left,tmp), tonodes(settings.middle,tmp)
+ free_node(tmp)
+ insert_break(head,start,10000,10000)
end
return head, start
end
+local methods = breakpoints.methods
+
function breakpoints.process(namespace,attribute,head)
local done, numbers = false, languages.numbers
local start, n = head, 0
@@ -129,20 +142,22 @@ function breakpoints.process(namespace,attribute,head)
if map then
local cmap = map[start.char]
if cmap then
- local smap = cmap[numbers[start.lang]] or cmap[""]
+ local lang = start.lang
+ -- we do a sanity check for language
+ local smap = lang and lang >= 0 and lang < 0x7FFF and (cmap[numbers[lang]] or cmap[""])
if smap then
- if n >= smap[2] then
- local m = smap[3]
+ if n >= smap.nleft then
+ local m = smap.nright
local next = start.next
- while next do -- gamble on same attribute
+ while next do -- gamble on same attribute (not that important actually)
local id = next.id
- if id == glyph then -- gamble on same attribute
+ if id == glyph then -- gamble on same attribute (not that important actually)
if map[next.char] then
break
elseif m == 1 then
- local method = breakpoints.methods[smap[1]]
+ local method = methods[smap.kind]
if method then
- head, start = method(head,start)
+ head, start = method(head,start,smap)
done = true
end
break
@@ -169,6 +184,8 @@ function breakpoints.process(namespace,attribute,head)
else
n = 0
end
+ else
+ -- n = n + 1 -- if we want single char handling (|-|) then we will use grouping and then we need this
end
elseif id == kern and start.subtype == 0 then
-- ignore intercharacter kerning, will go way
@@ -185,3 +202,7 @@ chars.handle_breakpoints = nodes.install_attribute_handler {
namespace = breakpoints,
processor = breakpoints.process,
}
+
+function breakpoints.enable()
+ tasks.enableaction("processors","chars.handle_breakpoints")
+end
diff --git a/Master/texmf-dist/tex/context/base/typo-brk.mkiv b/Master/texmf-dist/tex/context/base/typo-brk.mkiv
index 90561fc9e09..38afbb454b6 100644
--- a/Master/texmf-dist/tex/context/base/typo-brk.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-brk.mkiv
@@ -17,19 +17,17 @@
\registerctxluafile{typo-brk}{1.001}
-\definesystemattribute[breakpoint]
+\definesystemattribute[breakpoint] \chardef\breakpointattribute \dogetattributeid{breakpoint}
% compound stuff (under construction)
\newbox\breakpointbox
-\definesystemvariable {bp} % BreakPoint
-
-\exhyphenchar=\minusone % we use a different order then base tex, so we really need this
+\exhyphenchar\minusone % we use a different order then base tex, so we really need this
\newcount \maxbreakpointsid
-\def\definebreakpoints
+\unexpanded\def\definebreakpoints
{\dosingleargument\dodefinebreakpoints}
\def\dodefinebreakpoints[#1]%
@@ -42,32 +40,50 @@
{\dotripleempty\doinstallbreakpoint}
% hm, we cannot prebuild lists, font dependent
+%
+% -- type nleft nright language left right middle
+%
+% -- we might eventually stick to only method 5
\def\doinstallbreakpoint[#1][#2][#3]%
{\ifcsname\??bp:#1\endcsname
\begingroup
- \getparameters[\??bp][\c!type=1,\c!nleft=3,\c!nright=3,\s!language=,#3]%
- \ctxlua{breakpoints.setreplacement(\csname\??bp:#1\endcsname,#2,\@@bptype,\@@bpnleft,\@@bpnright,"\@@bplanguage")}%
+ \getparameters[\??bp][\c!type=1,\c!nleft=3,\c!nright=3,\s!language=,\c!left=,\c!right=,\c!middle=,#3]%
+ \ctxlua{breakpoints.setreplacement(\csname\??bp:#1\endcsname, "#2", "\@@bplanguage", {
+ kind = \@@bptype,
+ nleft = "\@@bpnleft",
+ nright = "\@@bpnright",
+ right = "\@@bpright",
+ left = "\@@bpleft",
+ middle = "\@@bpmiddle"
+ } )}% todo: table
\endgroup
\fi}
\def\setbreakpoints
- {\ctxlua{breakpoints.enabled=true}%
- \gdef\setbreakpoints[##1]{\dosetattribute{breakpoint}{\csname\??bp:##1\endcsname}}%
+ {\ctxlua{breakpoints.enable()}%
+ \gdef\setbreakpoints[##1]{\attribute\breakpointattribute\csname\??bp:##1\endcsname\relax}%
\setbreakpoints}
\letvalue{\??bp:\s!reset}\attributeunsetvalue
\definebreakpoints[compound]
-\installbreakpoint [compound] [\number`+] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`-] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`/] [\c!left=3,\c!right=3,\c!type=1]
-\installbreakpoint [compound] [\number`(] [\c!left=3,\c!right=3,\c!type=2]
-\installbreakpoint [compound] [\number`)] [\c!left=3,\c!right=3,\c!type=3]
+\installbreakpoint [compound] [+] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [-] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [/] [\c!nleft=3,\c!nright=3,\c!type=1] % middle=+,left=,right=
+\installbreakpoint [compound] [(] [\c!nleft=3,\c!nright=3,\c!type=2] % type=5,middle=(,left=(-,right=
+\installbreakpoint [compound] [)] [\c!nleft=3,\c!nright=3,\c!type=3] % type=5,middle=),left=,right=-)
+
+% \start \hsize 1.5cm \setbreakpoints[compound]
+% \installbreakpoint [compound] [-] [nleft=3,nright=3,type=5,left=,right={-},middle={-}]
+% \installbreakpoint [compound] [(] [nleft=3,nright=3,type=5,left=,right={(-},middle={(}]
+% \installbreakpoint [compound] [)] [nleft=3,nright=3,type=5,left={-)},right=,middle={)}]
+% composed-word\par composed(word)\par
+% \stop
% \mainlanguage[czech]
-% \installbreakpoint [compound] [\number`-] [language=cs,left=3,right=3,type=4]
+% \installbreakpoint [compound] [\number`-] [language=cs,nleft=3,nright=3,type=4]
% \setbreakpoints[compound]
% \start \hsize 1mm test-test \par \stop
diff --git a/Master/texmf-dist/tex/context/base/typo-cap.lua b/Master/texmf-dist/tex/context/base/typo-cap.lua
index c232ac72851..5f741da7c1d 100644
--- a/Master/texmf-dist/tex/context/base/typo-cap.lua
+++ b/Master/texmf-dist/tex/context/base/typo-cap.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['typo-cap'] = {
version = 1.001,
- comment = "companion to typo-cap.tex",
+ comment = "companion to typo-cap.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -20,10 +20,10 @@ local glyph = node.id("glyph")
local kern = node.id("kern")
local fontdata = fonts.ids
+local fontchar = fonts.chr
local chardata = characters.data
cases = cases or { }
-cases.enabled = false
cases.actions = { }
cases.attribute = attributes.private("case")
@@ -51,7 +51,8 @@ local function helper(start, code, codes, special, attribute, once)
start.font = lastfont
end
end
- local ifc = fontdata[fnt].characters
+ -- local ifc = fontdata[fnt].characters
+ local ifc = fontchar[fnt]
local ucs = dc[codes]
if ucs then
local ok = true
@@ -149,7 +150,8 @@ actions[8] = function(start)
lastfont = nil
local ch = start.char
local mr = math.random
- local tfm = fontdata[start.font].characters
+ -- local tfm = fontdata[start.font].characters
+ local tfm = fontchar[start.font]
if chardata[ch].lccode then
while true do
local d = chardata[mr(1,0xFFFF)]
@@ -202,3 +204,7 @@ chars.handle_casing = nodes.install_attribute_handler {
namespace = cases,
processor = cases.process,
}
+
+function cases.enable()
+ tasks.enableaction("processors","chars.handle_casing")
+end
diff --git a/Master/texmf-dist/tex/context/base/typo-cap.mkiv b/Master/texmf-dist/tex/context/base/typo-cap.mkiv
index 45a932200af..af4e12bc28a 100644
--- a/Master/texmf-dist/tex/context/base/typo-cap.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-cap.mkiv
@@ -17,7 +17,7 @@
\registerctxluafile{typo-cap}{1.001}
-\definesystemattribute[case]
+\definesystemattribute[case] \chardef\caseattribute \dogetattributeid{case}
%D \macros
%D {Word, Words, WORD, WORDS}
@@ -51,11 +51,13 @@
% test \word{test TEST \TeX} test
% test \Word{test TEST \TeX} test
-\def\setcharactercasing
- {\ctxlua{cases.enabled=true}%
- \gdef\setcharactercasing[##1]{\dosetattribute{case}{\number##1}}%
+\unexpanded\def\setcharactercasing
+ {\ctxlua{cases.enable()}%
+ \gdef\setcharactercasing[##1]{\attribute\caseattribute##1\relax}%
\setcharactercasing}
+% todo: names casings
+
\unexpanded\def\WORD {\groupedcommand{\setcharactercasing[\plusone ]}{}}
\unexpanded\def\word {\groupedcommand{\setcharactercasing[\plustwo ]}{}}
\unexpanded\def\Word {\groupedcommand{\setcharactercasing[\plusthree]}{}}
@@ -164,6 +166,10 @@
\let\normalWORD \WORD
\let\normalword \word
+%D As suggested by WS:
+
+\unexpanded\def\notsmallcapped{\groupedcommand{\setcharactercasing[\plustwo]\char\zerocount}{}}
+
%D \macros
%D {setupcapitals}
%D
@@ -174,10 +180,10 @@
\let\normalsmallcapped\smallcapped
-\def\setupcapitals
+\unexpanded\def\setupcapitals
{\dosingleempty\dosetupcapitals}
-\def\dosetupcapitals[#1]%
+\def\dosetupcapitals[#1]% todo: don't use grouping just a switch
{\getparameters[\??kk][#1]%
\doifelse\@@kktitle\v!yes
{\definealternativestyle[\v!capital][\normalsmallcapped][\normalsmallcapped]%
@@ -199,6 +205,8 @@
%
% \definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=]
-\def\randomizetext{\groupedcommand{\dosetattribute{case}{8}}{}}
+\def\randomizetext{\groupedcommand{\attribute\caseattribute\pluseight}{}}
+
+\definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/typo-dig.lua b/Master/texmf-dist/tex/context/base/typo-dig.lua
new file mode 100644
index 00000000000..c1b44e39f74
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/typo-dig.lua
@@ -0,0 +1,106 @@
+if not modules then modules = { } end modules ['typo-dig'] = {
+ version = 1.001,
+ comment = "companion to typo-dig.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 format, insert = string.format, table.insert
+local round = math.round
+
+local trace_digits = false trackers.register("nodes.digits", function(v) trace_digits = v end)
+
+local has_attribute = node.has_attribute
+local unset_attribute = node.unset_attribute
+local set_attribute = node.set_attribute
+local hpack_node = node.hpack
+local traverse_id = node.traverse_id
+local insert_before = node.insert_before
+local insert_after = node.insert_after
+
+local glyph = node.id("glyph")
+local kern = node.id("kern")
+
+local new_glue = nodes.glue
+
+local fontdata = fonts.identifiers
+local chardata = fonts.characters
+local quaddata = fonts.quads
+local charbase = characters.data
+
+digits = digits or { }
+digits.actions = { }
+digits.attribute = attributes.private("digits")
+
+local actions = digits.actions
+
+-- at some point we can manipulate the glyph node so then i need
+-- to rewrite this
+
+function nodes.aligned(start,stop,width,how)
+ local prv, nxt, head = start.prev, stop.next, nil
+ start.prev, stop.next = nil, nil
+ if how == "flushright" or how == "middle" then
+ head, start = insert_before(start,start,new_glue(0,65536,65536))
+ end
+ if how == "flushleft" or how == "middle" then
+ head, stop = insert_after(start,stop,new_glue(0,65536,65536))
+ end
+ local packed = hpack_node(start,width,"exactly") -- no directional mess here, just lr
+ if prv then
+ prv.next, packed.prev = packed, prv
+ end
+ if nxt then
+ nxt.prev, packed.next = packed, nxt
+ end
+ return packed, prv, nxt
+end
+
+actions[1] = function(start,attribute)
+ local char = start.char
+ if charbase[char].category == "nd" then
+ local font = start.font
+ local oldwidth, newwidth = start.width, fonts.get_digit_width(font)
+ if newwidth ~= oldwidth then
+ local start = nodes.aligned(start,start,newwidth,"middle") -- return three node pointers
+ return start, true
+ end
+ end
+ return start, false
+end
+
+function digits.process(namespace,attribute,head)
+ local done, current, ok = false, head, false
+ while current do
+ if current.id == glyph then
+ local attr = has_attribute(current,attribute)
+ if attr and attr > 0 then
+ unset_attribute(current,attribute)
+ local action = actions[attr]
+ if action then
+ if current == head then
+ head, ok = action(current,attribute)
+ current = head
+ else
+ current, ok = action(current,attribute)
+ end
+ done = done and ok
+ end
+ end
+ end
+ current = current and current.next
+ end
+ return head, done
+end
+
+chars.handle_digits = nodes.install_attribute_handler {
+ name = "digits",
+ namespace = digits,
+ processor = digits.process,
+}
+
+function digits.enable()
+ tasks.enableaction("processors","chars.handle_digits")
+end
diff --git a/Master/texmf-dist/tex/context/base/typo-dig.mkiv b/Master/texmf-dist/tex/context/base/typo-dig.mkiv
new file mode 100644
index 00000000000..d8f73141817
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/typo-dig.mkiv
@@ -0,0 +1,51 @@
+%D \module
+%D [ file=typo-dig,
+%D version=2010.01.18,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Digits,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Digits}
+
+\unprotect
+
+\registerctxluafile{typo-dig}{1.001}
+
+\definesystemattribute[digits] \chardef\digitsattribute \dogetattributeid{digits}
+
+%D This could as well be a dynamic font feature but why bother.
+%D
+%D \macros
+%D {\equaldigits}
+%D
+%D \starttyping
+%D test test \ruledhbox{123} test test\par
+%D test test \ruledhbox{\equaldigits{123}} test test\par
+%D test test \equaldigits{123} test test\par
+%D \stoptyping
+%D
+%D \typebuffer
+%D
+%D This calls result in:
+%D
+%D \startvoorbeeld
+%D \startlines
+%D \getbuffer
+%D \stoplines
+%D \stopvoorbeeld
+
+\unexpanded\def\setdigitsmanipulation
+ {\ctxlua{digits.enable()}%
+ \gdef\setdigitsmanipulation[##1]{\attribute\digitsattribute##1\relax}%
+ \setdigitsmanipulation}
+
+\unexpanded\def\equaldigits{\groupedcommand{\setdigitsmanipulation[\plusone]}{}}
+\unexpanded\def\dummydigit {\hphantom{\setdigitsmanipulation[\plusone]0}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/typo-krn.lua b/Master/texmf-dist/tex/context/base/typo-krn.lua
index d3031633d84..746773e0a88 100644
--- a/Master/texmf-dist/tex/context/base/typo-krn.lua
+++ b/Master/texmf-dist/tex/context/base/typo-krn.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['typo-krn'] = {
version = 1.001,
- comment = "companion to typo-krn.tex",
+ comment = "companion to typo-krn.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -28,18 +28,29 @@ local glue = node.id('glue')
local hlist = node.id('hlist')
local vlist = node.id('vlist')
-local fontdata = fonts.ids
-local chardata = characters.data
+local fontdata = fonts.identifiers
+local chardata = fonts.characters
+local quaddata = fonts.quads
kerns = kerns or { }
kerns.mapping = kerns.mapping or { }
-kerns.enabled = false
+kerns.factors = kerns.factors or { }
kerns.attribute = attributes.private("kern")
storage.register("kerns/mapping", kerns.mapping, "kerns.mapping")
+storage.register("kerns/factors", kerns.factors, "kerns.factors")
-function kerns.setspacing(id,factor)
- kerns.mapping[id] = factor
+local mapping = kerns.mapping
+local factors = kerns.factors
+
+function kerns.setspacing(factor)
+ local a = factors[factor]
+ if not a then
+ a = #mapping + 1
+ factors[factors], mapping[a] = a, factor
+ end
+ tex.attribute[kerns.attribute] = a
+ return a
end
-- one must use liga=no and mode=base and kern=yes
@@ -47,12 +58,9 @@ end
-- 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: cache quad and so
-
-local mapping = kerns.mapping
local function process(namespace,attribute,head,force)
- local scale = tex.scale
+ local scale = tex.scale -- will go
local start, done, lastfont = head, false, nil
while start do
-- faster to test for attr first
@@ -92,21 +100,16 @@ local function process(namespace,attribute,head,force)
-- nothing
elseif pid == kern and prev.subtype == 0 then
prev.subtype = 1
- prev.kern = prev.kern + scale(fontdata[lastfont].parameters.quad,krn)
+ prev.kern = prev.kern + scale(quaddata[lastfont],krn)
done = true
elseif pid == glyph then
- -- fontdata access can be done more efficient
if prev.font == lastfont then
local prevchar, lastchar = prev.char, start.char
- local tfm = fontdata[lastfont].characters[prevchar]
- local ickern = tfm.kerns
- if ickern and ickern[lastchar] then
- krn = scale(ickern[lastchar]+fontdata[lastfont].parameters.quad,krn)
- else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
- end
+ local kerns = chardata[lastfont][prevchar].kerns
+ local kern = kerns and kerns[lastchar] or 0
+ krn = scale(kern+quaddata[lastfont],krn)
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(quaddata[lastfont],krn)
end
insert_node_before(head,start,make_kern_node(krn))
done = true
@@ -115,9 +118,10 @@ local function process(namespace,attribute,head,force)
-- but we could have multiple glyphs involved so ...
local disc = prev -- disc
local pre, post, replace = disc.pre, disc.post, disc.replace
- if pre then -- must pair with start.prev
+ local prv, nxt = disc.prev, disc.next
+ if pre and prv then -- must pair with start.prev
-- this one happens in most cases
- local before = copy_node(disc.prev)
+ local before = copy_node(prv)
pre.prev = before
before.next = pre
before.prev = nil
@@ -127,8 +131,8 @@ local function process(namespace,attribute,head,force)
disc.pre = pre
free_node(before)
end
- if post then -- must pair with start
- local after = copy_node(disc.next)
+ if post and nxt then -- must pair with start
+ local after = copy_node(nxt)
local tail = find_node_tail(post)
tail.next = after
after.prev = tail
@@ -138,9 +142,9 @@ local function process(namespace,attribute,head,force)
disc.post = post
free_node(after)
end
- if replace then -- must pair with start and start.prev
- local before = copy_node(disc.prev)
- local after = copy_node(disc.next)
+ if replace and prv and nxt then -- must pair with start and start.prev
+ local before = copy_node(prv)
+ local after = copy_node(nxt)
local tail = find_node_tail(replace)
replace.prev = before
before.next = replace
@@ -151,22 +155,18 @@ local function process(namespace,attribute,head,force)
replace = process(namespace,attribute,before,attr)
replace = replace.next
replace.prev = nil
- tail.next = nil
+ after.prev.next = nil
disc.replace = replace
free_node(after)
free_node(before)
else
- if disc.prev.font == lastfont then
- local prevchar, lastchar = disc.prev.char, start.char
- local tfm = fontdata[lastfont].characters[prevchar]
- local ickern = tfm.kerns
- if ickern and ickern[lastchar] then
- krn = scale(ickern[lastchar]+fontdata[lastfont].parameters.quad,krn)
- else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
- end
+ if prv and prv.id == glyph and prv.font == lastfont then
+ local prevchar, lastchar = prv.char, start.char
+ local kerns = chardata[lastfont][prevchar].kerns
+ local kern = kerns and kerns[lastchar] or 0
+ krn = scale(kern+quaddata[lastfont],krn)
else
- krn = scale(fontdata[lastfont].parameters.quad,krn)
+ krn = scale(quaddata[lastfont],krn)
end
disc.replace = make_kern_node(krn)
end
@@ -191,11 +191,11 @@ local function process(namespace,attribute,head,force)
end
elseif lastfont and (id == hlist or id == vlist) then -- todo: lookahead
if start.prev then
- insert_node_before(head,start,make_kern_node(scale(fontdata[lastfont].parameters.quad,krn)))
+ insert_node_before(head,start,make_kern_node(scale(quaddata[lastfont],krn)))
done = true
end
if start.next then
- insert_node_after(head,start,make_kern_node(scale(fontdata[lastfont].parameters.quad,krn)))
+ insert_node_after(head,start,make_kern_node(scale(quaddata[lastfont],krn)))
done = true
end
end
@@ -217,3 +217,7 @@ lists.handle_kerning = nodes.install_attribute_handler {
namespace = kerns,
processor = kerns.process,
}
+
+function kerns.enable()
+ tasks.enableaction("processors","lists.handle_kerning")
+end
diff --git a/Master/texmf-dist/tex/context/base/typo-krn.mkiv b/Master/texmf-dist/tex/context/base/typo-krn.mkiv
index e2f10d8066a..b7a6113bc86 100644
--- a/Master/texmf-dist/tex/context/base/typo-krn.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-krn.mkiv
@@ -17,43 +17,63 @@
\registerctxluafile{typo-krn}{1.001}
-\definesystemattribute[kern]
+\definesystemattribute[kern] \chardef\kernattribute\dogetattributeid{kern}
% more
%
% {\setcharacterkerning[extrakerning]\input davis\relax}
-\newcount \maxcharacterkerningid
+\unexpanded\def\definecharacterkerning
+ {\dodoubleargument\dodefinecharacterkerning}
-\def\definecharacterkerning
- {\dosingleargument\dodefinecharacterkerning}
+\def\dodefinecharacterkerning[#1][#2]%
+ {\getparameters[\??ck#1][\c!factor=0.125,#2]%
+ \setgvalue{\??ck:#1}{\ctxlua{kerns.setspacing(\csname\??ck#1\c!factor\endcsname)}}}
-\def\dodefinecharacterkerning[#1]%
- {\ifcsname\??ck#1\endcsname \else
- \global\advance\maxcharacterkerningid\plusone
- \setxvalue{\??ck:#1}{\the\maxcharacterkerningid}%
- \fi}
-
-\def\setupcharacterkerning
+\unexpanded\def\setupcharacterkerning
{\dodoubleargument\dosetupcharacterkerning}
\def\dosetupcharacterkerning[#1][#2]%
{\ifcsname\??ck:#1\endcsname
- \begingroup
- \getparameters[\??ck][\c!factor=0,#2]%
- \ctxlua{kerns.setspacing(\getvalue{\??ck:#1},\@@ckfactor)}%
- \endgroup
+ \getparameters[\??ck#1][#2]%
+ \else
+ \dodefinecharacterkerning[#1][#2]% bonus
\fi}
-\def\setcharacterkerning
- {\ctxlua{kerns.enabled=true}%
- \gdef\setcharacterkerning[##1]{\dosetattribute{kern}{\csname\??ck:##1\endcsname}}%
+\unexpanded\def\setcharacterkerning
+ {\ctxlua{kerns.enable()}%
+ \unexpanded\gdef\setcharacterkerning[##1]{\csname\??ck:##1\endcsname}%
\setcharacterkerning}
\letvalue{\??ck:\s!reset}\attributeunsetvalue
-\definecharacterkerning[extrakerning]
+\definecharacterkerning [extrakerning] [\c!factor=.125] % used in manuals
+
+%D Added after discussion on list (posted by WS, adapted abit by HH)
+%D \unknown\ this needs to be interfaced (\type {\v!kerncharacters}).
+%D
+%D \starttyping
+%D \setuphead[section][style=\sca,textstyle={\kerncharacters[.5]}] \section{Section}
+%D \stoptyping
+%D
+%D We could combine this with the previous definition command but
+%D then we alwasy would get a command defined which is not beforehand
+%D a good idea.
+
+\def\v!kerncharacters{kerncharacters} % no time now for translations
+
+\definecharacterkerning [\v!kerncharacters] [\c!factor=.125]
+
+\unexpanded\def\kerncharacters
+ {\dosingleempty\dokerncharacters}
+
+\def\dokerncharacters[#1]%
+ {\groupedcommand{\dodokerncharacters{#1}}\donothing}
-\setupcharacterkerning[extrakerning][\c!factor=.125]
+\def\dodokerncharacters#1%
+ {\iffirstargument
+ \setupcharacterkerning[\v!kerncharacters][\c!factor=#1]%
+ \fi
+ \setcharacterkerning[\v!kerncharacters]}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/typo-mir.lua b/Master/texmf-dist/tex/context/base/typo-mir.lua
index 806b8e0a0b8..6c119c2f289 100644
--- a/Master/texmf-dist/tex/context/base/typo-mir.lua
+++ b/Master/texmf-dist/tex/context/base/typo-mir.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['typo-mir'] = {
version = 1.001,
- comment = "companion to typo-mir.tex",
+ comment = "companion to typo-mir.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -9,12 +9,12 @@ if not modules then modules = { } end modules ['typo-mir'] = {
local utf = unicode.utf8
local next, type = next, type
-local format, insert = string.format, table.insert
+local format, insert, sub, find, match = string.format, table.insert, string.sub, string.find, string.match
local utfchar = utf.char
-- vertical space handler
-local trace_mirroring = false trackers.register("nodes.mirroring", function(v) trace_mirroring = v end)
+local trace_mirroring = false trackers.register("nodes.mirroring", function(v) trace_mirroring = v end)
local has_attribute = node.has_attribute
local unset_attribute = node.unset_attribute
@@ -29,6 +29,7 @@ local whatsit = node.id("whatsit")
local mthnode = node.id('math')
local fontdata = fonts.ids
+local fontchar = fonts.chr
local chardata = characters.data
--~ Analysis by Idris:
@@ -56,13 +57,12 @@ local chardata = characters.data
-- elseif d == "ws" then -- Whitespace
-- elseif d == "on" then -- Other Neutrals
-mirror = mirror or { }
-mirror.enabled = false
-mirror.strip = false
-mirror.attribute = attributes.private("mirror")
+mirroring = mirroring or { }
+mirroring.strip = false
+mirroring.attribute = attributes.private("mirroring")
local state = attributes.private('state')
-local mirrora = attributes.private('mirror')
+local mirrora = attributes.private('mirroring')
local directions = characters.directions -- maybe make a special mirror table
@@ -144,7 +144,7 @@ local function force_auto_right_before()
end
end
-function mirror.process(namespace,attribute,start) -- todo: make faster
+function mirroring.process(namespace,attribute,start) -- todo: make faster
if not start.next then
return start, false
end
@@ -156,6 +156,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
local lro, rlo, prevattr, inmath = false, false, 0, false
while current do
local id = current.id
+--~ print(id,attribute,has_attribute(current,attribute))
if skipmath and id == mthnode then
local subtype = current.subtype
if subtype == 0 then
@@ -172,8 +173,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
else
local attr = has_attribute(current,attribute)
if attr and attr > 0 then
- unset_attribute(current,attribute) -- slow, needed?
---~ set_attribute(current,attribute,0) -- might be faster
+ -- unset_attribute(current,attribute) -- slow, needed?
if attr == 1 then
-- bidi parsing mode
elseif attr ~= prevattr then
@@ -238,7 +238,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
end
if d == "on" then
local mirror = chardata[char].mirror -- maybe make a special mirror table
- if mirror and fontdata[current.font].characters[mirror] then
+ if mirror and fontchar[current.font][mirror] then
-- todo: set attribute
if autodir < 0 then
current.char = mirror
@@ -254,10 +254,16 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
if autodir <= 0 then
force_auto_left_before()
end
- elseif d == "r" or d == "al" or d == "an" then -- arabic left, arabic number
+ elseif d == "r" or d == "al" then -- arabic number
if autodir >= 0 then
force_auto_right_before()
end
+ elseif d == "an" then -- arabic number
+ -- actually this is language dependent ...
+ if autodir <= 0 then
+--~ force_auto_right_before()
+ force_auto_left_before()
+ end
elseif d == "lro" then -- Left-to-Right Override -> right becomes left
if trace_mirroring then
list[#list+1] = "override right -> left"
@@ -306,12 +312,10 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
end
obsolete[#obsolete+1] = current
end
- else
- if trace_mirroring then
- local char = current.char
- local d = directions[char]
- list[#list+1] = format("char %s (%s / U+%04X) of class %s (no bidi)",utfchar(char),char,char,d)
- end
+ elseif trace_mirroring then
+ local char = current.char
+ local d = directions[char]
+ list[#list+1] = format("char %s (%s / U+%04X) of class %s (no bidi)",utfchar(char),char,char,d or "?")
end
elseif id == whatsit then
if finish then
@@ -320,8 +324,8 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
local subtype = current.subtype
if subtype == 6 then
local dir = current.dir
- local d = dir:sub(2,2) -- -- -- -- -- why is this not used
- if dir:find(".R.") then -- -- d == "R" or just dir == "TRT"
+ local d = sub(dir,2,2)
+ if d == 'R' then -- find(dir,".R.") / dir == "TRT"
autodir = -1
else
autodir = 1
@@ -332,8 +336,9 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
end
elseif subtype == 7 then
local dir = current.dir
- local sign = dir:sub(1,1)
- local dire = dir:sub(3,3)
+ -- local sign = sub(dir,1,1)
+ -- local dire = sub(dir,3,3)
+ local sign, dire = match(dir,"^(.).(.)")
if dire == "R" then
if sign == "+" then
finish, autodir = "TRT", -1
@@ -375,7 +380,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
end
logs.report("bidi","stop log")
end
- if done and mirror.strip then
+ if done and mirroring.strip then
local n = #obsolete
if n > 0 then
for i=1,n do
@@ -404,7 +409,11 @@ end
--~ end
chars.handle_mirroring = nodes.install_attribute_handler {
- name = "mirror",
- namespace = mirror,
- processor = mirror.process,
+ name = "mirroring",
+ namespace = mirroring,
+ processor = mirroring.process,
}
+
+function mirroring.enable()
+ tasks.enableaction("processors","chars.handle_mirroring")
+end
diff --git a/Master/texmf-dist/tex/context/base/typo-mir.mkiv b/Master/texmf-dist/tex/context/base/typo-mir.mkiv
index fe9d793e051..4c85262aab2 100644
--- a/Master/texmf-dist/tex/context/base/typo-mir.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-mir.mkiv
@@ -17,21 +17,21 @@
\registerctxluafile{typo-mir}{1.001}
-\definesystemattribute[mirror]
+\definesystemattribute[mirroring] \chardef\mirroringattribute \dogetattributeid{mirroring}
% experimental mirroring
\def\setcharactermirroring
- {\ctxlua{mirror.enabled=true}%
- \gdef\setcharactermirroring[##1]{\dosetattribute{mirror}{\number##1}}%
+ {\ctxlua{mirroring.enable()}%
+ \gdef\setcharactermirroring[##1]{\attribute\mirroringattribute##1\relax}%
\setcharactermirroring}
\def\resetcharactermirroring
- {\doresetattribute{mirror}}
+ {\attribute\mirroringattribute\attributeunsetvalue}
\newtoks\everysetupdirections
-\def\setupdirections[#1]% there will be more like setting up directions themselves
+\unexpanded\def\setupdirections[#1]% there will be more like setting up directions themselves
{\getparameters[\??di][#1]%
\the\everysetupdirections}
@@ -100,9 +100,9 @@
\def\biditest#1#2#3% font text raw
{\dontleavehmode\hbox
{\framed[offset=overlay]{\tttf#2}\quad
- \ctxlua{mirror.trace = true}%
+ \enabletrackers[nodes.mirroring]%
\framed[offset=overlay]{#1#3}\quad
- \ctxlua{mirror.trace = false}
+ \disabletrackers[nodes.mirroring]%
\tttf\ctxlua{document.split_tokens([[\detokenize{#3}]])}}}
\startbuffer[bidi-sample]
diff --git a/Master/texmf-dist/tex/context/base/typo-rep.lua b/Master/texmf-dist/tex/context/base/typo-rep.lua
new file mode 100644
index 00000000000..6fde21482c7
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/typo-rep.lua
@@ -0,0 +1,135 @@
+if not modules then modules = { } end modules ['typo-rep'] = {
+ 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 was rather boring to program (more of the same) but I could
+-- endure it by listening to a couple cd's by The Scene and The Lau
+-- on the squeezebox on my desk.
+
+local trace_stripping = false trackers.register("nodes.stripping", function(v) trace_stripping = v end)
+ trackers.register("fonts.stripping", function(v) trace_stripping = v end)
+
+local delete_node = nodes.delete
+local replace_node = nodes.replace
+local copy_node = node.copy
+local has_attribute = node.has_attribute
+
+local chardata = characters.data
+local collected = false
+local glyph = node.id("glyph")
+local attribute = attributes.private("stripping")
+local fontdata = fonts.ids
+
+nodes.stripping = nodes.stripping or { }
+local stripping = nodes.stripping
+stripping.glyphs = stripping.glyphs or { }
+local glyphs = stripping.glyphs
+
+local function initialize()
+ for k,v in next, chardata do
+ if v.category == "cf" and v.visible ~= "yes" then
+ if not glyphs[k] then
+ glyphs[k] = true
+ end
+ end
+ end
+ initialize = nil
+end
+
+local function process(what,head,current,char)
+ if what == true then
+ if trace_stripping then
+ logs.report("fonts","deleting 0x%05X from text",char)
+ end
+ head, current = delete_node(head,current)
+ elseif type(what) == "function" then
+ head, current = what(head,current)
+ current = current.next
+ if trace_stripping then
+ logs.report("fonts","processing 0x%05X in text",char)
+ end
+ elseif what then -- assume node
+ head, current = replace_node(head,current,copy_node(what))
+ current = current.next
+ if trace_stripping then
+ logs.report("fonts","replacing 0x%05X in text",char)
+ end
+ end
+ return head, current
+end
+
+function nodes.stripping.process(head)
+ local current, done = head, false
+ while current do
+ if current.id == glyph then
+ -- it's more efficient to keep track of what needs to be kept
+ local todo = has_attribute(current,attribute)
+ if todo == 1 then
+ local char = current.char
+ local what = glyphs[char]
+ if what then
+ head, current = process(what,head,current,char)
+ done = true
+ else -- handling of spacing etc has to be done elsewhere
+ current = current.next
+ end
+ else
+ current = current.next
+ end
+ else
+ current = current.next
+ end
+ end
+ return head, done
+end
+
+tasks.appendaction("processors","fonts","nodes.stripping.process",nil,"nodes.process_characters")
+tasks.disableaction("processors","nodes.stripping.process")
+
+function nodes.stripping.enable()
+ if initialize then initialize() end
+ tasks.enableaction("processors","nodes.stripping.process")
+ function nodes.stripping.enable() end
+end
+
+-- bonus:
+
+local initializers, methods = fonts.initializers, fonts.methods
+
+local function processformatters(head,font)
+ local how = fontdata[font].shared.features.formatters -- slow
+ if how == nil or how == "strip" then -- nil when forced
+ local current, done = head, false
+ while current do
+ if current.id == glyph and current.subtype<256 and current.font == font then
+ local char = current.char
+ local what = glyphs[char]
+ if what then
+ head, current = process(what,head,current,char)
+ done = true
+ else -- handling of spacing etc has to be done elsewhere
+ current = current.next
+ end
+ else
+ current = current.next
+ end
+ end
+ return head, done
+ else
+ return head, false
+ end
+end
+
+function initializers.common.formatters(tfmdata,value)
+ if initialize then initialize() end
+end
+
+initializers.base.otf.formatters = initializers.common.formatters
+initializers.node.otf.formatters = initializers.common.formatters
+
+methods.node.otf.formatters = processformatters
+methods.base.otf.formatters = processformatters
diff --git a/Master/texmf-dist/tex/context/base/typo-rep.mkiv b/Master/texmf-dist/tex/context/base/typo-rep.mkiv
new file mode 100644
index 00000000000..2f1d8b4cbee
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/typo-rep.mkiv
@@ -0,0 +1,53 @@
+%D \module
+%D [ file=typo-rep,
+%D version=2010.05.23,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Stripping,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Stripping}
+
+% experimental stripping
+
+%D For a while we had stripping built into the analyzer. Khaled
+%D suggested to generalize this so I changed the code into a
+%D manipulator there.
+%D
+%D \starttyping
+%D \definefontfeature[default][default][mode=node,formatters=strip]
+%D \stoptyping
+%D
+%D However, in \MKIV\ it makes more sense to also provide it as a more
+%D general feature. Here we implement this as experiment. I might
+%D cook up a few more variants in both variants.
+%D
+%D \starttyping
+%D \setcharacterstripping[1]
+%D \stoptyping
+
+\unprotect
+
+\registerctxluafile{typo-rep}{1.001}
+
+\definesystemattribute[stripping] \chardef\strippingattribute \dogetattributeid{stripping}
+
+\def\setcharacterstripping
+ {\ctxlua{nodes.stripping.enable()}%
+ \gdef\setcharacterstripping[##1]{\attribute\strippingattribute##1\relax}%
+ \setcharacterstripping}
+
+\def\resetcharacterstripping
+ {\attribute\strippingattribute\attributeunsetvalue}
+
+% maybe .. this might disappear, but is handy for testing
+
+\def\forcecharacterstripping % secret command
+ {\ctxlua{fonts.otf.features.register("formatters",true)}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/typo-spa.lua b/Master/texmf-dist/tex/context/base/typo-spa.lua
index 20861d08b32..48c7263c70e 100644
--- a/Master/texmf-dist/tex/context/base/typo-spa.lua
+++ b/Master/texmf-dist/tex/context/base/typo-spa.lua
@@ -1,11 +1,13 @@
if not modules then modules = { } end modules ['typo-spa'] = {
version = 1.001,
- comment = "companion to typo-spa.tex",
+ comment = "companion to typo-spa.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
+-- get rid of tex.scale here
+
local utf = unicode.utf8
local next, type = next, type
@@ -21,11 +23,12 @@ local remove_node = nodes.remove
local make_penalty_node = nodes.penalty
local make_glue_node = nodes.glue
local glyph = node.id("glyph")
-local fontdata = fonts.ids
+
+local fontdata = fonts.identifiers
+local quaddata = fonts.quads
spacings = spacings or { }
spacings.mapping = spacings.mapping or { }
-spacings.enabled = false
spacings.attribute = attributes.private("spacing")
storage.register("spacings/mapping", spacings.mapping, "spacings.mapping")
@@ -56,10 +59,10 @@ function spacings.process(namespace,attribute,head)
local map = mapping[attr]
if map then
map = map[start.char]
- unset_attribute(start,attribute)
+ unset_attribute(start,attribute) -- needed?
if map then
local left, right, alternative = map.left, map.right, map.alternative
- local quad = fontdata[start.font].parameters.quad
+ local quad = quaddata[start.font]
local prev = start.prev
if left and left ~= 0 and prev then
local ok = false
@@ -148,3 +151,17 @@ lists.handle_spacing = nodes.install_attribute_handler {
namespace = spacings,
processor = spacings.process,
}
+
+function spacings.enable()
+ tasks.enableaction("processors","lists.handle_spacing")
+end
+
+--~ local data = {
+--~ name = "spacing",
+--~ namespace = spacings,
+--~ processor = spacings.process,
+--~ }
+--~ nodes.process_attribute = process_attribute
+--~ function lists.handle_spacing(head)
+--~ return process_attribute(head,data)
+--~ end
diff --git a/Master/texmf-dist/tex/context/base/typo-spa.mkiv b/Master/texmf-dist/tex/context/base/typo-spa.mkiv
index d1b855edd6b..e059b62e454 100644
--- a/Master/texmf-dist/tex/context/base/typo-spa.mkiv
+++ b/Master/texmf-dist/tex/context/base/typo-spa.mkiv
@@ -17,7 +17,7 @@
\registerctxluafile{typo-spa}{1.001}
-\definesystemattribute[spacing]
+\definesystemattribute[spacing] \chardef\spacingattribute \dogetattributeid{spacing}
% experimental spacing
%
@@ -25,13 +25,13 @@
\newcount \maxcharacterspacingid
-\def\definecharacterspacing[#1]%
+\unexpanded\def\definecharacterspacing[#1]%
{\ifcsname\??ch#1\endcsname \else
\global\advance\maxcharacterspacingid\plusone
\setxvalue{\??ch:#1}{\the\maxcharacterspacingid}%
\fi}
-\def\setupcharacterspacing
+\unexpanded\def\setupcharacterspacing
{\dotripleargument\dosetupcharacterspacing}
\def\dosetupcharacterspacing[#1][#2][#3]%
@@ -43,12 +43,12 @@
\fi}
\def\setcharacterspacing
- {\ctxlua{spacings.enabled=true}%
- \gdef\setcharacterspacing[##1]{\dosetattribute{spacing}{\csname\??ch:##1\endcsname}}%
+ {\ctxlua{spacings.enable()}%
+ \gdef\setcharacterspacing[##1]{\attribute\spacingattribute\csname\??ch:##1\endcsname\relax}%
\setcharacterspacing}
\def\resetcharacterspacing
- {\doresetattribute{spacing}}
+ {\attribute\spacingattribute\attributeunsetvalue}
\letvalue{\??ch:\s!reset}\attributeunsetvalue
diff --git a/Master/texmf-dist/tex/context/base/unic-031.mkii b/Master/texmf-dist/tex/context/base/unic-031.mkii
index ae6bc1b8e4b..13fd47a5484 100644
--- a/Master/texmf-dist/tex/context/base/unic-031.mkii
+++ b/Master/texmf-dist/tex/context/base/unic-031.mkii
@@ -271,13 +271,3 @@
\stopunicodevector
\protect \endinput
-
-
-
-
-
-
-
-
-
-
diff --git a/Master/texmf-dist/tex/context/base/verb-eif.mkii b/Master/texmf-dist/tex/context/base/verb-eif.mkii
index 5904abc6e54..68c84d4bef4 100644
--- a/Master/texmf-dist/tex/context/base/verb-eif.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-eif.mkii
@@ -64,7 +64,7 @@
%D We borrow most of the macros from the \PERL\ driver.
-\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/verb-ini.mkii b/Master/texmf-dist/tex/context/base/verb-ini.mkii
index 4726d0eace4..829e10fd82e 100644
--- a/Master/texmf-dist/tex/context/base/verb-ini.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-ini.mkii
@@ -1455,11 +1455,8 @@
\ifCONTEXT \else
- \input verb-tex
- \input verb-mp
- \input verb-pl
- \input verb-jv
- \input verb-sql
+ \input verb-tex.mkii
+ \input verb-mp.mkii
\def\startTEX
{\bgroup \everypar{}%
@@ -1471,26 +1468,8 @@
\let\obeycharacters\setupprettyMPtype
\processdisplayverbatim{\stopMP}}
- \def\startPL
- {\bgroup \everypar{}%
- \let\obeycharacters\setupprettyPLtype
- \processdisplayverbatim{\stopPL}}
-
- \def\startJV
- {\bgroup \everypar{}%
- \let\obeycharacters\setupprettyJVtype
- \processdisplayverbatim{\stopJV}}
-
- \def\startSQL
- {\bgroup \everypar{}%
- \let\obeycharacters\setupprettySQLtype
- \processdisplayverbatim{\stopSQL}}
-
\let\stopTEX=\egroup
\let\stopMP =\egroup
- \let\stopPL =\egroup
- \let\stopJV =\egroup
- \let\stopSQL=\egroup
\fi
diff --git a/Master/texmf-dist/tex/context/base/verb-js.mkii b/Master/texmf-dist/tex/context/base/verb-js.mkii
index 3d1b69f8b7d..e497e475b05 100644
--- a/Master/texmf-dist/tex/context/base/verb-js.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-js.mkii
@@ -32,7 +32,7 @@
%D a slightly adapted \PERL\ visualization. First we load the
%D \PERL\ module:
-\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/verb-jv.mkii b/Master/texmf-dist/tex/context/base/verb-jv.mkii
index 197b37ee706..ee79e5c03d7 100644
--- a/Master/texmf-dist/tex/context/base/verb-jv.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-jv.mkii
@@ -22,7 +22,7 @@
%D driver looks much like the \JAVASCRIPT\ one, we don't
%D comment it extensively.
-\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/verb-pas.mkii b/Master/texmf-dist/tex/context/base/verb-pas.mkii
index 0c9850abfd9..71c0b5a1252 100644
--- a/Master/texmf-dist/tex/context/base/verb-pas.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-pas.mkii
@@ -36,7 +36,7 @@
%D [palet=,icommand=\bf,vcommand=,ccommand=\it]
%D \stopbuffer
-\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/verb-raw.mkii b/Master/texmf-dist/tex/context/base/verb-raw.mkii
index 32903db7736..43a0891a039 100644
--- a/Master/texmf-dist/tex/context/base/verb-raw.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-raw.mkii
@@ -1,7 +1,7 @@
-\ifx\undefined\setupprettyTEXtype \input verb-tex \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\gdef\setupprettyRAWtype%
{\setupprettyTEXtype
\def\prettyidentifier{RAW}}
-
-\endinput
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/verb-sql.mkii b/Master/texmf-dist/tex/context/base/verb-sql.mkii
index a00841d7341..f145607f819 100644
--- a/Master/texmf-dist/tex/context/base/verb-sql.mkii
+++ b/Master/texmf-dist/tex/context/base/verb-sql.mkii
@@ -49,7 +49,7 @@
%D Like we did with the \JAVASCRIPT\ driver, we will borrow
%D most of the macros from the \PERL\ driver.
-\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
+\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua
new file mode 100644
index 00000000000..c2b15e3132f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua
@@ -0,0 +1,267 @@
+if not modules then modules = { } end modules ['x-asciimath'] = {
+ version = 1.001,
+ comment = "companion to x-asciimath.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[ldx--
+<p>Some backgrounds are discussed in <t>x-asciimath.mkiv</t>.</p>
+--ldx]]--
+
+local trace_mapping = false if trackers then trackers.register("asciimath.mapping", function(v) trace_mapping = v end) end
+
+local format = string.format
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local lpegmatch = lpeg.match
+
+local S, P, R, C, V, Cc, Ct, Cs = lpeg.S, lpeg.P, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Ct, lpeg.Cs
+
+local letter = lpeg.patterns.utf8
+local space = S(" \n\r\t")
+local spaces = space^0/""
+local integer = P("-")^-1 * R("09")^1
+local realpart = P("-")^-1 * R("09")^1 * S(".")^1 * R("09")^1
+local number = integer -- so we can support nice formatting if needed
+local real = realpart -- so we can support nice formatting if needed
+local float = realpart * P("E") * integer -- so we can support nice formatting if needed
+local texnic = P("\\") * (R("az","AZ")^1)
+
+local premapper = Cs ( (
+
+ P("@") / "\\degrees " +
+ P("O/") / "\\varnothing " +
+ P("o+") / "\\oplus " +
+ P("o.") / "\\ocirc " +
+ P("!in") / "\\not\\in " +
+ P("!=") / "\\neq " +
+ P("**") / "\\star " +
+ P("*") / "\\cdot " +
+ P("//") / "\\slash " +
+ P("/_") / "\\angle " +
+ P("\\\\") / "\\backslash " +
+ P("^^^") / "\\wedge " +
+ P("^^") / "\\wedge " +
+ P("<<") / "\\left\\langle " +
+ P(">>") / "\\right\\rangle " +
+ P("<=") / "\\leq " +
+ P(">=") / "\\geq " +
+ P("-<") / "\\precc " +
+ P(">-") / "\\succ " +
+ P("~=") / "\\cong " +
+ P("~~") / "\\approx " +
+ P("=>") / "\\Rightarrow " +
+ P("(:") / "\\left\\langle " +
+ P(":)") / "\\right\\rangle " +
+ P(":.") / "\\therefore " +
+ P("~|") / "\\right\\rceil " +
+ P("_|_") / "\\bot " +
+ P("_|") / "\\right\\rfloor " +
+ P("+-") / "\\pm " +
+ P("|--") / "\\vdash " +
+ P("|==") / "\\models " +
+ P("|_") / "\\left\\lfloor " +
+ P("|~") / "\\left\\lceil " +
+ P("-:") / "\\div " +
+ P("_=") / "\\equiv " +
+
+ P("|") / "\\middle\\| " +
+
+ P("dx") / "(dx)" +
+ P("dy") / "(dy)" +
+ P("dz") / "(dz)" +
+
+ letter + P(1)
+
+)^0 )
+
+local reserved = {
+ ["aleph"] = "\\aleph ",
+ ["vdots"] = "\\vdots ",
+ ["ddots"] = "\\ddots ",
+ ["oint"] = "\\oint ",
+ ["grad"] = "\\nabla ",
+ ["prod"] = "\\prod ",
+ ["prop"] = "\\propto ",
+ ["sube"] = "\\subseteq ",
+ ["supe"] = "\\supseteq ",
+ ["sinh"] = "\\sinh ",
+ ["cosh"] = "\\cosh ",
+ ["tanh"] = "\\tanh ",
+ ["sum"] = "\\sum ",
+ ["vvv"] = "\\vee ",
+ ["nnn"] = "\\cap ",
+ ["uuu"] = "\\cup ",
+ ["sub"] = "\\subset ",
+ ["sup"] = "\\supset ",
+ ["not"] = "\\lnot ",
+ ["iff"] = "\\Leftrightarrow ",
+ ["int"] = "\\int ",
+ ["del"] = "\\partial ",
+ ["and"] = "\\and ",
+ ["not"] = "\\not ",
+ ["sin"] = "\\sin ",
+ ["cos"] = "\\cos ",
+ ["tan"] = "\\tan ",
+ ["csc"] = "\\csc ",
+ ["sec"] = "\\sec ",
+ ["cot"] = "\\cot ",
+ ["log"] = "\\log ",
+ ["det"] = "\\det ",
+ ["lim"] = "\\lim ",
+ ["mod"] = "\\mod ",
+ ["gcd"] = "\\gcd ",
+ ["lcm"] = "\\lcm ",
+ ["min"] = "\\min ",
+ ["max"] = "\\max ",
+ ["xx"] = "\\times ",
+ ["in"] = "\\in ",
+ ["ox"] = "\\otimes ",
+ ["vv"] = "\\vee ",
+ ["nn"] = "\\cap ",
+ ["uu"] = "\\cup ",
+ ["oo"] = "\\infty ",
+ ["ln"] = "\\ln ",
+ ["or"] = "\\or ",
+
+ ["AA"] = "\\forall ",
+ ["EE"] = "\\exists ",
+ ["TT"] = "\\top ",
+ ["CC"] = "\\Bbb{C}",
+ ["NN"] = "\\Bbb{N}",
+ ["QQ"] = "\\Bbb{Q}",
+ ["RR"] = "\\Bbb{R}",
+ ["ZZ"] = "\\Bbb{Z}",
+
+}
+
+local postmapper = Cs ( (
+
+ P("\\mathoptext ") * spaces * (P("\\bgroup ")/"{") * (1-P("\\egroup "))^1 * (P("\\egroup ")/"}") +
+
+ (P("\\bgroup ")) / "{" +
+ (P("\\egroup ")) / "}" +
+
+ P("\\") * (R("az","AZ")^2) +
+
+ (R("AZ","az")^2) / reserved +
+
+ P("{:") / "\\left." +
+ P(":}") / "\\right." +
+ P("(") / "\\left(" +
+ P(")") / "\\right)" +
+ P("[") / "\\left[" +
+ P("]") / "\\right]" +
+ P("{") / "\\left\\{" +
+ P("}") / "\\right\\}" +
+
+ letter + P(1)
+)^0 )
+
+local parser
+
+local function converted(original,totex)
+ local ok, result
+ if trace_mapping then
+ logs.report("asciimath","original : %s",original)
+ end
+ local premapped = lpegmatch(premapper,original)
+ if premapped then
+ if trace_mapping then
+ logs.report("asciimath","prepared : %s",premapped)
+ end
+ local parsed = lpegmatch(parser,premapped)
+ if parsed then
+ if trace_mapping then
+ logs.report("asciimath","parsed : %s",parsed)
+ end
+ local postmapped = lpegmatch(postmapper,parsed)
+ if postmapped then
+ if trace_mapping then
+ logs.report("asciimath","finalized : %s",postmapped)
+ end
+ result, ok = postmapped, true
+ else
+ result = "error in postmapping"
+ end
+ else
+ result = "error in mapping"
+ end
+ else
+ result = "error in premapping"
+ end
+ if totex then
+ if ok then
+ texsprint(ctxcatcodes,"\\mathematics{",result,"}")
+ else
+ texsprint(ctxcatcodes,"{\\tt",result,"}")
+ end
+ else
+ return result
+ end
+end
+
+local function onlyconverted(str)
+ local parsed = lpegmatch(parser,str)
+ return parsed or str
+end
+
+local sqrt = P("sqrt") / "\\rootradical \\bgroup \\egroup "
+local root = P("root") / "\\rootradical "
+local frac = P("frac") / "\\frac "
+local stackrel = P("stackrel") / "\\stackrel "
+local text = P("text") / "\\mathoptext "
+local hat = P("hat") / "\\widehat "
+local overbar = P("bar") / "\\overbar "
+local underline = P("ul") / "\\underline "
+local vec = P("vec") / "\\overrightarrow "
+local dot = P("dot") / "\\dot "
+local ddot = P("ddot") / "\\ddot "
+
+local left = P("(:") + P("{:") + P("(") + P("[") + P("{")
+local right = P(":)") + P(":}") + P(")") + P("]") + P("}")
+local leftnorright = 1 - left - right
+local singles = sqrt + text + hat + underline + overbar + vec + ddot + dot
+local doubles = root + frac + stackrel
+local ignoreleft = (left/"") * spaces * spaces
+local ignoreright = spaces * (right/"") * spaces
+local ignoreslash = spaces * (P("/")/"") * spaces
+local comma = P(",")
+local nocomma = 1-comma
+local anychar = P(1)
+local openmatrix = left * spaces * Cc("\\matrix\\bgroup ")
+local closematrix = Cc("\\egroup ") * spaces * right
+local nextcolumn = spaces * (comma/"&") * spaces
+local nextrow = spaces * (comma/"\\cr ") * spaces
+local finishrow = Cc("\\cr ")
+local opengroup = left/"\\bgroup "
+local closegroup = right/"\\egroup "
+local somescript = S("^_") * spaces
+local beginargument = Cc("\\bgroup ")
+local endargument = Cc("\\egroup ")
+
+parser = Cs { "main",
+
+ scripts = somescript * V("argument"),
+ division = Cc("\\frac") * V("argument") * spaces * ignoreslash * spaces * V("argument"),
+ double = doubles * spaces * V("argument") * spaces * V("argument"),
+ single = singles * spaces * V("argument"),
+
+ balanced = opengroup * (C((leftnorright + V("balanced"))^0)/onlyconverted) * closegroup,
+ argument = V("balanced") + V("token"),
+
+ element = (V("step") + (V("argument") + V("step")) - ignoreright - nextcolumn - comma)^1,
+ commalist = ignoreleft * V("element") * (nextcolumn * spaces * V("element"))^0 * ignoreright,
+ matrix = openmatrix * spaces * (V("commalist") * (nextrow * V("commalist"))^0) * finishrow * closematrix,
+
+ token = beginargument * (texnic + float + real + number + letter) * endargument,
+
+ step = V("scripts") + V("division") + V("single") + V("double"),
+ main = (V("matrix") + V("step") + anychar)^0,
+
+}
+
+asciimath = { }
+asciimath.reserved = reserved
+asciimath.convert = converted
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
new file mode 100644
index 00000000000..c9252408d83
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
@@ -0,0 +1,96 @@
+%D \module
+%D [ file=m-asciimath,
+%D version=2006.04.24, % 1999.11.06,
+%D title=\CONTEXT\ Modules,
+%D subtitle=AsciiMath,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D Lua code.
+
+\ctxloadluafile{x-asciimath}{}
+
+%D The following code is not officially supported and is only meant
+%D for the Math4All project.
+%D
+%D The following code kind of maps ascii math
+%D http://www1.chapman.edu/~jipsen/mathml/asciimath.html onto \TEX. The
+%D code was written for the math4all project but in retrospect we
+%D could have used just tex code as the web version can handle that
+%D as well. Anyhow, as we use \MATHML\ as basis it makes sense to add
+%D this to the repertoire as annotation variant, so now we have
+%D content \MATHML\ (prefered), presentation \MATHML\ (often messy),
+%D \OPENMATH\ (what was which we started with in this project)
+%D calcmath (handy for students who are accustomed to calculators),
+%D asciimath (to make Frits's live easier) and of course \TEX. Of
+%D course all are used mixed.
+%D
+%D We don't support all quirks of asciimath as I am not in the mood to
+%D write a complex parser while a bit of sane coding can work as well.
+%D
+%D \startitemize
+%D \item We support only the syntactically clear variants and as long
+%D as lpeg does not support left recursion this is as far as we
+%D want to go.
+%D \item The parser is rather insensitive for spaces but yet the advice is
+%D to avoid weird coding like \type {d/dxf(x)} but use \type {d/dx
+%D f(x)} instead. After all we're not in a compact coding cq.\
+%D parser challenge.
+%D \item We also don't support the somewhat confusing \type {sqrt sqrt 2}
+%D nor \type {root3x} (although the second one kind of works). A bit
+%D of defensive coding does not hurt.
+%D \item We can process \type {a/b/c/d} but it's not compatible with the
+%D default behaviour of asciimath. Use grouping instead. Yes, we do
+%D support the somewhat nonstandard grouping token mix.
+%D \item You should use explicit \type {text(..)} directives as one can
+%D never be sure what is a reserved word and not.
+%D \stopitemize
+%D
+%D Actually, as the only parsing sensitive elements of \TEX\ are
+%D fractions (\type {\over} and friends, a restricted use of \TEX\
+%D coding is probably as comprehensive and parseble.
+%D
+%D The webpage with examples served as starting point so anything beyond
+%D what can be found there isn't supported.
+
+\unprotect
+
+\writestatus{asciimath}{beware, this is an experimental (m4all only) module}
+
+\unexpanded\def\asciimath#1{\ctxlua{asciimath.convert(\!!bs\detokenize{#1}\!!es,true)}}
+
+\protect
+
+\doifnotmode{demo}{\endinput}
+
+\enabletrackers[asciimath.mapping]
+
+\starttext
+
+\startlines
+\asciimath{x^2+y_1+z_12^34}
+\asciimath{sin^-1(x)}
+\asciimath{d/dx f(x)=lim_(h->0) (f(x+h)-f(x))/h}
+\asciimath{f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n}
+\asciimath{int_0^1 f(x)dx}
+\asciimath{int^1_0 f(x)dx}
+\asciimath{a//b}
+\asciimath{(a/b)/(d/c)}
+\asciimath{((a*b))/(d/c)}
+\asciimath{[[a,b],[c,d]]((n),(k))}
+\asciimath{1/x={(1,text{if } x!=0),(text{undefined},if x=0):}}
+\asciimath{{ (1,2), (x,(x + text(x))) }}
+\asciimath{{(1,2),(x,(x+text(x))),(x,text(x))}}
+\asciimath{{(1,2),(x,(x+text(x))),(x,x text(x))}}
+\asciimath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,x text(xyz))}}
+\asciimath{{(1,2/2),(x,(x+x^22+sqrt(xx))),(x,text(xyz)+1+text(hans))}}
+\asciimath{<<a,b>> text{and} {:(x,y),(u,v):}}
+\asciimath{(a,b] = {x text(in) RR | a < x <= b}}
+\stoplines
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/x-calcmath.lua b/Master/texmf-dist/tex/context/base/x-calcmath.lua
index fcb6b7470a6..e4d5da139f9 100644
--- a/Master/texmf-dist/tex/context/base/x-calcmath.lua
+++ b/Master/texmf-dist/tex/context/base/x-calcmath.lua
@@ -6,7 +6,8 @@ if not modules then modules = { } end modules ['x-calcmath'] = {
license = "see context related readme files"
}
-local format, lower, upper, gsub = string.format, string.lower, string.upper, string.gsub
+local format, lower, upper, gsub, sub = string.format, string.lower, string.upper, string.gsub, string.sub
+local lpegmatch = lpeg.match
tex = tex or { }
@@ -71,8 +72,8 @@ local symbols = {
}
local function nsub(str,tag,pre,post)
- return (str:gsub(tag .. "(%b())", function(body)
- return pre .. nsub(body:sub(2,-2),tag,pre,post) .. post
+ return (gsub(str,tag .. "(%b())", function(body)
+ return pre .. nsub(sub(body,2,-2),tag,pre,post) .. post
end))
end
@@ -80,87 +81,87 @@ function calcmath.totex(str,mode)
if not frozen then freeze() end
local n = 0
-- crap
- str = str:gsub("%s+" , ' ')
+ str = gsub(str,"%s+",' ')
-- xml
- str = str:gsub("&(.-);", entities)
+ str = gsub(str,"&(.-);",entities)
-- ...E...
- str = str:gsub("([%-%+]?[%d%.%+%-]+)E([%-%+]?[%d%.]+)", "{\\SCINOT{%1}{%2}}")
+ str = gsub(str,"([%-%+]?[%d%.%+%-]+)E([%-%+]?[%d%.]+)", "{\\SCINOT{%1}{%2}}")
-- ^-..
- str = str:gsub( "%^([%-%+]*%d+)", "^{%1}")
+ str = gsub(str,"%^([%-%+]*%d+)", "^{%1}")
-- ^(...)
- str = nsub(str, "%^", "^{", "}")
+ str = nsub(str,"%^", "^{", "}")
-- 1/x^2
repeat
- str, n = str:gsub("([%d%w%.]+)/([%d%w%.]+%^{[%d%w%.]+})", "\\frac{%1}{%2}")
+ str, n = gsub(str,"([%d%w%.]+)/([%d%w%.]+%^{[%d%w%.]+})", "\\frac{%1}{%2}")
until n == 0
-- todo: autoparenthesis
-- int(a,b,c)
for k, v in next, list_2_1 do
- repeat str, n = str:gsub(k,v) until n == 0
+ repeat str, n = gsub(str,k,v) until n == 0
end
-- int(a,b)
for k, v in next, list_2_2 do
- repeat str, n = str:gsub(k, v) until n == 0
+ repeat str, n = gsub(str,k,v) until n == 0
end
-- int(a)
for k, v in next, list_2_3 do
- repeat str, n = str:gsub(k, v) until n == 0
+ repeat str, n = gsub(str,k,v) until n == 0
end
-- sin(x) => {\\sin(x)}
for k, v in next, list_1_1 do
- repeat str, n = str:gsub(k, v) until n == 0
+ repeat str, n = gsub(str,k,v) until n == 0
end
-- mean
str = nsub(str, "mean", "\\OVERLINE{", "}")
-- (1+x)/(1+x) => \\FRAC{1+x}{1+x}
repeat
- str, n = str:gsub("(%b())/(%b())", function(a,b)
- return "\\FRAC{" .. a:sub(2,-2) .. "}{" .. b:sub(2,-2) .. "}"
+ str, n = gsub(str,"(%b())/(%b())", function(a,b)
+ return "\\FRAC{" .. sub(a,2,-2) .. "}{" .. sub(b,2,-2) .. "}"
end )
until n == 0
-- (1+x)/x => \\FRAC{1+x}{x}
repeat
- str, n = str:gsub("(%b())/([%+%-]?[%.%d%w]+)", function(a,b)
- return "\\FRAC{" .. a:sub(2,-2) .. "}{" .. b .. "}"
+ str, n = gsub(str,"(%b())/([%+%-]?[%.%d%w]+)", function(a,b)
+ return "\\FRAC{" .. sub(a,2,-2) .. "}{" .. b .. "}"
end )
until n == 0
-- 1/(1+x) => \\FRAC{1}{1+x}
repeat
- str, n = str:gsub("([%.%d%w]+)/(%b())", function(a,b)
- return "\\FRAC{" .. a .. "}{" .. b:sub(2,-2) .. "}"
+ str, n = gsub(str,"([%.%d%w]+)/(%b())", function(a,b)
+ return "\\FRAC{" .. a .. "}{" .. sub(b,2,-2) .. "}"
end )
until n == 0
-- 1/x => \\FRAC{1}{x}
repeat
- str, n = str:gsub("([%.%d%w]+)/([%+%-]?[%.%d%w]+)", "\\FRAC{%1}{%2}")
+ str, n = gsub(str,"([%.%d%w]+)/([%+%-]?[%.%d%w]+)", "\\FRAC{%1}{%2}")
until n == 0
-- times
- str = str:gsub("%*", " ")
+ str = gsub(str,"%*", " ")
-- symbols -- we can use a table substitution here
- str = str:gsub("([<>=][<>=]*)", symbols)
+ str = gsub(str,"([<>=][<>=]*)", symbols)
-- functions
- str = nsub(str, "sqrt", "\\SQRT{", "}")
- str = nsub(str, "exp", "e^{", "}")
- str = nsub(str, "abs", "\\left|", "\\right|")
+ str = nsub(str,"sqrt", "\\SQRT{", "}")
+ str = nsub(str,"exp", "e^{", "}")
+ str = nsub(str,"abs", "\\left|", "\\right|")
-- d/D
- str = nsub(str, "D", "{\\FRAC{\\MBOX{d}}{\\MBOX{d}x}{(", ")}}")
- str = str:gsub("D([xy])", "\\FRAC{{\\RM d}%1}{{\\RM d}x}")
+ str = nsub(str,"D", "{\\FRAC{\\MBOX{d}}{\\MBOX{d}x}{(", ")}}")
+ str = gsub(str,"D([xy])", "\\FRAC{{\\RM d}%1}{{\\RM d}x}")
-- f/g
for k,v in next, list_3 do -- todo : prepare k,v
- str = nsub(str, "D"..v,"{\\RM "..v.."}^{\\PRIME}(",")")
- str = nsub(str, v,"{\\RM "..v.."}(",")")
+ str = nsub(str,"D"..v,"{\\RM "..v.."}^{\\PRIME}(",")")
+ str = nsub(str,v,"{\\RM "..v.."}(",")")
end
-- more symbols
for k,v in next, list_4_1 do
- str = str:gsub(k, v)
+ str = gsub(str,k,v)
end
-- parenthesis (optional)
if mode == 2 then
- str = str:gsub("%(", "\\left\(")
- str = str:gsub("%)", "\\right\)")
+ str = gsub(str,"%(", "\\left\(")
+ str = gsub(str,"%)", "\\right\)")
end
-- csnames
- str = str:gsub("(\\[A-Z]+)", lower)
+ str = gsub(str,"(\\[A-Z]+)", lower)
-- trace
--~ print(str)
-- report
@@ -191,19 +192,20 @@ if false then
-- Df Dg {\rm f}^{\prime}
-- f() g() {\rm f}()
+
-- valid utf8
local S, P, R, C, V, Cc, Ct = lpeg.S, lpeg.P, lpeg.R, lpeg.C, lpeg.V, lpeg.Cc, lpeg.Ct
local space = S(" \n\r\t")^0
- local number_x = P("-")^-1 * R("09")^1
- local real_x = P("-")^-1 * R("09")^1 * S(".")^1 * R("09")^1
- local number = Cc("number") * C(number_x) * space
- local real = Cc("real") * C(real_x) * space
- local float = Cc("float") * C(real_x) * lpeg.P("E") * lpeg.C(number_x) * space
- local identifier = Cc("identifier") * C(R("az","AZ")^1) * space
- local compareop = P("<") + P("=") + P(">") + P(">=") + P("<=") + P("&gt;") + P("&lt;")
- local factorop = Cc("factor") * C(S("+-^,") + compareop ) * space
+ local integer = P("-")^-1 * R("09")^1
+ local realpart = P("-")^-1 * R("09")^1 * S(".")^1 * R("09")^1
+ local number = Cc("number") * C(integer) * space
+ local real = Cc("real") * C(realpart) * space
+ local float = Cc("float") * C(realpart) * lpeg.P("E") * lpeg.C(integer) * space
+ local identifier = Cc("identifier") * C(R("az","AZ")) * space
+ local compareop = Cc("compare") * C(P("<") + P("=") + P(">") + P(">=") + P("<=") + P("&gt;") + P("&lt;")) * space
+ local factorop = Cc("factor") * C(S("+-^_,")) * space
local termop = Cc("term") * C(S("*/")) * space
local constant = Cc("constant") * C(P("pi") + lpeg.P("inf")) * space
local functionop = Cc("function") * C(R("az")^1) * space
@@ -212,123 +214,150 @@ if false then
local grammar = P {
"expression",
- expression = Ct(V("factor" ) * (factorop * V("factor" ))^0),
- factor = Ct(V("term" ) * (termop * V("term" ))^0),
+ expression = Ct(V("factor") * ((factorop+compareop) * V("factor"))^0),
+ factor = Ct(V("term") * (termop * V("term"))^0),
term = Ct(
float + real + number +
(open * V("expression") * close) +
- (functionop * open * V("expression") * close) +
+ (functionop * open * (V("expression") * (P(",") * V("expression"))^0) * close) +
+ (functionop * V("term")) +
constant + identifier
),
}
+
local parser = space * grammar * -1
+ local texprint = function(...) texio.write(table.concat{ ... }) end
+
+ local function has_factor(t)
+ for i=1,#t do
+ if t[i] == "factor" then
+ return true
+ end
+ end
+ end
+
function totex(t)
if t then
- local one, two, three = t[1], t[2], t[3]
- if one == "number" then
- return two
- elseif one == "real" then
- return two
- elseif one == "float" then
- return format("\\scinot{%s}{%s}", two, three)
- elseif one == "identifier" then
- return format(" %s ", two)
- elseif one == "constant" then
- return format("\\%s ", two)
- elseif one == "function" then
- if two == "sqrt" then
- return format("\\sqrt{%s}", totex(three))
- elseif two == "exp" then
- return format(" e^{%s}", totex(three))
- elseif two == "abs" then
- return format("\\left|%s\\right|", totex(three))
- elseif two == "mean" then
- return format("\\overline{%s}", totex(three))
- elseif two == "int" or two == "prod" or two == "sum" then --brrr, we need to parse better for ,,
- local tt = three
- if #tt == 1 then
- return format("\\%s{%s}", two ,totex(tt[1]))
- elseif #tt == 4 then
- return format("\\%s^{%s}{%s}", two ,totex(tt[1]), totex(tt[4]))
- elseif #tt == 7 then
- return format("\\%s^{%s}_{%s}{%s}", two ,totex(tt[1]), totex(tt[4]), totex(tt[7]))
- end
- elseif #two == 1 then
- return format("%s(%s)", two, totex(three))
- else
- return format("\\%s(%s)", two, totex(three))
- end
- elseif one == "factor" then
- if two == '^' then
- return format("^{%s}%s",totex(three), (#t>3 and totex({unpack(t,4,#t)})) or "")
- else
- if two == ">=" then
- two = "\\ge "
- elseif two == "<=" then
- two = "\\le "
- elseif two == "&gt;" then
- two = "> "
- elseif two == "&lt;" then
- two = "< "
- end
- return format("%s%s%s", two, totex(three), (#t>3 and totex({unpack(t,4,#t)})) or "")
- end
- elseif one == "term" then
- if two == '/' then
- if #t > 4 then
- return format("\\frac{%s}{%s}", totex(three), totex({unpack(t,4,#t)}))
+ local one = t[1]
+ if type(one) == "string" then
+ local two, three = t[2], t[3]
+ if one == "number" then
+ texprint(two)
+ elseif one == "real" then
+ texprint(two)
+ elseif one == "float" then
+ texprint("\\scinot{",two,"}{",three,"}")
+ elseif one == "identifier" then
+ texprint(two)
+ elseif one == "constant" then
+ texprint("\\"..two)
+ elseif one == "function" then
+ if two == "sqrt" then
+ texprint("\\sqrt{")
+ totex(three)
+ texprint("}")
+ elseif two == "exp" then
+ texprint(" e^{")
+ totex(three)
+ texprint("}")
+ elseif two == "abs" then
+ texprint("\\left|")
+ totex(three)
+ texprint("\\right|")
+ elseif two == "mean" then
+ texprint("\\overline{")
+ totex(three)
+ texprint("}")
+ elseif two == "int" or two == "prod" or two == "sum" then
+ local four, five = t[4], t[5]
+ if five then
+ texprint("\\"..two.."^{")
+ totex(three)
+ texprint("}_{")
+ totex(four)
+ texprint("}")
+ totex(five)
+ elseif four then
+ texprint("\\"..two.."^{")
+ totex(three)
+ texprint("}")
+ totex(four)
+ elseif three then
+ texprint("\\"..two.." ") -- " " not needed
+ totex(three)
+ else
+ texprint("\\"..two)
+ end
else
- return format("\\frac{%s}{%s}", totex(three), totex(t[4]))
+ texprint("\\"..two.."(")
+ totex(three)
+ texprint(")")
end
- elseif two == '*' then
- local times = "\\times "
- return format("%s%s%s", times, totex(three), (#t>3 and totex({unpack(t,4,#t)})) or "")
- else
- return format("%s%s%s", two, totex(three), (#t>3 and totex({unpack(t,4,#t)})) or "")
end
- elseif two == "factor" then
- if three == '^' then
- return format("%s^{%s}", totex(one), totex(t[4]))
- else
- if two == ">=" then
- two = "\\ge "
- elseif two == "<=" then
- two = "\\le "
- elseif two == "&gt;" then
- two = "> "
- elseif two == "&lt;" then
- two = "< "
+ else
+ local nt = #t
+ local hasfactor = has_factor(t)
+ if hasfactor then
+ texprint("\\left(")
+ end
+ totex(one)
+ for i=2,nt,3 do
+ local what, how, rest = t[i], t[i+1], t[i+2]
+ if what == "factor" then
+ if how == '^' or how == "_" then
+ texprint(how)
+ texprint("{")
+ totex(rest)
+ texprint("}")
+ else
+ texprint(how)
+ totex(rest)
+ end
+ elseif what == "term" then
+ if how == '/' then
+ texprint("\\frac{")
+ totex(rest)
+ texprint("}{")
+ totex(t[i+3] or "")
+ texprint("}")
+ elseif how == '*' then
+ texprint("\\times")
+ totex(rest)
+ else
+ texprint(how)
+ totex(three)
+ end
+ elseif what == "compare" then
+ if two == ">=" then
+ texprint("\\ge")
+ elseif two == "<=" then
+ texprint("\\le")
+ elseif two == "&gt;" then
+ texprint(">")
+ elseif two == "&lt;" then
+ texprint("<")
+ end
+ totex(three)
end
- return format("%s%s", totex(one), (#t>1 and totex({unpack(t,2,#t)})) or "")
end
- elseif two == "term" then
- if three == '/' then
- return format("\\frac{%s}{%s}", totex(one), (#t>3 and totex({unpack(t,4,#t)})) or "")
- else
- return format("%s%s", totex(one), (#t>1 and totex({unpack(t,2,#t)})) or "")
+ if hasfactor then
+ texprint("\\right)")
end
- else
- return totex(one)
end
end
- return ""
end
calcmath = { }
function calcmath.parse(str)
- return parser:match(str)
+ return lpegmatch(parser,str)
end
function calcmath.tex(str)
- str = totex(parser:match(str))
- print(str)
+ str = totex(lpegmatch(parser,str))
return (str == "" and "[error]") or str
end
end
-
---~ compareop = Cc("compare") * C(P("<") + P("=") + P(">") + P(">=") + P("<=") + P("&gt;")/">" + P("&lt;")/"<") * space
---~ comparison = Ct(V("expression") * (compareop * V("expression"))^0),
diff --git a/Master/texmf-dist/tex/context/base/x-calcmath.mkiv b/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
index 29bc1af9a32..c726843fa4f 100644
--- a/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
@@ -1,5 +1,3 @@
-% engine=luatex
-
%D \module
%D [ file=m-calcmath,
%D version=2006.04.24, % 1999.11.06,
diff --git a/Master/texmf-dist/tex/context/base/x-cals.lua b/Master/texmf-dist/tex/context/base/x-cals.lua
new file mode 100644
index 00000000000..5d15b4e302d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-cals.lua
@@ -0,0 +1,209 @@
+if not modules then modules = { } end modules ['x-cals'] = {
+ version = 1.001,
+ comment = "companion to x-cals.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, lower = string.format, string.lower
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local xmlsprint, xmlcprint, xmlcollected = xml.sprint, xml.cprint, xml.collected
+local n_todimen, s_todimen = number.todimen, string.todimen
+
+-- there is room for speedups as well as cleanup (using context functions)
+
+lxml.cals = lxml.cals or { }
+
+local cals = lxml.cals
+
+cals.ignore_widths = false
+cals.shrink_widths = false
+cals.stretch_widths = false
+
+-- the following flags only apply to columns that have a specified width
+--
+-- proportional : shrink or stretch proportionally to the width
+-- equal : shrink or stretch equaly distributed
+-- n < 1 : shrink or stretch proportionally to the width but multiplied by n
+--
+-- more clever things, e.g. the same but applied to unspecified widths
+-- has to happen at the core-ntb level (todo)
+
+local halignments = {
+ left = "flushleft",
+ right = "flushright",
+ center = "middle",
+ centre = "middle",
+ justify = "normal",
+}
+
+local valignments = {
+ top = "high",
+ bottom = "low",
+ middle = "lohi",
+}
+
+local function adapt(widths,b,w,delta,sum,n,what)
+ if b == "equal" then
+ delta = delta/n
+ for k, v in next, w do
+ widths[k] = n_todimen(v - delta)
+ end
+ elseif b == "proportional" then
+ delta = delta/sum
+ for k, v in next, w do
+ widths[k] = n_todimen(v - v*delta)
+ end
+ elseif type(b) == "number" and b < 1 then
+ delta = b*delta/sum
+ for k, v in next, w do
+ widths[k] = n_todimen(v - v*delta)
+ end
+ end
+end
+
+local function getspecs(root, pattern, names, widths)
+ -- here, but actually we need this in core-ntb.tex
+ -- but ideally we need an mkiv enhanced core-ntb.tex
+ local ignore_widths = cals.ignore_widths
+ local shrink_widths = cals.shrink_widths
+ local stretch_widths = cals.stretch_widths
+ for e in xmlcollected(root,pattern) do
+ local at = e.at
+ local column = at.colnum
+ if column then
+ if not ignore_widths then
+ local width = at.colwidth
+ if width then
+ widths[tonumber(column)] = lower(width)
+ end
+ end
+ local name = at.colname
+ if name then
+ names[name] = tonumber(column)
+ end
+ end
+ end
+ if ignore_width then
+ -- forget about it
+ elseif shrink_widths or stretch_widths then
+ local sum, n, w = 0, 0, { }
+ for _, v in next, widths do
+ n = n + 1
+ v = (type(v) == "string" and s_todimen(v)) or v
+ if v then
+ w[n] = v
+ sum = sum + v
+ end
+ end
+ local hsize = tex.hsize
+ if type(hsize) == "string" then
+ hsize = s_todimen(hsize)
+ end
+ local delta = sum - hsize
+ if shrink_widths and delta > 0 then
+ adapt(widths,shrink_widths,w,delta,sum,n,"shrink")
+ elseif stretch_widths and delta < 0 then
+ adapt(widths,stretch_widths,w,delta,sum,n,"stretch")
+ end
+ end
+end
+
+local function getspans(root, pattern, names, spans)
+ for e in xmlcollected(root,pattern) do
+ local at = e.at
+ local name, namest, nameend = at.colname, names[at.namest or "?"], names[at.nameend or "?"]
+ if name and namest and nameend then
+ spans[name] = tonumber(nameend) - tonumber(namest) + 1
+ end
+ end
+end
+
+--local function texsprint(a,b) print(b) end
+--local function xmlsprint(a) print(a) end
+
+function cals.table(root,namespace)
+
+ local prefix = (namespace or "cals") .. ":"
+ local p = "/" .. prefix
+
+ local tgroupspec = p .. "tgroup"
+ local colspec = p .. "colspec"
+ local spanspec = p .. "spanspec"
+ local hcolspec = p .. "thead" .. p .. "colspec"
+ local bcolspec = p .. "tbody" .. p .. "colspec"
+ local fcolspec = p .. "tfoot" .. p .. "colspec"
+ local entryspec = p .. "entry" .. "|" ..prefix .. "entrytbl"
+ local hrowspec = p .. "thead" .. p .. "row"
+ local browspec = p .. "tbody" .. p .. "row"
+ local frowspec = p .. "tfoot" .. p .. "row"
+
+ local function tablepart(root, xcolspec, xrowspec, before, after) -- move this one outside
+ texsprint(ctxcatcodes,before)
+ local at = root.at
+ local pphalign, ppvalign = at.align, at.valign
+ local names, widths, spans = { }, { }, { }
+ getspecs(root, colspec , names, widths)
+ getspecs(root, xcolspec, names, widths)
+ getspans(root, spanspec, names, spans)
+ for r, d, k in xml.elements(root,xrowspec) do
+ texsprint(ctxcatcodes,"\\bTR")
+ local dk = d[k]
+ local at = dk.at
+ local phalign, pvalign = at.align or pphalign, at.valign or ppvalign -- todo: __p__ test
+ local col = 1
+ for rr, dd, kk in xml.elements(dk,entryspec) do
+ local dk = dd[kk]
+ if dk.tg == "entrytbl" then
+ texsprint(ctxcatcodes,"\\bTD{")
+ cals.table(dk)
+ texsprint(ctxcatcodes,"}\\eTD")
+ col = col + 1
+ else
+ local at = dk.at
+ local b, e, s, m = names[at.namest or "?"], names[at.nameend or "?"], spans[at.spanname or "?"], at.morerows
+ local halign, valign = at.align or phalign, at.valign or pvalign
+ if b and e then
+ s = e - b + 1
+ end
+ if halign then
+ halign = halignments[halign]
+ end
+ if valign then
+ valign = valignments[valign]
+ end
+ local width = widths[col]
+ if s or m or halign or valign or width then -- only english interface !
+ texsprint(ctxcatcodes,format("\\bTD[nx=%s,ny=%s,align={%s,%s},width=%s]",
+ s or 1, (m or 0)+1, halign or "flushleft", valign or "high", width or "fit"))
+ -- texsprint(ctxcatcodes,"\\bTD[nx=",s or 1,"ny=",(m or 0)+1,"align={",halign or "flushleft",",",valign or "high","},width=",width or "fit","]")
+ else
+ texsprint(ctxcatcodes,"\\bTD[align={flushleft,high},width=fit]") -- else problems with vertical material
+ end
+ xmlcprint(dk)
+ texsprint(ctxcatcodes,"\\eTD")
+ col = col + (s or 1)
+ end
+ end
+ texsprint(ctxcatcodes,"\\eTR")
+ end
+ texsprint(ctxcatcodes,after)
+ end
+
+ for tgroup in lxml.collected(root,tgroupspec) do
+ texsprint(ctxcatcodes, "\\directsetup{cals:table:before}")
+ lxml.directives.before(root,"cdx") -- "cals:table"
+ texsprint(ctxcatcodes, "\\bgroup")
+ lxml.directives.setup(root,"cdx") -- "cals:table"
+ texsprint(ctxcatcodes, "\\bTABLE")
+ tablepart(tgroup, hcolspec, hrowspec, "\\bTABLEhead", "\\eTABLEhead")
+ tablepart(tgroup, bcolspec, browspec, "\\bTABLEbody", "\\eTABLEbody")
+ tablepart(tgroup, fcolspec, frowspec, "\\bTABLEfoot", "\\eTABLEfoot")
+ texsprint(ctxcatcodes, "\\eTABLE")
+ texsprint(ctxcatcodes, "\\egroup")
+ lxml.directives.after(root,"cdx") -- "cals:table"
+ texsprint(ctxcatcodes, "\\directsetup{cals:table:after}")
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/x-cals.mkiv b/Master/texmf-dist/tex/context/base/x-cals.mkiv
index 3d264404584..32d5767c1c7 100644
--- a/Master/texmf-dist/tex/context/base/x-cals.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-cals.mkiv
@@ -13,210 +13,9 @@
\writestatus{loading}{ConTeXt XML Macros / Cals Tables}
-\startluacode
-do
+\startmodule [cals]
- lxml.cals = { }
- lxml.cals.ignore_widths = false
-
- -- the following flags only apply to columns that have a specified width
- --
- -- proportional : shrink or stretch proportionally to the width
- -- equal : shrink or stretch equaly distributed
- -- n < 1 : shrink or stretch proportionally to the width but multiplied by n
- --
- -- more clever things, e.g. the same but applied to unspecified widths
- -- has to happen at the core-ntb level (todo)
-
- lxml.cals.shrink_widths = false
- lxml.cals.stretch_widths = false
-
- local format = string.format
- local texsprint = tex.sprint
- local xmlsprint = xml.sprint
- local xmlcprint = xml.cprint
-
- local halignments = {
- left = "flushleft",
- right = "flushright",
- center = "middle",
- centre = "middle",
- justify = "normal",
- }
-
- local valignments = {
- top = "high",
- bottom = "low",
- middle = "lohi",
- }
-
- local function getspecs(root, pattern, names, widths)
- -- here, but actually we need this in core-ntb.tex
- -- but ideally we need an mkiv enhanced core-ntb.tex
- local ignore_widths = lxml.cals.ignore_widths
- local shrink_widths = lxml.cals.shrink_widths
- local stretch_widths = lxml.cals.stretch_widths
- for r, d, k in xml.elements(root,pattern) do
- local dk = d[k]
- local at = dk.at
- local column = at.colnum
- if column then
- if not ignore_widths then
- local width = at.colwidth
- if width then
- widths[tonumber(column)] = width:lower()
- end
- end
- local name = at.colname
- if name then
- names[name] = tonumber(column)
- end
- end
- end
- local function adapt(b,w,delta,sum,n,what)
- if b == "equal" then
- delta = delta/n
- for k, v in pairs(w) do
- widths[k] = number.todimen(v - delta)
- end
- elseif b == "proportional" then
- delta = delta/sum
- for k, v in pairs(w) do
- widths[k] = number.todimen(v - v*delta)
- end
- elseif type(b) == "number" and b < 1 then
- delta = b*delta/sum
- for k, v in pairs(w) do
- widths[k] = number.todimen(v - v*delta)
- end
- end
- end
- if ignore_width then
- -- forget about it
- elseif shrink_widths or stretch_widths then
- local sum, n, w = 0, 0, { }
- for _, v in pairs(widths) do
- n = n + 1
- v = (type(v) == "string" and v:todimen()) or v
- if v then
- w[n] = v
- sum = sum + v
- end
- end
- local hsize = tex.hsize
- if type(hsize) == "string" then
- hsize = hsize:todimen()
- end
- local delta = sum - hsize
- if shrink_widths and delta > 0 then
- adapt(shrink_widths,w,delta,sum,n,"shrink")
- elseif stretch_widths and delta < 0 then
- adapt(stretch_widths,w,delta,sum,n,"stretch")
- end
- end
- end
-
- local function getspans(root, pattern, names, spans)
- for r, d, k in xml.elements(root,pattern) do
- local dk = d[k]
- local at = dk.at
- local name, namest, nameend = at.colname, names[at.namest or "?"], names[at.nameend or "?"]
- if name and namest and nameend then
- spans[name] = tonumber(nameend) - tonumber(namest) + 1
- end
- end
- end
-
- --local function texsprint(a,b) print(b) end
- --local function xmlsprint(a) print(a) end
-
- function lxml.cals.table(root,namespace)
-
- local prefix = (namespace or "cals") .. ":"
- local p = "/" .. prefix
-
- local tgroupspec = p .. "tgroup"
- local colspec = p .. "colspec"
- local spanspec = p .. "spanspec"
- local hcolspec = p .. "thead" .. p .. "colspec"
- local bcolspec = p .. "tbody" .. p .. "colspec"
- local fcolspec = p .. "tfoot" .. p .. "colspec"
- local entryspec = p .. "entry" .. "|" ..prefix .. "entrytbl"
- local hrowspec = p .. "thead" .. p .. "row"
- local browspec = p .. "tbody" .. p .. "row"
- local frowspec = p .. "tfoot" .. p .. "row"
-
- local function tablepart(root, xcolspec, xrowspec, before, after)
- texsprint(tex.ctxcatcodes,before)
- local at = root.at
- local pphalign, ppvalign = at.align, at.valign
- local names, widths, spans = { }, { }, { }
- getspecs(root, colspec , names, widths)
- getspecs(root, xcolspec, names, widths)
- getspans(root, spanspec, names, spans)
- for r, d, k in xml.elements(root,xrowspec) do
- texsprint(tex.ctxcatcodes,"\\bTR")
- local dk = d[k]
- local at = dk.at
- local phalign, pvalign = at.align or pphalign, at.valign or ppvalign -- todo: __p__ test
- local col = 1
- for rr, dd, kk in xml.elements(dk,entryspec) do
- local dk = dd[kk]
- if dk.tg == "entrytbl" then
- texsprint(tex.ctxcatcodes,"\\bTD{")
- lxml.cals.table(dk)
- texsprint(tex.ctxcatcodes,"}\\eTD")
- col = col + 1
- else
- local at = dk.at
- local b, e, s, m = names[at.namest or "?"], names[at.nameend or "?"], spans[at.spanname or "?"], at.morerows
- local halign, valign = at.align or phalign, at.valign or pvalign
- if b and e then
- s = e - b + 1
- end
- if halign then
- halign = halignments[halign]
- end
- if valign then
- valign = valignments[valign]
- end
- local width = widths[col]
- if s or m or halign or valign or width then -- only english interface !
- texsprint(tex.ctxcatcodes,format("\\bTD[nx=%s,ny=%s,align={%s,%s},width=%s]",
- s or 1, (m or 0)+1, halign or "flushleft", valign or "high", width or "fit"))
- else
- texsprint(tex.ctxcatcodes,"\\bTD[align={flushleft,high},width=fit]") -- else problems with vertical material
- end
- -- xmlsprint(dk)
- xmlcprint(dk)
- texsprint(tex.ctxcatcodes,"\\eTD")
- col = col + (s or 1)
- end
- end
- texsprint(tex.ctxcatcodes,"\\eTR")
- end
- texsprint(tex.ctxcatcodes,after)
- end
-
- for r, d, k in xml.elements(lxml.id(root),tgroupspec) do
- local tgroup = d[k]
- texsprint(tex.ctxcatcodes, "\\directsetup{cals:table:before}")
- lxml.directives.before(root,"cdx") -- "cals:table"
- texsprint(tex.ctxcatcodes, "\\bgroup")
- lxml.directives.setup(root,"cdx") -- "cals:table"
- texsprint(tex.ctxcatcodes, "\\bTABLE")
- tablepart(tgroup, hcolspec, hrowspec, "\\bTABLEhead", "\\eTABLEhead")
- tablepart(tgroup, bcolspec, browspec, "\\bTABLEbody", "\\eTABLEbody")
- tablepart(tgroup, fcolspec, frowspec, "\\bTABLEfoot", "\\eTABLEfoot")
- texsprint(tex.ctxcatcodes, "\\eTABLE")
- texsprint(tex.ctxcatcodes, "\\egroup")
- lxml.directives.after(root,"cdx") -- "cals:table"
- texsprint(tex.ctxcatcodes, "\\directsetup{cals:table:after}")
- end
- end
-
-end
-\stopluacode
+\ctxloadluafile{x-cals}{}
% \startxmlsetups xml:cals:process
% \xmlsetsetup {\xmldocument} {cals:table} {*}
@@ -234,4 +33,4 @@ end
\xmlregisterns{cals}{cals}
-\endinput
+\stopmodule
diff --git a/Master/texmf-dist/tex/context/base/x-chemml.mkiv b/Master/texmf-dist/tex/context/base/x-chemml.mkiv
index e0da353fc70..f9ed3296041 100644
--- a/Master/texmf-dist/tex/context/base/x-chemml.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-chemml.mkiv
@@ -35,7 +35,7 @@
\xmlregisterns{cml}{chemml}
-\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
+\unexpanded\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
\setupCMLappearance [ion] [\c!alternative=\v!a]
diff --git a/Master/texmf-dist/tex/context/base/x-contml.tex b/Master/texmf-dist/tex/context/base/x-contml.mkii
index ba6762e77d6..a582d8eb90f 100644
--- a/Master/texmf-dist/tex/context/base/x-contml.tex
+++ b/Master/texmf-dist/tex/context/base/x-contml.mkii
@@ -1,5 +1,3 @@
-% interface=en
-
%M \usemodule [contml] \autoXMLnamespace [context]
%M \definefilesynonym [context] [x-contml.xsd]
diff --git a/Master/texmf-dist/tex/context/base/x-corres.tex b/Master/texmf-dist/tex/context/base/x-corres.mkii
index 09c7263dc17..09c7263dc17 100644
--- a/Master/texmf-dist/tex/context/base/x-corres.tex
+++ b/Master/texmf-dist/tex/context/base/x-corres.mkii
diff --git a/Master/texmf-dist/tex/context/base/x-ct.lua b/Master/texmf-dist/tex/context/base/x-ct.lua
new file mode 100644
index 00000000000..222a127cec6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-ct.lua
@@ -0,0 +1,182 @@
+if not modules then modules = { } end modules ['x-ct'] = {
+ version = 1.001,
+ comment = "companion to x-ct.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local xmlsprint, xmlfilter, xmlcollected = xml.sprint, xml.filter, xml.collected
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local format, concat, rep, find = string.format, table.concat, string.rep, string.find
+
+lxml.context = { }
+
+local halignments = {
+ left = 'l',
+ flushleft = 'l',
+ right = 'r',
+ flushright = 'r',
+ center = 'c',
+ middle = 'c',
+ centre = 'c',
+ justify = '',
+}
+
+local function roottemplate(root)
+ local rt = root.at.template
+ if rt then
+ if not find(rt,"|") then
+ rt = gsub(rt,",","|")
+ end
+ if not find(rt,"^|") then rt = "|" .. rt end
+ if not find(rt,"|$") then rt = rt .. "|" end
+ end
+ return rt
+end
+
+local function specifiedtemplate(root,templatespec)
+ local template = { }
+ for e in xmlcollected(root,templatespec) do
+ local at = e.at
+ local tm = halignments[at.align] or ""
+ if toboolean(at.paragraph) then
+ tm = tm .. "p"
+ end
+ template[#template+1] = tm
+ end
+ if #template > 0 then
+ return "|" .. concat(template,"|") .. "|"
+ else
+ return nil
+ end
+end
+
+local function autotemplate(root,rowspec,cellspec)
+ local max = 0
+ for e in xmlcollected(root,rowspec) do
+ local n = xml.count(e,cellspec)
+ if n > max then max = n end
+ end
+ if max == 2 then
+ return "|l|p|"
+ elseif max > 0 then
+ return "|" .. rep("p|",max)
+ else
+ return nil
+ end
+end
+
+local defaulttemplate = "|l|p|"
+
+function lxml.context.tabulate(root,namespace)
+ if not root then
+ return
+ else
+ root = lxml.id(root)
+ end
+
+ local prefix = (namespace or "context") .. ":"
+
+ local templatespec = "/" .. prefix .. "template" .. "/" .. prefix .. "column"
+ local bodyrowspec = "/" .. prefix .. "body" .. "/" .. prefix .. "row"
+ local cellspec = "/" .. prefix .. "cell"
+
+ local template =
+ roottemplate (root) or
+ specifiedtemplate (root,templatespec) or
+ autotemplate (root,bodyrowspec,cellspec) or
+ defaulttemplate
+
+ -- todo: head and foot
+
+--~ lxml.directives.before(root,'cdx')
+--~ texsprint(ctxcatcodes, "\\bgroup")
+--~ lxml.directives.setup(root,'cdx')
+--~ texsprint(ctxcatcodes, format("\\starttabulate[%s]",template))
+--~ for e in xmlcollected(root,bodyrowspec) do
+--~ texsprint(ctxcatcodes, "\\NC ")
+--~ for e in xmlcollected(e,cellspec) do
+--~ texsprint(xml.text(e)) -- use some xmlprint
+--~ texsprint(ctxcatcodes, "\\NC")
+--~ end
+--~ texsprint(ctxcatcodes, "\\NR")
+--~ end
+--~ texsprint(ctxcatcodes, "\\stoptabulate")
+--~ texsprint(ctxcatcodes, "\\egroup")
+--~ lxml.directives.after(root,'cdx')
+
+ local NC, NR = context.NC, context.NR
+
+ lxml.directives.before(root,'cdx')
+ context.bgroup()
+ lxml.directives.setup(root,'cdx')
+ context.starttabulate { template }
+ for e in xmlcollected(root,bodyrowspec) do
+ NC()
+ for e in xmlcollected(e,cellspec) do
+ texsprint(xml.text(e)) -- test: xmlcprint(e)
+ NC()
+ end
+ NR()
+ end
+ context.stoptabulate()
+ context.egroup()
+ lxml.directives.after(root,'cdx')
+
+end
+
+function lxml.context.combination(root,namespace)
+
+ if not root then
+ return
+ else
+ root = lxml.id(root)
+ end
+
+ local prefix = (namespace or "context") .. ":"
+
+ local pairspec = "/" .. prefix .. "pair"
+ local contentspec = "/" .. prefix .. "content" .. "/text()"
+ local captionspec = "/" .. prefix .. "caption" .. "/text()"
+
+ local nx, ny = root.at.nx, root.at.ny
+
+ if not (nx or ny) then
+ nx = xml.count(root,pairspec) or 2
+ end
+ local template = format("%s*%s", nx or 1, ny or 1)
+
+ -- todo: alignments
+
+--~ lxml.directives.before(root,'cdx')
+--~ texsprint(ctxcatcodes, "\\bgroup")
+--~ lxml.directives.setup(root,'cdx')
+--~ texsprint(ctxcatcodes, "\\startcombination[",template,"]")
+--~ for e in xmlcollected(root,pairspec) do
+--~ texsprint(ctxcatcodes,"{")
+--~ xmlfilter(e,contentspec)
+--~ texsprint(ctxcatcodes,"}{")
+--~ xmlfilter(e,captionspec)
+--~ texsprint(ctxcatcodes,"}")
+--~ end
+--~ texsprint(ctxcatcodes, "\\stopcombination")
+--~ texsprint(ctxcatcodes, "\\egroup")
+--~ lxml.directives.after(root,'cdx')
+
+ lxml.directives.before(root,'cdx')
+ context.bgroup()
+ lxml.directives.setup(root,'cdx')
+ context.startcombination { template }
+ for e in xmlcollected(root,pairspec) do
+ texsprint(ctxcatcodes,"{")
+ xmlfilter(e,contentspec)
+ texsprint(ctxcatcodes,"}{")
+ xmlfilter(e,captionspec)
+ texsprint(ctxcatcodes,"}")
+ end
+ context.stopcombination()
+ context.egroup()
+ lxml.directives.after(root,'cdx')
+
+end
diff --git a/Master/texmf-dist/tex/context/base/x-ct.mkiv b/Master/texmf-dist/tex/context/base/x-ct.mkiv
index 17ea254083e..d282193a15b 100644
--- a/Master/texmf-dist/tex/context/base/x-ct.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-ct.mkiv
@@ -13,151 +13,9 @@
\writestatus{loading}{ConTeXt XML Macros / Basics}
-\startluacode
-do
- lxml.context = { }
+\startmodule [ct]
- local halignments = {
- left = 'l',
- flushleft = 'l',
- right = 'r',
- flushright = 'r',
- center = 'c',
- middle = 'c',
- centre = 'c',
- justify = '',
- }
-
- local texsprint = tex.sprint
- local xmlsprint = xml.sprint
-
- local function roottemplate(root)
- local rt = root.at.template
- if rt then
- if not rt:find("|") then
- rt = rt:gsub(",","|")
- end
- if not rt:find("^|") then rt = "|" .. rt end
- if not rt:find("|$") then rt = rt .. "|" end
- end
- return rt
- end
-
- local function specifiedtemplate(root,templatespec)
- local template = { }
- for r, d, k in xml.elements(root,templatespec) do
- local at = d[k].at
- local tm = halignments[at.align] or ""
- if toboolean(at.paragraph) then
- tm = tm .. "p"
- end
- template[#template+1] = tm
- end
- if #template > 0 then
- return "|" .. table.join(template,"|") .. "|"
- else
- return nil
- end
- end
-
- local function autotemplate(root,rowspec,cellspec)
- local max = 0
- for r, d, k in xml.elements(root,rowspec) do
- local n = xml.count(d[k],cellspec)
- if n > max then max = n end
- end
- if max == 2 then
- return "|l|p|"
- elseif max > 0 then
- return "|" .. string.rep("p|",max)
- else
- return nil
- end
- end
-
- local defaulttemplate = "|l|p|"
-
- function lxml.context.tabulate(root,namespace)
- if not root then
- return
- else
- root = lxml.id(root)
- end
-
- local prefix = (namespace or "context") .. ":"
-
- local templatespec = "/" .. prefix .. "template" .. "/" .. prefix .. "column"
- local bodyrowspec = "/" .. prefix .. "body" .. "/" .. prefix .. "row"
- local cellspec = "/" .. prefix .. "cell"
-
- local template =
- roottemplate (root) or
- specifiedtemplate (root,templatespec) or
- autotemplate (root,bodyrowspec,cellspec) or
- defaulttemplate
-
- lxml.directives.before(root,'cdx')
- texsprint(tex.ctxcatcodes, "\\bgroup")
- lxml.directives.setup(root,'cdx')
- -- todo: head and foot
- texsprint(tex.ctxcatcodes, string.format("\\starttabulate[%s]",template))
- for r, d, k in xml.elements(root,bodyrowspec) do
- texsprint(tex.ctxcatcodes, "\\NC ")
- for r, d, k in xml.elements(d[k],cellspec) do
- texsprint(xml.content(d[k]))
- texsprint(tex.ctxcatcodes, "\\NC")
- end
- texsprint(tex.ctxcatcodes, "\\NR")
- end
- texsprint(tex.ctxcatcodes, "\\stoptabulate")
- texsprint(tex.ctxcatcodes, "\\egroup")
- lxml.directives.after(root,'cdx')
-
- end
-
- function lxml.context.combination(root,namespace)
-
- if not root then
- return
- else
- root = lxml.id(root)
- end
-
- local prefix = (namespace or "context") .. ":"
-
- local pairspec = "/" .. prefix .. "pair"
- local contentspec = "/" .. prefix .. "content" .. "/text()"
- local captionspec = "/" .. prefix .. "caption" .. "/text()"
-
- local nx, ny = root.at.nx, root.at.ny
-
- if not (nx or ny) then
- nx = xml.count(root,pairspec) or 2
- end
- local template = string.format("%s*%s", nx or 1, ny or 1)
-
- lxml.directives.before(root,'cdx')
- texsprint(tex.ctxcatcodes, "\\bgroup")
- lxml.directives.setup(root,'cdx')
- -- todo: alignments
- texsprint(tex.ctxcatcodes, string.format("\\startcombination[%s]",template))
- for r, d, k in xml.elements(root,pairspec) do
- local dk = d[k]
- texsprint(tex.ctxcatcodes,"{")
- xmlsprint(xml.filter(dk,contentspec) or "")
- texsprint(tex.ctxcatcodes,"}")
- texsprint(tex.ctxcatcodes,"{")
- xmlsprint(xml.filter(dk,captionspec) or "")
- texsprint(tex.ctxcatcodes,"}")
- end
- texsprint(tex.ctxcatcodes, "\\stopcombination")
- texsprint(tex.ctxcatcodes, "\\egroup")
- lxml.directives.after(root,'cdx')
-
- end
-
-end
-\stopluacode
+\ctxloadluafile{x-ct}{}
\startxmlsetups xml:context:process
\xmlsetfunction {\xmldocument} {context:tabulate} {lxml.context.tabulate}
@@ -168,35 +26,4 @@ end
\xmlregisterns{context}{context}
-\endinput
-
-% this replaces:
-
-% \startxmlsetups tabulate
-% \starttabulate[||p|]
-% \xmlall{#1}{/body/row}
-% \stoptabulate
-% \stopxmlsetups
-% \startxmlsetups tabulate:row
-% \NC \xmlall{#1}{/cell} \NR
-% \stopxmlsetups
-% \startxmlsetups tabulate:cell
-% \xmlflush{#1} \NC
-% \stopxmlsetups
-
-% \startxmlsetups combination
-% \startcollecting
-% \startcollect
-% \startcombination[\xmlatt{#1}{nx}*\xmlatt{#1}{ny}]
-% \stopcollect
-% \xmlloop {#1} {combiblock} {
-% \startcollect
-% {\xmli{/content}{##1}}
-% {\xmli{/caption}{##1}}
-% \stopcollect
-% }
-% \startcollect
-% \stopcombination
-% \stopcollect
-% \stopcollecting
-% \stopxmlsetups
+\stopmodule
diff --git a/Master/texmf-dist/tex/context/base/x-dir-05.mkii b/Master/texmf-dist/tex/context/base/x-dir-05.mkii
new file mode 100644
index 00000000000..0d0edd832e8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-dir-05.mkii
@@ -0,0 +1,51 @@
+%D \module
+%D [ file=x-dir-05,
+%D version=2003.05.10, % around that time -)
+%D title=\CONTEXT\ Directory Handling,
+%D subtitle=Access,
+%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.
+
+\setvariables
+ [filestate]
+ [name=,base=,type=,size=,permissions=,date=]
+
+\def\savefilestate
+ {\dodoubleargument\dosavefilestate}
+
+\def\dosavefilestate[#1][#2]%
+ {\startnointerference
+ \setxvariables
+ [#1]
+ [name=#2,base=,type=,size=,permissions=,date=]
+ \executesystemcommand{texmfstart xmltools.rb --dir --pattern=\getvariable{#1}{name} --output=xmldir.tmp}
+ \defineXMLprocess [files]
+ \defineXMLprocess [directory]
+ \defineXMLenvironment [file]
+ {\defineXMLsave [base]
+ \defineXMLsave [type]
+ \defineXMLsave [size]
+ \defineXMLsave [permissions]
+ \defineXMLsave [date]}
+ {\setxvariables
+ [#1]
+ [name=\XMLop{name},
+ base=\XMLflush{base},
+ type=\XMLflush{type},
+ size=\XMLflush{size},
+ permissions=\XMLflush{permissions},
+ date=\XMLflush{date}]}
+ \startXMLignore
+ \processXMLfile{xmldir.tmp}
+ \stopXMLignore
+ \stopnointerference}
+
+\def\getfilestate#1% old one
+ {\savefilestate[filestate][#1]}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-dir-05.mkiv b/Master/texmf-dist/tex/context/base/x-dir-05.mkiv
new file mode 100644
index 00000000000..c29c9ea2aba
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-dir-05.mkiv
@@ -0,0 +1,72 @@
+%D \module
+%D [ file=x-dir-05,
+%D version=2003.05.10, % around that time -)
+%D title=\CONTEXT\ Directory Handling,
+%D subtitle=Access,
+%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.
+
+\setvariables
+ [filestate]
+ [name=,
+ base=,
+ type=,
+ size=,
+ permissions=,
+ date=]
+
+% \savefilestate[zip-latest][context/latest/cont-#2.zip]%
+
+\startluacode
+ local filestates = { }
+ function commands.savefilestate(tag,name)
+ if not filestates[tag] then
+ local attr = lfs.attributes(name)
+ if attr then attr.name = name end
+ filestates[tag] = attr
+ end
+ end
+ function commands.getfilestatevariable(tag,name)
+ local fs = filestates[tag]
+ if fs then
+ local value
+ if name == "base" then
+ value = file.basename(fs.name)
+ elseif name == "type" then
+ value = file.extname(fs.name)
+ elseif name == "date" then
+ value = os.date("%Y-%m-%d %H:%M",fs.modification)
+ else
+ value = fs[name] or ""
+ end
+ tex.sprint(tex.vrbcatcodes,value)
+ end
+ end
+\stopluacode
+
+\def\getfilestatevariable#1#2%
+ {\ctxlua{commands.getfilestatevariable("#1","#2")}}
+
+\def\savefilestate
+ {\dodoubleargument\dosavefilestate}
+
+\def\dosavefilestate[#1][#2]%
+ {\ctxlua{commands.savefilestate("#1","#2")}%
+ \setxvariables
+ [#1]
+ [name={#2},
+ base=\getfilestatevariable{#1}{base},
+ type=\getfilestatevariable{#1}{type},
+ size=\getfilestatevariable{#1}{size},
+ date=\getfilestatevariable{#1}{date},
+ permissions=\getfilestatevariable{#1}{permissions}]}
+
+\def\getfilestate#1% old one
+ {\savefilestate[filestate][#1]}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-fe.tex b/Master/texmf-dist/tex/context/base/x-fe.mkii
index 8562b1d5296..8562b1d5296 100644
--- a/Master/texmf-dist/tex/context/base/x-fe.tex
+++ b/Master/texmf-dist/tex/context/base/x-fe.mkii
diff --git a/Master/texmf-dist/tex/context/base/x-fig-03.tex b/Master/texmf-dist/tex/context/base/x-fig-03.tex
index bf5ea226cff..1317528235e 100644
--- a/Master/texmf-dist/tex/context/base/x-fig-03.tex
+++ b/Master/texmf-dist/tex/context/base/x-fig-03.tex
@@ -11,8 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifx \undefined \convertMPtoPDF \input supp-pdf.tex \fi
-\ifx \undefined \includefigurefile \else \expandafter \endinput \fi
+\ifx \undefined \convertMPtoPDF \input supp-pdf.mkii \fi
+\ifx \undefined \includefigurefile \else \expandafter \endinput \fi
\gdef\getfigurefile#1%
{\expandafter\ifx\csname x-fig-f-#1\endcsname\relax
@@ -37,8 +37,8 @@
{\doincludefigurefile{#1}}
\def\doincludefigurefile#1#2%
- {\edef\next{\noexpand\pdfimage
+ {\edef\next{\noexpand\pdfimage
#1 page \getfigurepage{#2} {\getfigurefile{#2}.pdf}}%
- \next}
+ \next}
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-fo.tex b/Master/texmf-dist/tex/context/base/x-fo.mkii
index 395ec7eb364..b2b0b59f927 100644
--- a/Master/texmf-dist/tex/context/base/x-fo.tex
+++ b/Master/texmf-dist/tex/context/base/x-fo.mkii
@@ -1091,7 +1091,6 @@ leader-pattern-width=12pt,
\checkhexcolor[\XMLpar{fo:region-\currentcommalistitem}{border-top-color}{}]
\checkhexcolor[\XMLpar{fo:region-\currentcommalistitem}{border-left-color}{}]
\checkhexcolor[\XMLpar{fo:region-\currentcommalistitem}{border-right-color}{}]
-
\checkhexcolor[\XMLpar{fo:region-\currentcommalistitem}{background-color}{}]
\checkFOposition{fo:region-\currentcommalistitem}{background}
@@ -2379,6 +2378,10 @@ leader-pattern-width=12pt,
{\beginXMLelement}
{\directsetup{fo:inline:process}\endXMLelement}
+\defineXMLsingular
+ [fo:inline]
+ {}
+
% baseline-shift: baseline sub super % dimen inherit
\chardef\isolatedwordsmode=1
@@ -2387,10 +2390,10 @@ leader-pattern-width=12pt,
\def\shiftedword{\raise\wordshiftamount\hbox}
-\def\shiftedwords#1{\processisolatedwords{#1}\shiftedword}
-\def\normalwords #1{\processisolatedwords{#1}\hbox}
-\def\highwords #1{\processisolatedwords{#1}\high}
-\def\lowwords #1{\processisolatedwords{#1}\low}
+\long\def\shiftedwords#1{\processisolatedwords{#1}\shiftedword}
+\long\def\normalwords #1{\processisolatedwords{#1}\hbox}
+\long\def\highwords #1{\processisolatedwords{#1}\high}
+\long\def\lowwords #1{\processisolatedwords{#1}\low}
\mapXMLvalue {fo:baseline-shift} {baseline} {\normalwords}
\mapXMLvalue {fo:baseline-shift} {sub} {\lowwords}
@@ -2617,8 +2620,8 @@ leader-pattern-width=12pt,
alignment-baseline=,
baseline-shift=,
dominant-baseline=,
-% text-depth=,
-% text-altitude=,
+ % text-depth=,
+ % text-altitude=,
keep-with-next=,
keep-with-previous=,
letter-spacing=,
@@ -2636,16 +2639,13 @@ leader-pattern-width=12pt,
\startsetups fo:leader:process
-% \tracebackXMLattribute{leader-pattern-width}
-
- \strut \leaders
-
-% \edefXMLinh \FOlepatwd {leader-pattern-width}
+ %tracebackXMLattribute{leader-pattern-width}
+ \strut \leaders
+ %edefXMLinh \FOlepatwd {leader-pattern-width}
\hbox to \XMLinh{leader-pattern-width}
{\hss\XMLval{fo:leader-pattern}{\XMLinh{leader-pattern}}{\hfill}\hss}
-
- \hfill \strut
+ \hfill \strut
\stopsetups
@@ -2702,7 +2702,7 @@ leader-pattern-width=12pt,
\defineconversion[1][\numbers]
-\def\handleFOformat#1#2%
+\long\def\handleFOformat#1#2%
{\defconvertedargument\ascii{#2}%
\doifconversiondefinedelse\ascii{\convertnumber\ascii{#1}}{#2}}
@@ -3541,7 +3541,7 @@ text-indent=0pt, % yes
\unprotect
-\def\noFOchecks#1\od{}
+\long\def\noFOchecks#1\od{}
\def\FOassignskip#1#2#3%
{\edef\!!stringa{\XMLpar{#1}{#2}\empty}%
@@ -3747,8 +3747,6 @@ text-indent=0pt, % yes
% we can get crap like: 10pt/1.5 bold "Times Roman" ; i'm really puzzled why an
% otherwise rather verbose coding occasionally packs attributes; a design flaw
-\unprotect
-
\newtoks\FOfonttoks
\def\checkFOfontSS#1'{}
@@ -3835,8 +3833,6 @@ text-indent=0pt, % yes
\appendtoks \flushFOreferences \to \everypar
\appendtoks \flushFOreferences \to \neverypar % check !
-\protect
-
%D Graphics: static frames
\startMPinclusions
@@ -3997,7 +3993,7 @@ text-indent=0pt, % yes
\stopXMLcompiling
-\protect \endinput
+\endinput
% we can follow two approaches: set the attributes global, using
%
diff --git a/Master/texmf-dist/tex/context/base/x-foxet.mkii b/Master/texmf-dist/tex/context/base/x-foxet.mkii
new file mode 100644
index 00000000000..0f8e43af9af
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-foxet.mkii
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=x-foxet,
+%D version=2004.03.12, % based on earlier experiments
+%D title=\FOXET,
+%D subtitle=Formatting Objects,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This module is just a shortcut for:
+
+% fo = basic formatting objects
+% fe = basic formatting extensions
+% fx = extra formatting objects
+% fu = user formatting objects
+% fs = setup
+
+\usemodule[fo,fe,fx,fu,fs,mathml]
+
+\usemodule[fp] % passivetex bonus
+
+% \autoXMLnamespace[mml,mm,mathml]
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-foxet.mkiv b/Master/texmf-dist/tex/context/base/x-foxet.mkiv
new file mode 100644
index 00000000000..b27969721b8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-foxet.mkiv
@@ -0,0 +1,29 @@
+%D \module
+%D [ file=x-foxet,
+%D version=2004.03.12, % based on earlier experiments
+%D title=\FOXET,
+%D subtitle=Formatting Objects,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D Nota bene: I will reimplement formatting object in proper
+%D \MKIV\ code.
+
+\writestatus{foxet}{the mkiv variant is under construction}
+
+%D This module is just a shortcut for:
+
+% fo = basic formatting objects
+% fe = basic formatting extensions
+% fx = extra formatting objects
+% fu = user formatting objects
+% fs = setup
+
+% \usemodule[fo,fe,fx,fu,fs,mathml]
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-foxet.tex b/Master/texmf-dist/tex/context/base/x-foxet.tex
deleted file mode 100644
index 78cc0efb760..00000000000
--- a/Master/texmf-dist/tex/context/base/x-foxet.tex
+++ /dev/null
@@ -1,15 +0,0 @@
-%D This is just a shortcut for:
-
-% fo = basic formatting objects
-% fe = basic formatting extensions
-% fx = extra formatting objects
-% fu = user formatting objects
-% fs = setup
-
-\usemodule[fo,fe,fx,fu,fs,mathml]
-
-\usemodule[fp] % passivetex bonus
-
-% \autoXMLnamespace[mml,mm,mathml]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-ldx.tex b/Master/texmf-dist/tex/context/base/x-ldx.tex
index 140413e7d74..398ca2345f0 100644
--- a/Master/texmf-dist/tex/context/base/x-ldx.tex
+++ b/Master/texmf-dist/tex/context/base/x-ldx.tex
@@ -2,7 +2,7 @@
\setupxml[method=mkiv,default=hidden]
-\usemodule[mathml]
+\usemodule[x][mathml]
\xmlregisterdocumentsetup{ldx}{xml:mml:define}
\xmlregisterdocumentsetup{ldx}{xml:ldx:define}
@@ -10,7 +10,8 @@
\xmlregisterns{ldx}{ldx}
\startxmlsetups xml:ldx:define
- \xmlgrab {\xmldocument} {ldx:*} {*}
+% \xmlgrab {\xmldocument} {ldx:*} {*}
+ \xmlsetsetup {#1} {ldx:*} {ldx:*}
\stopxmlsetups
% % %
@@ -29,12 +30,12 @@
\startxmlsetups ldx:variable
\xmlflush{#1}
- \expanded{\variable{\xmlflush{#1}}}
+% \expanded{\variable{\xmlflush{#1}}}
\stopxmlsetups
\startxmlsetups ldx:function
\dontleavehmode{\bf function}\space\xmlflush{#1}
- \expanded{\function{\xmlflush{#1}}}
+% \expanded{\function{\xmlflush{#1}}}
\stopxmlsetups
\startxmlsetups ldx:com
@@ -78,7 +79,7 @@
\startxmlsetups ldx:code
\startpacked
- \xmlflush{#1}
+ \xmlflush{#1}\relax
\stoppacked
\stopxmlsetups
@@ -94,8 +95,8 @@
} {
\dontleavehmode \hbox to \hsize \bgroup
\strut
- \hskip.25\dimexpr\xmlattdef{#1}{n}{0}em\relax
- \xmldoif {\xmlatt{#1}{comment}} {yes} {\tt}
+ \hskip.25\dimexpr\xmlattdef{#1}{n}{0}em\relax\relax % extra relax needed !
+ \doif {\xmlatt{#1}{comment}} {yes} {\tt}
\xmlflush{#1}
\hss
\egroup
@@ -133,8 +134,6 @@
\def\xmldocument{ldx}
-% \processXMLfileMKIV[ldx]
-
\usemodule[abr-02]
% key -> kw
@@ -187,5 +186,6 @@
backspace=2cm,
topspace=2cm]
-\endinput
+% \usemodule[inf-02]
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-mathml.lua b/Master/texmf-dist/tex/context/base/x-mathml.lua
index aa2e4e716f3..2ee3cd09093 100644
--- a/Master/texmf-dist/tex/context/base/x-mathml.lua
+++ b/Master/texmf-dist/tex/context/base/x-mathml.lua
@@ -1,26 +1,23 @@
if not modules then modules = { } end modules ['x-mathml'] = {
version = 1.001,
- comment = "companion to x-mathml.tex",
+ comment = "companion to x-mathml.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 utf = unicode.utf8
+local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local format, lower, find, gsub = string.format, string.lower, string.find, string.gsub
+local utfchar, utffind, utfgmatch, utfgsub = utf.char, utf.find, utf.gmatch, utf.gsub
+local xmlsprint, xmlcprint, xmltext, xmlcontent = xml.sprint, xml.cprint, xml.text, xml.content
+local lxmltext, get_id = lxml.text, lxml.get_id
+local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
+local lpegmatch = lpeg.match
-lxml = lxml or { }
lxml.mml = lxml.mml or { }
-local texsprint = tex.sprint
-local format = string.format
-local lower = string.lower
-local utfchar = utf.char
-local utffind = utf.find
-local xmlsprint = xml.sprint
-local xmlcprint = xml.cprint
-
-local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues
-
-- an alternative is to remap to private codes, where we can have
-- different properties .. to be done; this will move and become
-- generic
@@ -387,30 +384,29 @@ local csymbols = {
},
}
-function xml.functions.remapmmlcsymbol(r,d,k)
- local dk = d[k]
- local at = dk.at
+function xml.functions.remapmmlcsymbol(e)
+ local at = e.at
local cd = at.cd
if cd then
cd = csymbols[cd]
if cd then
- local tx = dk.dt[1]
+ local tx = e.dt[1]
if tx and tx ~= "" then
local tg = cd[tx]
if tg then
at.cd = nil
at.cdbase = nil
- dk.dt = { }
+ e.dt = { }
if type(tg) == "table" then
- for k, v in pairs(tg) do
+ for k, v in next, tg do
if k == "tag" then
- dk.tg = v
+ e.tg = v
else
at[k] = v
end
end
else
- dk.tg = tg
+ e.tg = tg
end
end
end
@@ -418,170 +414,167 @@ function xml.functions.remapmmlcsymbol(r,d,k)
end
end
-function xml.functions.remapmmlbind(r,d,k)
- d[k].tg = "apply"
+function xml.functions.remapmmlbind(e)
+ e.tg = "apply"
end
-function xml.functions.remapopenmath(r,d,k)
- local dk = d[k]
- local tg = dk.tg
+function xml.functions.remapopenmath(e)
+ local tg = e.tg
if tg == "OMOBJ" then
- dk.tg = "math"
+ e.tg = "math"
elseif tg == "OMA" then
- dk.tg = "apply"
+ e.tg = "apply"
elseif tg == "OMB" then
- dk.tg = "apply"
+ e.tg = "apply"
elseif tg == "OMS" then
- -- xml.functions.remapmmlcsymbol(r,d,k)
- local at = dk.at
- dk.tg = "csymbol"
- dk.dt = { at.name or "unknown" }
+ local at = e.at
+ e.tg = "csymbol"
+ e.dt = { at.name or "unknown" }
at.name = nil
elseif tg == "OMV" then
- local at = dk.at
- dk.tg = "ci"
- dk.dt = { at.name or "unknown" }
+ local at = e.at
+ e.tg = "ci"
+ e.dt = { at.name or "unknown" }
at.name = nil
elseif tg == "OMI" then
- dk.tg = "ci"
+ e.tg = "ci"
end
- dk.rn = "mml"
+ e.rn = "mml"
end
function lxml.mml.checked_operator(str)
- texsprint(tex.ctxcatcodes,(utf.gsub(str,".",o_replacements)))
+ texsprint(ctxcatcodes,(utfgsub(str,".",o_replacements)))
end
function lxml.mml.stripped(str)
- tex.sprint(tex.ctxcatcodes,str:strip())
+ tex.sprint(ctxcatcodes,str:strip())
end
-function lxml.mml.mn(id,pattern)
- -- maybe at some point we need to interpret the number, but
- -- currently we assume an upright font
- local str = xml.content(lxml.id(id),pattern) or ""
- -- str = str:gsub("^%s*(.-)%s*$","%1")
- str = str:gsub("(%s+)",utfchar(0x205F)) -- medspace e.g.: twenty one (nbsp is not seen)
- texsprint(tex.ctxcatcodes,(str:gsub(".",n_replacements)))
+function table.keys_as_string(t)
+ local k = { }
+ for k,_ in next, t do
+ k[#k+1] = k
+ end
+ return concat(k,"")
end
+--~ local leftdelimiters = "[" .. table.keys_as_string(l_replacements) .. "]"
+--~ local rightdelimiters = "[" .. table.keys_as_string(r_replacements) .. "]"
+
function characters.remapentity(chr,slot)
texsprint(format("{\\catcode%s=13\\xdef%s{\\string%s}}",slot,utfchar(slot),chr))
end
-function lxml.mml.mo(id,pattern)
- local str = xml.content(lxml.id(id),pattern) or ""
- texsprint(tex.ctxcatcodes,(utf.gsub(str,".",o_replacements)))
+function lxml.mml.mn(id,pattern)
+ -- maybe at some point we need to interpret the number, but
+ -- currently we assume an upright font
+ local str = xmlcontent(get_id(id)) or ""
+ str = gsub(str,"(%s+)",utfchar(0x205F)) -- medspace e.g.: twenty one (nbsp is not seen)
+ texsprint(ctxcatcodes,(gsub(str,".",n_replacements)))
+end
+
+function lxml.mml.mo(id)
+ local str = xmlcontent(get_id(id)) or ""
+ texsprint(ctxcatcodes,(utfgsub(str,".",o_replacements)))
end
-function lxml.mml.mi(id,pattern)
- local str = xml.content(lxml.id(id),pattern) or ""
- -- str = str:gsub("^%s*(.-)%s*$","%1")
+function lxml.mml.mi(id)
+ local str = xmlcontent(get_id(id)) or ""
+ -- str = gsub(str,"^%s*(.-)%s*$","%1")
local rep = i_replacements[str]
if rep then
- texsprint(tex.ctxcatcodes,rep)
+ texsprint(ctxcatcodes,rep)
else
- texsprint(tex.ctxcatcodes,(str:gsub(".",i_replacements)))
+ texsprint(ctxcatcodes,(gsub(str,".",i_replacements)))
end
end
-function table.keys_as_string(t)
- local k = { }
- for k,_ in pairs(t) do
- k[#k+1] = k
- end
- return concat(k,"")
-end
-
---~ local leftdelimiters = "[" .. table.keys_as_string(l_replacements) .. "]"
---~ local rightdelimiters = "[" .. table.keys_as_string(r_replacements) .. "]"
-
-function lxml.mml.mfenced(id,pattern) -- multiple separators
- id = lxml.id(id)
+function lxml.mml.mfenced(id) -- multiple separators
+ id = get_id(id)
local left, right, separators = id.at.open or "(", id.at.close or ")", id.at.separators or ","
local l, r = l_replacements[left], r_replacements[right]
- texsprint(tex.ctxcatcodes,"\\enabledelimiter")
+ texsprint(ctxcatcodes,"\\enabledelimiter")
if l then
- texsprint(tex.ctxcatcodes,l_replacements[left] or o_replacements[left] or "")
+ texsprint(ctxcatcodes,l_replacements[left] or o_replacements[left] or "")
else
- texsprint(tex.ctxcatcodes,o_replacements["@l"])
- texsprint(tex.ctxcatcodes,left)
+ texsprint(ctxcatcodes,o_replacements["@l"])
+ texsprint(ctxcatcodes,left)
end
- texsprint(tex.ctxcatcodes,"\\disabledelimiter")
- local n = xml.count(id,pattern)
- if n == 0 then
- -- skip
- elseif n == 1 then
- lxml.all(id,pattern)
- else
- local t = { }
- for s in utf.gmatch(separators,"[^%s]") do
- t[#t+1] = s
- end
- for i=1,n do
- lxml.idx(id,pattern,i) -- kind of slow, some day ...
- if i < n then
- local m = t[i] or t[#t] or ""
- if m == "|" then
- m = "\\enabledelimiter\\middle|\\relax\\disabledelimiter"
- elseif m == doublebar then
- m = "\\enabledelimiter\\middle|\\relax\\disabledelimiter"
- elseif m == "{" then
- m = "\\{"
- elseif m == "}" then
- m = "\\}"
+ texsprint(ctxcatcodes,"\\disabledelimiter")
+ local collected = lxml.filter(id,"/*") -- check the *
+ if collected then
+ local n = #collected
+ if n == 0 then
+ -- skip
+ elseif n == 1 then
+ xmlsprint(collected[1]) -- to be checked
+--~ lxml.all(id,"/*")
+ else
+ local t = { }
+ for s in utfgmatch(separators,"[^%s]") do
+ t[#t+1] = s
+ end
+ for i=1,n do
+ xmlsprint(collected[i]) -- to be checked
+ if i < n then
+ local m = t[i] or t[#t] or ""
+ if m == "|" then
+ m = "\\enabledelimiter\\middle|\\relax\\disabledelimiter"
+ elseif m == doublebar then
+ m = "\\enabledelimiter\\middle|\\relax\\disabledelimiter"
+ elseif m == "{" then
+ m = "\\{"
+ elseif m == "}" then
+ m = "\\}"
+ end
+ texsprint(ctxcatcodes,m)
end
- texsprint(tex.ctxcatcodes,m)
end
end
end
- texsprint(tex.ctxcatcodes,"\\enabledelimiter")
+ texsprint(ctxcatcodes,"\\enabledelimiter")
if r then
- texsprint(tex.ctxcatcodes,r_replacements[right] or o_replacements[right] or "")
+ texsprint(ctxcatcodes,r_replacements[right] or o_replacements[right] or "")
else
- texsprint(tex.ctxcatcodes,right)
- texsprint(tex.ctxcatcodes,o_replacements["@r"])
+ texsprint(ctxcatcodes,right)
+ texsprint(ctxcatcodes,o_replacements["@r"])
end
- texsprint(tex.ctxcatcodes,"\\disabledelimiter")
+ texsprint(ctxcatcodes,"\\disabledelimiter")
end
local function flush(e,tag,toggle)
- -- texsprint(tex.ctxcatcodes,(toggle and "^{") or "_{")
+ -- texsprint(ctxcatcodes,(toggle and "^{") or "_{")
if toggle then
- texsprint(tex.ctxcatcodes,"^{")
+ texsprint(ctxcatcodes,"^{")
else
- texsprint(tex.ctxcatcodes,"_{")
+ texsprint(ctxcatcodes,"_{")
end
if tag == "none" then
- texsprint(tex.ctxcatcodes,"{}")
+ texsprint(ctxcatcodes,"{}")
else
xmlsprint(e.dt)
end
if not toggle then
- texsprint(tex.ctxcatcodes,"}")
+ texsprint(ctxcatcodes,"}")
else
- texsprint(tex.ctxcatcodes,"}{}")
+ texsprint(ctxcatcodes,"}{}")
end
return not toggle
end
function lxml.mml.mmultiscripts(id)
local done, toggle = false, false
- id = lxml.id(id)
- -- for i=1,#id.dt do local e = id.dt[i] if type(e) == table then ...
- for r, d, k in xml.elements(id,"/*") do
- local e = d[k]
+ for e in lxml.collected(id,"/*") do
local tag = e.tg
if tag == "mprescripts" then
- texsprint(tex.ctxcatcodes,"{}")
+ texsprint(ctxcatcodes,"{}")
done = true
elseif done then
toggle = flush(e,tag,toggle)
end
end
local done, toggle = false, false
- for r, d, k in xml.elements(id,"/*") do
- local e = d[k]
+ for e in lxml.collected(id,"/*") do
local tag = e.tg
if tag == "mprescripts" then
break
@@ -617,12 +610,12 @@ local frametypes = {
-- crazy element ... should be a proper structure instead of such a mess
function lxml.mml.mcolumn(root)
- root = lxml.id(root)
+ root = get_id(root)
local matrix, numbers = { }, 0
- local function collect(m,dk)
- local tag = dk.tg
+ local function collect(m,e)
+ local tag = e.tg
if tag == "mi" or tag == "mn" or tag == "mo" or tag == "mtext" then
- local str = xml.content(dk)
+ local str = xmltext(e)
for s in utfcharacters(str) do -- utf.gmatch(str,".") btw, the gmatch was bugged
m[#m+1] = { tag, s }
end
@@ -633,28 +626,27 @@ function lxml.mml.mcolumn(root)
end
end
elseif tag == "mspace" or tag == "mline" then
- local str = dk.at.spacing or ""
+ local str = e.at.spacing or ""
for s in utfcharacters(str) do -- utf.gmatch(str,".") btw, the gmatch was bugged
m[#m+1] = { tag, s }
end
elseif tag == "mline" then
- m[#m+1] = { tag, dk }
+ m[#m+1] = { tag, e }
end
end
- for r, d, k in xml.elements(root,"/*") do
+ for e in lxml.collected(root,"/*") do
local m = { }
matrix[#matrix+1] = m
- local dk = d[k]
- if dk.tg == "mrow" then
+ if e.tg == "mrow" then
-- only one level
- for r, d, k in xml.elements(dk,"/*") do
- collect(m,d[k])
+ for e in lxml.collected(e,"/*") do
+ collect(m,e)
end
else
- collect(m,dk)
+ collect(m,e)
end
end
- tex.sprint(tex.ctxcatcodes,"\\halign\\bgroup\\hss$#$&$#$\\cr")
+ tex.sprint(ctxcatcodes,"\\halign\\bgroup\\hss$#$&$#$\\cr")
for i=1,#matrix do
local m = matrix[i]
local mline = true
@@ -665,7 +657,7 @@ function lxml.mml.mcolumn(root)
end
end
if mline then
- tex.sprint(tex.ctxcatcodes,"\\noalign{\\obeydepth\\nointerlineskip}")
+ tex.sprint(ctxcatcodes,"\\noalign{\\obeydepth\\nointerlineskip}")
end
for j=1,#m do
local mm = m[j]
@@ -679,9 +671,9 @@ function lxml.mml.mcolumn(root)
--~ if type(mc) ~= "string" then
--~ n, p = false, false
--~ break
---~ elseif mc:find("^[%d ]$") then -- rangecheck is faster
+--~ elseif find(mc,"^[%d ]$") then -- rangecheck is faster
--~ -- digit
---~ elseif not mc:find("^[%.%,]$") then -- rangecheck is faster
+--~ elseif not find(mc,"^[%.%,]$") then -- rangecheck is faster
--~ -- punctuation
--~ else
--~ n = false
@@ -701,85 +693,92 @@ function lxml.mml.mcolumn(root)
chr = "\\mmlmcolumndigitspace" -- utfchar(0x2007)
end
if j == numbers + 1 then
- tex.sprint(tex.ctxcatcodes,"&")
+ tex.sprint(ctxcatcodes,"&")
end
local nchr = n_replacements[chr]
- tex.sprint(tex.ctxcatcodes,nchr or chr)
+ tex.sprint(ctxcatcodes,nchr or chr)
end
- tex.sprint(tex.ctxcatcodes,"\\crcr")
+ tex.sprint(ctxcatcodes,"\\crcr")
end
- tex.sprint(tex.ctxcatcodes,"\\egroup")
+ tex.sprint(ctxcatcodes,"\\egroup")
end
local spacesplitter = lpeg.Ct(lpeg.splitat(" "))
function lxml.mml.mtable(root)
- root = lxml.id(root)
-
-- todo: align, rowspacing, columnspacing, rowlines, columnlines
-
+ root = get_id(root)
local at = root.at
local rowalign = at.rowalign
local columnalign = at.columnalign
local frame = at.frame
- local rowaligns = rowalign and spacesplitter:match(rowalign)
- local columnaligns = columnalign and spacesplitter:match(columnalign)
- local frames = frame and spacesplitter:match(frame)
+ local rowaligns = rowalign and lpegmatch(spacesplitter,rowalign)
+ local columnaligns = columnalign and lpegmatch(spacesplitter,columnalign)
+ local frames = frame and lpegmatch(spacesplitter,frame)
local framespacing = at.framespacing or "0pt"
local framespacing = at.framespacing or "-\\ruledlinewidth" -- make this an option
---~ function texsprint(a,b) print(b) end
-
- texsprint(tex.ctxcatcodes, format("\\bTABLE[frame=%s,offset=%s]",frametypes[frame or "none"] or "off",framespacing))
- for r, d, k in xml.elements(root,"/(mml:mtr|mml:mlabeledtr)") do
- texsprint(tex.ctxcatcodes,"\\bTR")
- local dk = d[k]
- local at = dk.at
+ texsprint(ctxcatcodes, format("\\bTABLE[frame=%s,offset=%s]",frametypes[frame or "none"] or "off",framespacing))
+--~ context.bTABLE { frame = frametypes[frame or "none"] or "off", offset = framespacing }
+ for e in lxml.collected(root,"/(mml:mtr|mml:mlabeledtr)") do
+ texsprint(ctxcatcodes,"\\bTR")
+--~ context.bTR()
+ local at = e.at
local col = 0
local rfr = at.frame or (frames and frames [#frames])
local rra = at.rowalign or (rowaligns and rowaligns [#rowaligns])
local rca = at.columnalign or (columnaligns and columnaligns[#columnaligns])
- local ignorelabel = dk.tg == "mlabeledtr"
- for rr, dd, kk in xml.elements(dk,"/mml:mtd") do
+ local ignorelabel = e.tg == "mlabeledtr"
+ for e in lxml.collected(e,"/mml:mtd") do -- nested we can use xml.collected
col = col + 1
if ignorelabel and col == 1 then
-- get rid of label, should happen at the document level
else
- local dk = dd[kk]
- local at = dk.at
+ local at = e.at
local rowspan, columnspan = at.rowspan or 1, at.columnspan or 1
local cra = rowalignments [at.rowalign or (rowaligns and rowaligns [col]) or rra or "center"] or "lohi"
local cca = columnalignments[at.columnalign or (columnaligns and columnaligns[col]) or rca or "center"] or "middle"
local cfr = frametypes [at.frame or (frames and frames [col]) or rfr or "none" ] or "off"
- texsprint(tex.ctxcatcodes,format("\\bTD[align={%s,%s},frame=%s,nx=%s,ny=%s]$\\ignorespaces",cra,cca,cfr,columnspan,rowspan))
- xmlcprint(dk)
- texsprint(tex.ctxcatcodes,"\\removeunwantedspaces$\\eTD") -- $
+ texsprint(ctxcatcodes,format("\\bTD[align={%s,%s},frame=%s,nx=%s,ny=%s]$\\ignorespaces",cra,cca,cfr,columnspan,rowspan))
+--~ texfprint("\\bTD[align={%s,%s},frame=%s,nx=%s,ny=%s]$\\ignorespaces",cra,cca,cfr,columnspan,rowspan)
+--~ context.bTD { align = format("{%s,%s}",cra,cca), frame = cfr, nx = columnspan, ny = rowspan }
+--~ context.bmath()
+--~ context.ignorespaces()
+ xmlcprint(e)
+ texsprint(ctxcatcodes,"\\removeunwantedspaces$\\eTD") -- $
+--~ context.emath()
+--~ context.removeunwantedspaces()
+--~ context.eTD()
end
end
---~ if dk.tg == "mlabeledtr" then
---~ texsprint(tex.ctxcatcodes,"\\bTD")
---~ xmlcprint(xml.first(dk,"/!mml:mtd"))
---~ texsprint(tex.ctxcatcodes,"\\eTD")
+--~ if e.tg == "mlabeledtr" then
+--~ texsprint(ctxcatcodes,"\\bTD")
+--~ xmlcprint(xml.first(e,"/!mml:mtd"))
+--~ texsprint(ctxcatcodes,"\\eTD")
--~ end
- texsprint(tex.ctxcatcodes,"\\eTR")
+ texsprint(ctxcatcodes,"\\eTR")
+--~ context.eTR()
end
- texsprint(tex.ctxcatcodes, "\\eTABLE")
+ texsprint(ctxcatcodes, "\\eTABLE")
+--~ context.eTABLE()
end
function lxml.mml.csymbol(root)
- root = lxml.id(root)
- local encoding = root.at.encoding or ""
- local hash = url.hashed(lower(root.at.definitionUrl or ""))
+ root = get_id(root)
+ local at = root.at
+ local encoding = at.encoding or ""
+ local hash = url.hashed(lower(at.definitionUrl or ""))
local full = hash.original or ""
local base = hash.path or ""
- local text = string.strip(xml.content(root) or "")
- texsprint(tex.ctxcatcodes,format("\\mmlapplycsymbol{%s}{%s}{%s}{%s}",full,base,encoding,text))
+ local text = string.strip(lxmltext(root))
+--~ texsprint(ctxcatcodes,format("\\mmlapplycsymbol{%s}{%s}{%s}{%s}",full,base,encoding,text))
+ texsprint(ctxcatcodes,"\\mmlapplycsymbol{",full,"}{",base,"}{",encoding,"}{",text,"}")
end
function lxml.mml.menclosepattern(root)
- root = lxml.id(root)
+ root = get_id(root)
local a = root.at.notation
if a and a ~= "" then
- texsprint("mml:enclose:"..a:gsub(" +",",mml:enclose:"))
+ texsprint("mml:enclose:",gsub(a," +",",mml:enclose:"))
end
end
diff --git a/Master/texmf-dist/tex/context/base/x-mathml.mkiv b/Master/texmf-dist/tex/context/base/x-mathml.mkiv
index 649798c9fe2..a5245c83588 100644
--- a/Master/texmf-dist/tex/context/base/x-mathml.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-mathml.mkiv
@@ -28,7 +28,7 @@
\xmlfilter {\xmldocument} {omt:*/function(remapopenmath)}
\xmlfilter {\xmldocument} {mml:bind/function(remapmmlbind)}
\xmlfilter {\xmldocument} {mml:csymbol/function(remapmmlcsymbol)}
- \xmlsetsetup{\xmldocument} {mml:*} {*}
+ \xmlsetsetup{\xmldocument} {mml:*} {mml:*}
\xmlsetsetup{\xmldocument} {mml:apply/mml:apply/mml:inverse/../../..} {mml:apply:inverse}
\xmlstrip {\xmldocument} {(mml:mi|mml:mo|mml:mn|mml:mtext|mml:csymbol)}
\stopxmlsetups
@@ -38,7 +38,7 @@
\xmlregistersetup{xml:mml:define}
-\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
+\unexpanded\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
\def\MMLhack{\let\MMLpar\par \let\par\relax \everyvbox{\let\par\MMLpar}}
@@ -99,7 +99,7 @@
%D Remark: from now on this is a module and no longer an xtag
%D filter. There is an intermediate cleaner module but it has
-%D some namespace limitations. Here we do it the \MKV\ way.
+%D some namespace limitations. Here we do it the \MKIV\ way.
\def\widevec#1%
{\vbox{\mathsurround\zeropoint\ialign{##\crcr
@@ -152,7 +152,7 @@
%D In the styles, options can be set with:
-\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[MML#1]} % no @@ because passed to lua
+\unexpanded\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[MML#1]} % no @@ because passed to lua
%D We will apply inner math to all bits and pieces made up by an
%D \type {apply}.
@@ -334,7 +334,7 @@
\MMLcreset
\MMLdoL
\mmlfirst{#1}
- \ifnum\xmlnofelements{#1}>\plusone
+ \ifnum\xmlcount{#1}>\plusone
\negthinspace % not enough
\left(\MMLcreset\xmlconcatrange{#1}{/*}{2}{}{\MMLseparator,}\right)
\fi
@@ -354,7 +354,7 @@
\startxmlsetups mml:apply:mml:ci
\xmlfirst{#1}{/mml:ci}
- \ifnum\xmlnofelements{#1}>\plusone
+ \ifnum\xmlcount{#1}>\plusone
\left(\MMLcreset\xmlconcatrange{#1}{/*}{2}{}{\MMLseparator,}\right)
\fi
\stopxmlsetups
@@ -368,7 +368,7 @@
% fn
\startxmlsetups mmc:fn:\utfchar{"00B1} % plusminus ±
- \ifnum\xmlnofelements{#1}>\plustwo
+ \ifnum\xmlcount{#1}>\plustwo
\MMLcreset
\left(\xmlconcat{#1}{/*}{2}{}{\mmlfirst{#1}}\right)
\else
@@ -382,7 +382,7 @@
\startxmlsetups mmc:fn
\begingroup
- \edef\mmlnoffn{\xmlnofelements{#1}}
+ \edef\mmlnoffn{\xmlcount{#1}}
\ifnum\mmlnoffn>\plustwo
\def\MMCfnleft {\left(}
\def\MMCfnright{\right)}
@@ -428,7 +428,7 @@
} {
\MMLcreset
\mmlfirst{#1}
- \ifnum\xmlnofelements{#1}>\plusone
+ \ifnum\xmlcount{#1}>\plusone
\negthinspace
\left(\MMLcreset\xmlconcat{#1}{2}{}{\MMLseparator,}\right)
\fi
@@ -550,10 +550,6 @@
\xmlsetup{#1}{mml:cn:polar}
\stopxmlsetups
-% \doif\MMLcnalternative\v!b{\redefinemathcharacter [.][ord][mi]["3B]\relax}%
-%
-% todo: number function from mmp
-
% helpers ci
\startxmlsetups mml:cn:default
@@ -759,7 +755,7 @@
\doif \MMLdeclarestate \v!start {
\mathopnolimits{declare}
\mmlfirst{#1}
- \ifnum\xmlnofelements{#1}>\plusone
+ \ifnum\xmlcount{#1}>\plusone
\thickspace
\mathopnolimits{as}
\thickspace
@@ -1361,12 +1357,6 @@
}
\stopxmlsetups
-% option: to be discussed with taco/aditya: all math functions \mathentity
-%
-% \defineXMLentity [div] {\mathematics{\triangledown\times}}
-% \defineXMLentity [curl] {\mathematics{\triangledown .}}
-% \defineXMLentity [grad] {\mathematics{\triangledown }}
-
\startxmlsetups mml:divergence \mathopnolimits{div} \xmlall{#1}{/!mml:divergence} \stopxmlsetups
\startxmlsetups mml:grad \mathopnolimits{grad} \xmlall{#1}{/!mml:grad} \stopxmlsetups
\startxmlsetups mml:curl \mathopnolimits{curl} \xmlall{#1}{/!mml:curl} \stopxmlsetups
@@ -1595,7 +1585,7 @@
\startxmlsetups mml:vector
\begingroup
- \ifnum\xmlnofelements{#1}>\plusone
+ \ifnum\xmlcount{#1}>\plusone
\doifelse\MMLvectordirection\v!horizontal {
\left(\xmlconcat{#1}{/*}{\MMLseparator\MMLvectorseparator}\right)
} {
@@ -1664,18 +1654,24 @@
\stopxmlsetups
\usemodule[x][calcmath]
+%usemodule[x][asciimath]
\startxmlsetups mml:annotation
- \xmldoifelse {#1} {[oneof(@encoding,'TeX','tex','TEX','ConTeXt','context','CONTEXT','ctx')]} {
- \begingroup
- \setcatcodetable\ctxcatcodes
- \xmlflush{#1}
- \endgroup
+ \xmldoifelse {#1} {.[oneof(@encoding,'TeX','tex','TEX','ConTeXt','context','CONTEXT','ctx')]} {
+ \xmlflushcontext{#1}
} {
- \xmldoifelse {#1} {[oneof(@encoding,'calcmath','cm')]} {
- \calcmath{\xmlflush{#1}}
+ \xmldoifelse {#1} {.[oneof(@encoding,'calcmath','cm')]} {
+ \expanded{\calcmath{\xmlflush{#1}}}
} {
- \xmlall{#1}{../!mml:annotation}
+ \xmldoifelse {#1} {.[oneof(@encoding,'asciimath','am')]} {
+ \ifdefined\asciimath
+ \expanded{\asciimath{\xmlflush{#1}}}
+ \else
+ \hbox{\tt no am loaded}%
+ \fi
+ } {
+ \xmlall{#1}{../!mml:annotation}
+ }
}
}
\stopxmlsetups
@@ -1852,12 +1848,12 @@
% setups
\startxmlsetups mml:mi % todo: mathvariant mathsize mathcolor mathbackground
- \ctxlua{lxml.mml.mi("#1","*")}
+ \ctxlua{lxml.mml.mi("#1")}
\stopxmlsetups
\startxmlsetups mml:mn % todo: mathvariant mathsize mathcolor mathbackground
\begingroup
- \mr \ctxlua{lxml.mml.mn("#1","*")}% no \hbox, would be ok for . , but spoils rest
+ \mr \ctxlua{lxml.mml.mn("#1")}% no \hbox, would be ok for . , but spoils rest
\endgroup
\stopxmlsetups
@@ -1868,7 +1864,7 @@
\startxmlsetups mml:mo
\doif {\xmlatt{#1}{maxsize}} {1} {\settrue\mmlignoredelimiter}
\doif {\xmlatt{#1}{stretchy}} {false} {\settrue\mmlignoredelimiter}
- \ctxlua{lxml.mml.mo("#1","*")}
+ \ctxlua{lxml.mml.mo("#1")}
\setfalse\mmlignoredelimiter
\stopxmlsetups
@@ -1876,7 +1872,7 @@
\def\MMLleft {\left }% weird
\def\MMLright {\right}
\def\MMLmiddle{\middle}
- \ctxlua{lxml.mml.mfenced("#1","/*")}
+ \ctxlua{lxml.mml.mfenced("#1")}
\stopxmlsetups
\defineoverlay [mml:enclose:box] [\useMPgraphic{mml:enclose:box}]
@@ -2080,8 +2076,9 @@
\startxmlsetups mml:mrow
\begingroup
- \ifnum\xmlcount{#1}{/mml:mo}=\plustwo
- \xmldoifelse {#1} {/mml:mo[position()==1 or position()==\xmlnofelements{#1}]} {% we need a {}
+ \edef\nofmmlrows{\xmlcount{#1}{/mml:mo}}%
+ \ifnum\nofmmlrows=\plustwo
+ \xmldoifelse {#1} {/mml:mo[position()==1 or position()==\nofmmlrows]} {% we need a {}
\def\MMLleft {\left }
\def\MMLright {\right}
\def\MMLmiddle{\middle}
@@ -2146,12 +2143,12 @@
\startxmlsetups mml:mover
% \mathop {
- \edef\mmlovertoken{\xmlraw{#1}{/mml:*[position()==2]}}
+ \edef\mmlovertoken{\xmlraw{#1}{/mml:*[2]}}
\doifelse{\utfmathclass\mmlovertoken}{accent} {
\edef\mmlovercommand{\utfmathcommand\mmlovertoken}
\mmlexecuteifdefined\mmlovercommand\mathematics{\mmlfirst{#1}}
} {
- \edef\mmlbasetoken{\xmlraw{#1}{/mml:*[position()==1]}}
+ \edef\mmlbasetoken{\xmlraw{#1}{/mml:*[1]}}
\edef\mmlbasecommand{\utfmathfiller\mmlbasetoken}
\edef\mmlovercommand{\utfmathfiller\mmlovertoken}
\vbox {
@@ -2170,12 +2167,12 @@
\startxmlsetups mml:munder
% \mathop {
- \edef\mmlundertoken{\xmlraw{#1}{/mml:*[position()==2]}}
+ \edef\mmlundertoken{\xmlraw{#1}{/mml:*[2]}}
\doifelse{\utfmathclass\mmlundertoken}{accent} {
\edef\mmlundercommand{\utfmathcommand\mmlundertoken}
\mmlexecuteifdefined\mmlundercommand\mathematics{\mmlfirst{#1}}
} {
- \edef\mmlbasetoken {\xmlraw{#1}{/mml:*[position()==1]}}
+ \edef\mmlbasetoken {\xmlraw{#1}{/mml:*[1]}}
\edef\mmlbasecommand {\utfmathfiller\mmlbasetoken}
\edef\mmlundercommand{\utfmathfiller\mmlundertoken}
\vtop {
@@ -2193,7 +2190,7 @@
\stopxmlsetups
\startxmlsetups mml:munderover
- \edef\mmlbasetoken{\xmlraw{#1}{/mml:*[position()==1]}}
+ \edef\mmlbasetoken{\xmlraw{#1}{/mml:*[1]}}
\edef\mmlbasecommand{\utfmathcommand\mmlbasetoken}
\mmlexecuteifdefined\mmlbasecommand{\mathematics{\mmlfirst{#1}}}_{\mmlsecond{#1}}^{\mmlthird{#1}}
\stopxmlsetups
diff --git a/Master/texmf-dist/tex/context/base/x-pending.mkiv b/Master/texmf-dist/tex/context/base/x-pending.mkiv
new file mode 100644
index 00000000000..20fe5fb6ae2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-pending.mkiv
@@ -0,0 +1,39 @@
+%D \module
+%D [ file=x-pending,
+%D version=2008.04.04,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Track \MKII\ \XML\ usage in \MKIV,
+%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 Including this module will result in the production of
+%D a file \type {jobname-pending-xml.log} which has a
+%D \LUA\ table with \XML\ elements that are still catched by
+%D \MKII\ code, when enabled.
+
+\startluacode
+ dofile(resolvers.find_file("lxml-inf.lua"))
+ local list = { }
+ function document.check_pending_xml_element(str)
+ list[str] = (list[str] and (list[str]+1)) or 1
+ end
+ function document.show_pending_xml_elements()
+ io.savedata("\jobname-pending-xml-mkii.log", table.serialize(list))
+ io.savedata("\jobname-pending-xml-mkiv.log", table.serialize(lxml.get_command_status()))
+ end
+\stopluacode
+
+\defineXMLcommand
+ [default]
+ {\ctxlua{document.check_pending_xml_element("\currentXMLelement")}}
+
+\appendtoks
+ \ctxlua{document.show_pending_xml_elements()}%
+\to \everystoptext
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-set-11.mkii b/Master/texmf-dist/tex/context/base/x-set-11.mkii
index 434b1864793..450382a953b 100644
--- a/Master/texmf-dist/tex/context/base/x-set-11.mkii
+++ b/Master/texmf-dist/tex/context/base/x-set-11.mkii
@@ -1,14 +1,100 @@
+%D \module
+%D [ file=x-set-11,
+%D version=2004.10.31,
+%D remark=setupx.tex: 1998.07.20 and later,
+%D title=\CONTEXT\ Setup Definitions,
+%D subtitle=Macro Definitions,
+%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.
+
+% module x-set-02 loads the mapping, after that we can say:
+%
+% texmfstart texexec --int=nl --pdf --global --result=setup-nl x-set-12
+
+\usemodule[set-99] % interface messages
+
\unprotect
-\def\mkloadsetups#1%
- {\doifnotmode{no-setup-all}
- {\startXMLmapping[zero]
- \expanded{\processXMLfilegrouped{#1}}%
- \stopXMLmapping}}
+% general
+
+\def\setupnumfont {}
+\def\setuptxtfont {}
+\def\setupintfont#1{\uppercase{#1}}
+\def\setupvarfont {\sl}
+\def\setupoptfont {\sl}
+\def\setupalwcolor {}
+\def\setupoptcolor {darkgray}
+
+\defineXMLenvironmentsave [cd:content] [list=,state=]
+ {\simpleSETUPargument{content}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\def\c!setup!internal!#1%
+ {{\setmessagetext{setup}{#1}%
+ \expanded{\setupintfont{\currentmessagetext}}}}
+
+\def\c!setup!text!#1%
+ {{\setmessagetext{setup}{#1}%
+ \setupvarfont{\currentmessagetext}}}
+
+\def\c!setup!command!#1%
+ {{\setupvarfont{\texescape...#1}}}
+
+\def\??stp{@@stp}
+
+\defineregister
+ [texmacro]
+ [texmacros]
+
+\definesorting
+ [texcommand]
+ [texcommands]
+
+\setupsorting
+ [texcommand]
+ [\c!command=\@@stpcommand,
+ \c!criterium=\@@stpcriterium]
+
+\definesorting
+ [eachtexcommand]
+ [alltexcommands]
+
+\setupsorting
+ [eachtexcommand]
+ [\c!command=\@@stpcommand,
+ \c!criterium=\v!all]
+
+\pushmacro\setuptext
+
+\defineframedtext
+ [setuptext]
+ [\c!width=\hsize,
+ \c!height=\v!fit,
+ \c!align=\v!right,
+ \c!offset=0.75em]
+
+\popmacro\setuptext
+
+\newif\ifshortsetup
+
+\def\doshowsetup
+ {\dosingleempty\dodoshowsetup}
+
+\def\dodoshowsetup[#1]%
+ {\iffirstargument
+ \doshowsetup{#1}%
+ \else
+ \expandafter\doshowsetup
+ \fi}
\bgroup \catcode`\<=\active
-\gdef\mkshowsetup#1%
+\gdef\doshowsetup#1%
{\bgroup
\def<<##1>>{##1}%
\edef\ascii{#1}%
@@ -23,17 +109,465 @@
\egroup
-\def\mkshowusedsetups
- {\getvalue{\e!place\e!listof texcommands}}
+\def\setup {\shortsetupfalse\doshowsetup}
+\def\showsetup {\shortsetupfalse\doshowsetup}
+\def\shortsetup{\shortsetuptrue \doshowsetup}
+\def\setupsetup{\dodoubleargument\getparameters[\??stp]}
+
+\setupsetup
+ [\c!before=,
+ \c!after=,
+ \c!command=\setup,
+ \c!criterium=\v!used]
+
+% verwijzing: 0 geen verwijzingen plaatsen / wel genereren
+% 1 alleen bij zie plaatsen / wel genereren
+% 2 alle verwijzingen plaatsen / niet genereren
+% 3 bij zie commando klikken / wel genereren
+
+\setupsetup
+ [\c!reference=0]
+
+\def\placesetup
+ {\bgroup
+ \getvalue{\e!place\e!listof texcommands}%
+ \egroup}
+
+\def\placeallsetups
+ {\bgroup
+ \setupsetup[\c!reference=2]%
+ \setupreferencing[\c!state=\v!stop]%
+ \getvalue{\e!place\e!listof alltexcommands}%
+ \egroup}
+
+\let\placeeverysetup\placeallsetups
+
+\let\plaatssetup \placesetup
+\let\plaatselkesetup\placeallsetups
-\def\mkshowallsetups
- {\getvalue{\e!place\e!listof alltexcommands}}
+% we use :1 as fallback
+%
+% \setup{setupinterlinespace}
+% \setup{setupinterlinespace:1}
+% \setup{setupinterlinespace:2}
+
+% todo: make this proper mkiv xml
\defineXMLenvironmentsave [cd:define] [name=]
{}
{\setxvalue{cd:def:\XMLop{name}}{\XMLflush{cd:define}}}
\defineXMLsingular [cd:resolve] [name=]
- {\getvalue{cd:def:\XMLop{name}}}
+ {\ignorespaces\getvalue{cd:def:\XMLop{name}}\ignorespaces}
+
+\defineXMLenvironment [cd:command] [name=,type=,generated=,interactive=,variant=]
+ {}
+ {\showSETUPrecord}
+
+\def\showSETUPrecord
+ {\getvalue{\e!start setuptext}
+ \tttf
+ \nohyphens
+ \veryraggedright
+ \startXMLmapping [one]
+ \doglobal\newcounter\currentSETUPargument
+ \global\let\maximumSETUPargument\currentSETUPargument
+ \bgroup
+ \doif{\XMLpar{cd:command}{generated}{}}{yes}{\ttsl}%
+ \doifelseXMLop{type}{environment}
+ {\tex{\e!start}}{\tex{}}\ignorespaces
+ \XMLflush{cd:sequence}\ignorespaces
+ \egroup
+ \doifelseXMLempty{cd:arguments}
+ {}
+ {\bgroup
+ \setbox0=\hbox{\XMLflush{cd:arguments}}%
+ \global\let\maximumSETUPargument\currentSETUPargument
+ \doglobal\newcounter\currentSETUPargument
+ \ignorespaces\XMLflush{cd:arguments}%
+ \doif{\XMLpar{cd:command}{type}{}}{environment}
+ {\hskip.5em\unknown\hskip.5em
+ \doif{\XMLpar{cd:command}{generated}{}}{yes}{\ttsl}%
+ \tex{\e!stop}\ignorespaces\XMLflush{cd:sequence}}%
+ \endgraf
+ \egroup
+ %\bgroup
+ % \tx
+ % \doif{\XMLpar{cd:command}{interactive}{}}{yes} {\quad INTERACTIVE}%
+ % \doif{\XMLpar{cd:command}{interactive}{}}{exclusive}{\quad INTERACTIVE ONLY}%
+ %\egroup
+ \startXMLmapping [two]
+ \bgroup
+ \doglobal\newcounter\currentSETUPargument
+ \blank[\v!line]
+ \switchtobodyfont[small] % kan sneller
+ \ignorespaces\XMLflush{cd:arguments}\endgraf
+ \egroup
+ \stopXMLmapping}
+ \stopXMLmapping
+ \getvalue{\e!stop setuptext}}
+
+\defineXMLenvironmentsave [cd:sequence] \ignorespaces \ignorespaces
+\defineXMLenvironmentsave [cd:arguments] \ignorespaces \ignorespaces
+
+%D This is the first pass; here we generate the top line.
+
+\newcounter\currentSETUPargument
+\def\currentSETUPwidth{0pt}
+
+% environmentsave ?
+
+\startXMLmapping [one]
+
+\defineXMLenvironmentsave [cd:string] [value=]
+ {\XMLop{value}\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:variable] [value=]
+ {{\expanded{\setupintfont{\XMLop{value}}}}\ignorespaces}
+ {\ignorespaces}
+
+% moet een standaard type worden
+
+\defineXMLenvironmentsave [cd:assignments] [list=,state=]
+ {\showSETUPassignment\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:keywords] [list=,state=]
+ {\showSETUPkeyword\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:content] [list=,state=]
+ {\showSETUPcontent\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:displaymath] [list=,state=]
+ {\showSETUPdisplaymath\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:index] [list=,state=]
+ {\showSETUPindex\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:math] [list=,state=]
+ {\showSETUPmath\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:nothing] [list=,state=]
+ {\showSETUPnothing\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:file] [list=,state=]
+ {\showSETUPfile\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:position] [list=,state=]
+ {\showSETUPposition\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:reference] [list=,state=]
+ {\showSETUPreference\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:csname] [list=,state=]
+ {\showSETUPcsname\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:destination] [list=,state=]
+ {\showSETUPdestination\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:triplet] [list=,state=]
+ {\showSETUPtriplet\ignorespaces} {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:word] [list=,state=]
+ {\showSETUPword\ignorespaces} {\ignorespaces}
+
+\stopXMLmapping
+
+%D This is the second pass; here we generate the table.
+
+\startXMLmapping [two]
+
+\def\startfirstSETUPcolumn#1%
+ {\bgroup
+ \advance\leftskip 2em
+ \noindent\llap{\hbox to 2em{#1\hss}}}
+
+\def\stopfirstSETUPcolumn
+ {\endgraf
+ \egroup}
+
+\def\startsecondSETUPcolumn#1#2%
+ {\bgroup
+ \advance\hangindent \currentSETUPwidth
+ \advance\hangindent 2.5em
+ \noindent \hbox to \hangindent{#1\hss\hbox to 2.5em{\hss#2\hss}}%
+ \ignorespaces}
+
+\def\stopsecondSETUPcolumn
+ {\endgraf
+ \egroup}
+
+\def\secondSETUPcolumn#1#2%
+ {\startsecondSETUPcolumn{#1}{#2}\stopsecondSETUPcolumn}
+
+\def\previousSETUPargument{\currentSETUPargument}
+
+\defineXMLenvironmentsave [cd:assignments]
+ {}
+ {\xdef\currentSETUPwidth{0pt}%
+ \bgroup
+ \defineXMLenvironment [cd:parameter] [name=]
+ {\setbox0=\hbox{\potentialXMLentity{\XMLop{name}}}%
+ \ifdim\wd0>\currentSETUPwidth\xdef\currentSETUPwidth{\the\wd0}\fi}%
+ {}%
+ \setbox0=\vbox{\XMLflush{cd:assignments}}%
+ \egroup
+ \startfirstSETUPcolumn{\showSETUPnumber}%
+ \doifelseXMLempty{cd:assignments}
+ {\secondSETUPcolumn{\c!setup!text!{see} \previousSETUPargument}{}}
+ {\ignorespaces
+ \XMLflush{cd:assignments}%
+ \let\previousSETUPargument\currentSETUPargument}%
+ \stopfirstSETUPcolumn
+ \blank[\v!halfline]
+ \ignorespaces}
+
+\defineXMLenvironmentsave [cd:keywords] [optional=no]
+ {}
+ {\startfirstSETUPcolumn{\showSETUPnumber}%
+ \doifelseXMLempty{cd:keywords}
+ {\secondSETUPcolumn{see \previousSETUPargument}{}}
+ {\ignorespaces
+ \XMLflush{cd:keywords}%
+ \let\previousSETUPargument\currentSETUPargument}%
+ \stopfirstSETUPcolumn
+ \blank[\v!halfline]
+ \ignorespaces}
+
+\defineXMLenvironment [cd:parameter] [name=]
+ {\startsecondSETUPcolumn{\potentialXMLentity{\XMLop{name}}}{=}%
+ \ignorespaces}
+ {\stopsecondSETUPcolumn
+ \ignorespaces}
+
+\defineXMLenvironmentsave [cd:constant] [type=,default=]
+ {\doifXMLop{default}{yes}{\underbar}%
+ {\potentialXMLentity{\XMLop{type}}}\space\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:variable] [value=]
+ {\potentialXMLentity{\XMLop{value}}\space\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:inherit] [name=]
+ {\secondSETUPcolumn{\c!setup!text!{inherits} \tex{}\XMLop{name}}{}\ignorespaces}
+ {\ignorespaces}
+
+\def\simpleSETUPargument#1%
+ {\startfirstSETUPcolumn{\showSETUPnumber}%
+ \c!setup!internal!{#1}%
+ \stopfirstSETUPcolumn}
+
+\defineXMLenvironmentsave [cd:content] [list=,state=]
+ {\simpleSETUPargument{content}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:displaymath] [list=,state=]
+ {\simpleSETUPargument{display math}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:index] [list=,state=]
+ {\simpleSETUPargument{index}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:math] [list=,state=]
+ {\simpleSETUPargument{math}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:nothing] [list=,state=]
+ {\simpleSETUPargument{nothing}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:file] [list=,state=]
+ {\simpleSETUPargument{file name}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:position] [list=,state=]
+ {\simpleSETUPargument{position}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:reference] [list=,state=]
+ {\simpleSETUPargument{reference}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:csname] [list=,state=]
+ {\simpleSETUPargument{csname}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:destination] [list=,state=]
+ {\simpleSETUPargument{destination}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:triplet] [list=,state=]
+ {\simpleSETUPargument{triplet}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\defineXMLenvironmentsave [cd:word] [list=,state=]
+ {\simpleSETUPargument{word}\blank[\v!halfline]\ignorespaces}
+ {\ignorespaces}
+
+\stopXMLmapping
+
+\defineXMLentity [cd:command] {\c!setup!internal!{command}}
+\defineXMLentity [cd:dimension] {\c!setup!internal!{dimension}}
+\defineXMLentity [cd:file] {\c!setup!internal!{file}}
+\defineXMLentity [cd:name] {\c!setup!internal!{identifier}}
+\defineXMLentity [cd:character] {\c!setup!internal!{character}}
+\defineXMLentity [cd:mark] {\c!setup!internal!{mark}}
+\defineXMLentity [cd:number] {\c!setup!internal!{number}}
+\defineXMLentity [cd:reference] {\c!setup!internal!{reference}}
+\defineXMLentity [cd:plural] {\c!setup!internal!{plural}}
+\defineXMLentity [cd:singular] {\c!setup!internal!{singular}}
+\defineXMLentity [cd:text] {\c!setup!internal!{text}}
+\defineXMLentity [cd:formula] {\c!setup!internal!{formula}}
+\defineXMLentity [cd:file] {\c!setup!internal!{file}}
+\defineXMLentity [cd:matrix] {\c!setup!internal!{matrix}}
+\defineXMLentity [cd:list] {\c!setup!internal!{list}}
+\defineXMLentity [cd:section] {\c!setup!internal!{section}}
+
+\defineXMLentity [cd:noargument] {\c!setup!command!{}}
+\defineXMLentity [cd:oneargument] {\c!setup!command!{\#1}}
+\defineXMLentity [cd:twoarguments] {\c!setup!command!{\#1\#2}}
+\defineXMLentity [cd:threearguments] {\c!setup!command!{\#1\#2\#3}}
+
+%D Todo:
+
+\defineXMLprocess [cd:choice]
+
+%D Auxiliary.
+
+\unexpanded\def\showSETUP#1#2%
+ {\bgroup
+ \doglobal\increment\currentSETUPargument
+ \setbox0=\hbox
+ {\doifelseXMLop{list}{yes}{#2}{#1}}%
+ \setbox2=\hbox to \wd0
+ {\hss
+ \raise1ex\hbox
+ {\tx\ifcase\maximumSETUPargument\relax
+ \or*\else\currentSETUPargument
+ \fi}%
+ \hss}%
+ \setbox4=\hbox to \wd0
+ {\hss
+ \lower2ex\hbox
+ \bgroup
+ \txx\doifXMLop{optional}{yes}{\c!setup!internal!{optional}}%
+ \egroup
+ \hss}%
+ \ht2\ht\strutbox
+ \dp4\dp\strutbox
+ \hskip.5em\hsmash{\box0}\hsmash{\box4}\box2%
+ \egroup}
+
+\def\showSETUPnumber
+ {\doglobal\increment\currentSETUPargument
+ \hbox to 2em
+ {\ifcase\maximumSETUPargument\relax
+ \or*\else\currentSETUPargument
+ \fi
+ \hss}}
+
+\def\showSETUPassignment {\showSETUP
+ {[.\lower.5ex\hbox{=}.]}
+ {[..,.\lower.5ex\hbox{=}.,..]}}
+
+\def\showSETUPkeyword {\showSETUP
+ {[...]}
+ {[...,...]}}
+
+\def\showSETUPargument {\showSETUP
+ {\leftargument..\rightargument}
+ {\leftargument..,...,..\rightargument}}
+
+\def\showSETUPdisplaymath {\showSETUP
+ {\$\$...\$\$}
+ {\$\$...\$\$}}
+
+\def\showSETUPindex {\showSETUP
+ {\leftargument...\rightargument}
+ {\leftargument..+...+..\rightargument}}
+
+\def\showSETUPmath {\showSETUP
+ {\$...\$}
+ {\$...\$}}
+
+\def\showSETUPnothing {\showSETUP
+ {...}
+ {}}
+
+\def\showSETUPfile {\showSETUP
+ {~...~}
+ {}}
+
+\def\showSETUPposition {\showSETUP
+ {(...)}
+ {(...,...)}}
+
+\def\showSETUPreference {\showSETUP
+ {[...]}
+ {[...,...]}}
+
+\def\showSETUPcsname {\showSETUP
+ {{\c!setup!command!{}}}
+ {}}
+
+\def\showSETUPdestination {\showSETUP
+ {[\leftargument..[ref]\rightargument]}
+ {[..,\leftargument..[ref,..]\rightargument,..]}}
+
+\def\showSETUPtriplet {\showSETUP
+ {[x:y:z=]}
+ {[x:y:z=,..]}}
+
+\def\showSETUPword {\showSETUP
+ {\leftargument...\rightargument}
+ {\leftargument.. ... ..\rightargument}}
+
+\def\showSETUPcontent {\showSETUP
+ {\leftargument...\rightargument}
+ {\leftargument.. ... ..\rightargument}}
+
+%\def\c!par!{\c!setup!internal!{endofpar}}
+%\def\c!repeat!{\c!opt!{{\setupvarfont n}*}}
+%\showSETUP\def\c!par!{\texescape par}
+%\showSETUP\def\c!sep!{\texescape\texescape}
+%\def\c!par!{\addtypespec{delimiter}{par}} % \par
+%\def\c!sep!{\addtypespec{separator}{backslash}} % \\
+%\def\c!repeat!{}
+%\def\c!tex!#1{\addtypespec{command}{#1}\doanother{tex}}
+
+\startXMLmapping[zero]
+
+\defineXMLenvironmentsave [cd:command] [name=,type=,generated=,interactive=,variant=]
+ {}
+ {\doifelseXMLop{type}{environment}
+ {\edef\currentSETUPname{start\XMLop{name}}}
+ {\edef\currentSETUPname{\XMLop{name}}}%
+ \doifsomething{\XMLop{variant}}
+ {\edef\currentSETUPname{\currentSETUPname:\XMLop{variant}}}% like setupinterlinespace:1
+ \doifXMLop{generated}{yes}
+ {\edef\currentSETUPname{\currentSETUPname*}}%
+ \doglobal\saveXMLdatainelement{stp:\currentSETUPname}{cd:command}{cd:command}%
+ \expanded{\eachtexcommand[stp:x:\currentSETUPname]{\currentSETUPname}}%
+ \expanded{\texcommand [stp:y:\currentSETUPname]{\currentSETUPname}}}
+
+\stopXMLmapping
+
+\def\loadsetups{\complexorsimple\loadsetups}
+
+\def\simpleloadsetups
+ {\doifnotmode{no-setup-main}
+ {\complexloadsetups[cont-en.xml]}}
+
+\def\complexloadsetups[#1]%
+ {\doifsomething{#1}
+ {\doifnotmode{no-setup-all}
+ {\startXMLmapping[zero]
+ \expanded{\processXMLfilegrouped{#1}}%
+ \stopXMLmapping}}}
+
+\defineXMLsingular [cd:include] [file=]
+ {\complexloadsetups[\XMLop{file}]}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-set-11.mkiv b/Master/texmf-dist/tex/context/base/x-set-11.mkiv
index 499d531e5f0..784df311389 100644
--- a/Master/texmf-dist/tex/context/base/x-set-11.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-set-11.mkiv
@@ -1,98 +1,476 @@
-% engine=luatex
+%D \module
+%D [ file=x-set-11,
+%D version=2004.10.31,
+%D remark=setupx.tex: 1998.07.20 and later,
+%D title=\CONTEXT\ Setup Definitions,
+%D subtitle=Macro Definitions,
+%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.
-\startluacode
- do
- document = document or { }
+% \startluacode
+% collectgarbage("stop")
+% function collectgarbage() return 0 end
+% \stopluacode
- document.setups = {
- loaded = { },
- root = nil,
- used = { },
+% todo: for fun: pure lua interface, but as this style evolved over 15 years
+% it's a waste of time
+%
+% todo:
+%
+% \setup{setupinterlinespace}
+% \setup{setupinterlinespace:1}
+% \setup{setupinterlinespace:2}
+%
+% cd:include -> @file
+% cd:choice
+%
+% register, interaction
+
+\usemodule[set-99] % interface messages
+
+\unprotect
+
+% general
+
+\unexpanded\def\setupnumfont {}
+\unexpanded\def\setuptxtfont {}
+\unexpanded\def\setupintfont {\WORD}
+\unexpanded\def\setupvarfont {\sl}
+\unexpanded\def\setupoptfont {\sl}
+\unexpanded\def\setupalwcolor {}
+\unexpanded\def\setupoptcolor {darkgray}
+
+\def\c!setup!definereserved#1#2%
+ {\setvalue{c!setup!:r:#1}{#2}}
+
+\def\c!setup!reserved!#1%
+ {\executeifdefined{c!setup!:r:#1}{#1}}
+
+\def\c!setup!internal!#1%
+ {\dontleavehmode
+ \begingroup
+ \setupintfont{#1}%
+ \endgroup}
+
+\def\c!setup!text!#1%
+ {\dontleavehmode
+ \begingroup
+ \setupvarfont{#1}%
+ \endgroup}
+
+\def\c!setup!command!#1%
+ {{\setupvarfont{\texescape...#1}}}
+
+\def\??stp{@@stp}
+
+\defineregister
+ [texmacro]
+ [texmacros]
+
+\definesorting
+ [texcommand]
+ [texcommands]
+
+\setupsorting
+ [texcommand]
+ [\c!command=\showsetupinlist,
+ \c!criterium=\@@stpcriterium]
+
+\pushmacro\setuptext
+
+\defineframedtext
+ [setuptext]
+ [\c!width=\hsize,
+ \c!height=\v!fit,
+ \c!align=\v!right,
+ \c!offset=0.75em]
+
+\popmacro\setuptext
+
+%D Loading:
+
+\let\currentSETUPfullname\s!unknown
+
+\startxmlsetups xml:setups:assemblename
+ \doifelse {\xmlatt{#1}{environment}} {yes} {
+ \let\currentSETUPprefix\e!start
+ } {
+ \let\currentSETUPprefix\empty
+ }
+ \edef\currentSETUPname{\xmlatt{#1}{name}}
+ \doifelse {\xmlatt{#1}{generated}} {yes} {
+ \def\currentSETUPgenerated{*}
+ } {
+ \let\currentSETUPgenerated\empty
+ }
+ \doifelsenothing {\xmlatt{#1}{variant}} {
+ \let\currentSETUPvariant\empty
+ } {
+ \def\currentSETUPvariant{:\xmlatt{#1}{variant}}
+ }
+ \edef\currentSETUPfullname {
+ \currentSETUPprefix
+ \currentSETUPname
+ \currentSETUPvariant
+ \currentSETUPgenerated
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:setups:register
+ \xmlsetup{#1}{xml:setups:assemblename}
+ \expanded{\texcommand[stp:x:\currentSETUPfullname]{#1}}
+\stopxmlsetups
+
+\startxmlsetups xml:setups:basics
+ \xmlsetsetup {#1} {
+ sequence|string|variable|assignments|keywords|content|displaymath|index|math|
+ nothing|file|position|reference|csname|destination|triplet|word|
+ resolve|parameter|constant|inherit|parameter|define
+ } {xml:setups:*}
+\stopxmlsetups
+
+\xmlregisterdocumentsetup{setups}{xml:setups:basics}
+
+\def\loadsetups{\complexorsimple\loadsetups}
+
+\let\loadedsetups\empty % we load more setups, setups:<name>
+
+\def\simpleloadsetups
+ {\doifnotmode{no-setup-main}{\complexloadsetups[cont-en.xml]}}
+
+\def\complexloadsetups[#1]%
+ {\doifsomething{#1}
+ {\doonlyonce{setups:#1}
+ {\doglobal\prependtocommalist{setups:#1}\loadedsetups % last overloads first
+ \xmlloadonly{setups:#1}{#1}{setups}%
+ \xmlfilter{setups:#1}{/interface/command/command(xml:setups:register)}}}} % qualified path saves > 50% runtime
+
+\newif\ifshortsetup
+
+\unexpanded\def\setup {\shortsetupfalse\doshowsetup}
+\def\showsetup {\shortsetupfalse\doshowsetup}
+\def\shortsetup{\shortsetuptrue \doshowsetup}
+\unexpanded\def\setupsetup{\dodoubleargument\getparameters[\??stp]}
+
+%unexpanded\def\showsetupinlist#1#2#3{\shortsetupfalse\showsetupindeed{#3}\par}
+\unexpanded\def\showsetupinlist#1#2#3{\shortsetupfalse\xmlsetup{#3}{xml:setups:typeset}\par}
+
+% todo: only references in lists
+
+\def\doshowsetup
+ {\dosingleempty\dodoshowsetup}
+
+\def\dodoshowsetup[#1]%
+ {\iffirstargument
+ \dododoshowsetup{#1}%
+ \else
+ \expandafter\dododoshowsetup
+ \fi}
+
+\def\dododoshowsetup#1% this will trigger 'used'
+ {\registersort[texcommand][stp:x:#1]%
+ \showsetupindeed{#1}}
+
+\def\showsetupindeed#1%
+ {\xmlfilterlist{\loadedsetups}{/interface/command[@name='#1']/command(xml:setups:typeset)}}
+
+\unexpanded\def\placesetup {\placelistofsorts[texcommand][\c!criterium=\v!used]}
+\unexpanded\def\placeallsetups{\placelistofsorts[texcommand][\c!criterium=\v!all ]}
+
+\let\placeeverysetup\placeallsetups
+
+%D Typesetting:
+
+\setupxml
+ [\c!method=mkiv, % mixed mode
+ \c!default=\v!hidden, % ignore elements that are not defined
+ \c!compress=\v!yes, % strip comment
+ \c!entities=\v!yes] % replace entities
+
+\newcounter\currentSETUPargument
+\newcounter\maximumSETUPargument
+
+\def\currentSETUPwidth{0pt}
+
+\startxmlsetups xml:setups:typeset
+ \getvalue{\e!start setuptext}
+ \tttf
+ \nohyphens
+ \veryraggedright
+ \doglobal\newcounter\currentSETUPargument
+ \xdef\maximumSETUPargument{\xmlcount{#1}{/arguments/*}}
+ \bgroup
+ \doif {\xmlatt{#1}{generated}} {yes} {
+ \ttsl
+ }
+ \doifelse {\xmlatt{#1}{type}} {environment} {
+ \tex{\e!start}
+ } {
+ \tex{}
+ }
+ \xmlfilter{#1}{/sequence/first()}
+ \ignorespaces
+ \egroup
+ \xmldoif{#1}{/arguments} {
+ \bgroup
+ \enablemode[setups-pass-one]
+ \doglobal\newcounter\currentSETUPargument
+ \ignorespaces
+ \xmlfilter{#1}{/arguments/text()}
+ \egroup
+ }
+ \doif {\xmlatt{#1}{type}} {environment} {
+ \bgroup
+ \hskip.5em\unknown\hskip.5em
+ \doif {\xmlatt{#1}{generated}} {yes} {
+ \ttsl
+ }
+ \tex{\e!stop}
+ \xmlfilter{#1}{/sequence/variable/first()}
+ \ignorespaces
+ \egroup
+ }
+ \endgraf
+ \xmldoif{#1}{/arguments} {
+ \bgroup
+ \enablemode[setups-pass-two]
+ \doglobal\newcounter\currentSETUPargument
+ \blank[\v!line]
+ \switchtobodyfont[small]
+ \ignorespaces\xmlfilter{#1}{/arguments/text()}\endgraf
+ \egroup
+ }
+ \getvalue{\e!stop setuptext}
+\stopxmlsetups
+
+\setupsetup
+ [\c!before=,
+ \c!after=,
+ \c!command=\setup,
+ \c!criterium=\v!used]
+
+\startxmlsetups xml:setups:resolve
+ \ignorespaces
+ \xmlfilterlist{\loadedsetups}{/interface/define[@name='\xmlatt{#1}{name}']/first()}
+\stopxmlsetups
+
+%D This is the first pass; here we generate the top line.
+
+\startxmlsetups xml:setups:define
+ \ignorespaces\xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:setups:sequence
+ \ignorespaces\xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups xml:setups:string
+ \xmlatt{#1}{value}\ignorespaces
+\stopxmlsetups
+
+\startxmlsetups xml:setups:content \showSETUPcomponent{#1}{content} {content} \stopxmlsetups
+\startxmlsetups xml:setups:displaymath \showSETUPcomponent{#1}{displaymath}{display math}\stopxmlsetups
+\startxmlsetups xml:setups:index \showSETUPcomponent{#1}{index} {index} \stopxmlsetups
+\startxmlsetups xml:setups:math \showSETUPcomponent{#1}{math} {math} \stopxmlsetups
+\startxmlsetups xml:setups:nothing \showSETUPcomponent{#1}{nothing} {nothing} \stopxmlsetups
+\startxmlsetups xml:setups:file \showSETUPcomponent{#1}{file} {file name} \stopxmlsetups
+\startxmlsetups xml:setups:position \showSETUPcomponent{#1}{position} {position} \stopxmlsetups
+\startxmlsetups xml:setups:reference \showSETUPcomponent{#1}{reference} {reference} \stopxmlsetups
+\startxmlsetups xml:setups:csname \showSETUPcomponent{#1}{csname} {csname} \stopxmlsetups
+\startxmlsetups xml:setups:destination \showSETUPcomponent{#1}{destination}{destination} \stopxmlsetups
+\startxmlsetups xml:setups:triplet \showSETUPcomponent{#1}{triplet} {triplet} \stopxmlsetups
+\startxmlsetups xml:setups:word \showSETUPcomponent{#1}{word} {word} \stopxmlsetups
+
+\def\showSETUPcomponent#1#2#3%
+ {\doifmodeelse{setups-pass-one}
+ {\getvalue{showSETUP#2}{#1}}
+ {\simpleSETUPargument{#3}}}
+
+%D This is the second pass; here we generate the table.
+
+\unexpanded\def\startfirstSETUPcolumn#1%
+ {\bgroup
+ \advance\leftskip 2em
+ \noindent\llap{\hbox to 2em{#1\hss}}}
+
+\unexpanded\def\stopfirstSETUPcolumn
+ {\endgraf
+ \egroup}
+
+\unexpanded\def\startsecondSETUPcolumn#1#2%
+ {\bgroup
+ \advance\hangindent\dimexpr\currentSETUPwidth+2.5em\relax
+ \noindent \hbox to \hangindent{#1\hss\hbox to 2.5em{\hss#2\hss}}}
+
+\unexpanded\def\stopsecondSETUPcolumn
+ {\endgraf
+ \egroup}
+
+\def\secondSETUPcolumn#1#2%
+ {\startsecondSETUPcolumn{#1}{#2}\stopsecondSETUPcolumn}
+
+\def\previousSETUPargument{\currentSETUPargument}
+
+\startxmlsetups xml:setups:parameter:measure
+ \setbox0=\hbox{\c!setup!reserved!{\xmlatt{#1}{name}}}
+ \ifdim\wd0>\currentSETUPwidth\xdef\currentSETUPwidth{\the\wd0}\fi
+\stopxmlsetups
+
+\startxmlsetups xml:setups:assignments
+ \doifmodeelse{setups-pass-one} {
+ \showSETUPassignment{#1}
+ } {
+ \xdef\currentSETUPwidth{0pt}%
+ \bgroup
+ \xmlfilter{#1}{/parameter/command(xml:setups:parameter:measure)}
+ \egroup
+ \startfirstSETUPcolumn{\showSETUPnumber}%
+ \ignorespaces
+ \xmlflush{#1}
+ \let\previousSETUPargument\currentSETUPargument
+ \stopfirstSETUPcolumn
+ \blank[\v!halfline]
+ \ignorespaces
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:setups:keywords
+ \doifmodeelse{setups-pass-one} {
+ \showSETUPkeyword{#1}
+ } {
+ \startfirstSETUPcolumn{\showSETUPnumber}%
+ \ignorespaces
+ \xmlflush{#1}
+ \let\previousSETUPargument\currentSETUPargument
+ \stopfirstSETUPcolumn
+ \blank[\v!halfline]
+ \ignorespaces
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:setups:parameter
+ \startsecondSETUPcolumn{\c!setup!reserved!{\xmlatt{#1}{name}}}{=}
+ \ignorespaces
+ \xmlflush{#1}
+ \stopsecondSETUPcolumn
+ \ignorespaces
+\stopxmlsetups
+
+\startxmlsetups xml:setups:constant
+ \doifmodeelse {setups-pass-one} {
+ } {
+ \doif {\xmlatt{#1}{default}} {yes} {
+ \underbar % next needs to be {braced}
}
+ {\c!setup!reserved!{\xmlatt{#1}{type}}}
+ \space
+ \ignorespaces
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:setups:variable
+ \doifmodeelse {setups-pass-one} {
+ \expanded{\setupintfont{\xmlatt{#1}{value}}}\ignorespaces
+ } {
+ \c!setup!reserved!{\xmlatt{#1}{value}}
+ \space
+ \ignorespaces
+ }
+\stopxmlsetups
+
+\startxmlsetups xml:setups:inherit
+ \secondSETUPcolumn {
+ \c!setup!text!{\getmessage{setup}{inherits}}
+ \enspace
+ \tex{}
+ \xmlatt{#1}{name}
+ } {}
+ \ignorespaces
+\stopxmlsetups
+
+\def\simpleSETUPargument#1%
+ {\startfirstSETUPcolumn{\showSETUPnumber}%
+ \c!setup!internal!{#1}%
+ \stopfirstSETUPcolumn
+ \blank[\v!halfline]
+ \ignorespaces}
+
+\c!setup!definereserved {cd:command} {\c!setup!internal!{\getmessage{setup}{command}}}
+\c!setup!definereserved {cd:dimension} {\c!setup!internal!{\getmessage{setup}{dimension}}}
+\c!setup!definereserved {cd:file} {\c!setup!internal!{\getmessage{setup}{file}}}
+\c!setup!definereserved {cd:name} {\c!setup!internal!{\getmessage{setup}{identifier}}}
+\c!setup!definereserved {cd:character} {\c!setup!internal!{\getmessage{setup}{character}}}
+\c!setup!definereserved {cd:mark} {\c!setup!internal!{\getmessage{setup}{mark}}}
+\c!setup!definereserved {cd:number} {\c!setup!internal!{\getmessage{setup}{number}}}
+\c!setup!definereserved {cd:reference} {\c!setup!internal!{\getmessage{setup}{reference}}}
+\c!setup!definereserved {cd:plural} {\c!setup!internal!{\getmessage{setup}{plural}}}
+\c!setup!definereserved {cd:singular} {\c!setup!internal!{\getmessage{setup}{singular}}}
+\c!setup!definereserved {cd:text} {\c!setup!internal!{\getmessage{setup}{text}}}
+\c!setup!definereserved {cd:formula} {\c!setup!internal!{\getmessage{setup}{formula}}}
+\c!setup!definereserved {cd:file} {\c!setup!internal!{\getmessage{setup}{file}}}
+\c!setup!definereserved {cd:matrix} {\c!setup!internal!{\getmessage{setup}{matrix}}}
+\c!setup!definereserved {cd:list} {\c!setup!internal!{\getmessage{setup}{list}}}
+\c!setup!definereserved {cd:section} {\c!setup!internal!{\getmessage{setup}{section}}}
+
+\c!setup!definereserved {cd:noargument} {\c!setup!command! {}}
+\c!setup!definereserved {cd:oneargument} {\c!setup!command! {\#1}}
+\c!setup!definereserved {cd:twoarguments} {\c!setup!command! {\#1\#2}}
+\c!setup!definereserved {cd:threearguments} {\c!setup!command! {\#1\#2\#3}}
+
+%D Auxiliary.
+
+\unexpanded\def\showSETUP#1#2#3%
+ {\bgroup
+ \doglobal\increment\currentSETUPargument
+ \setbox0=\hbox
+ {\doifelse{\xmlatt{#1}{list}}{yes}{#3}{#2}}%
+ \setbox2=\hbox to \wd0
+ {\hss
+ \raise1ex\hbox
+ {\tx\ifcase\maximumSETUPargument\relax
+ \or*\else\currentSETUPargument
+ \fi}%
+ \hss}%
+ \setbox4=\hbox to \wd0
+ {\hss
+ \lower2ex\hbox
+ \bgroup
+ \txx\doif{\xmlatt{#1}{optional}}{yes}{\c!setup!internal!{\getmessage{setup}{optional}}}%
+ \egroup
+ \hss}%
+ \ht2\ht\strutbox
+ \dp4\dp\strutbox
+ \hskip.5em\hsmash{\box0}\hsmash{\box4}\box2%
+ \egroup
+ \ignorespaces}
+
+\def\showSETUPnumber
+ {\doglobal\increment\currentSETUPargument
+ \hbox to 2em
+ {\ifcase\maximumSETUPargument\relax
+ \or*\else\currentSETUPargument
+ \fi
+ \hss}}
+
+\def\showSETUPassignment #1{\showSETUP{#1}{[.\lower.5ex\hbox{=}.]} {[..,.\lower.5ex\hbox{=}.,..]}}
+\def\showSETUPkeyword #1{\showSETUP{#1}{[...]} {[...,...]}}
+\def\showSETUPargument #1{\showSETUP{#1}{\leftargument..\rightargument} {\leftargument..,...,..\rightargument}}
+\def\showSETUPdisplaymath#1{\showSETUP{#1}{\$\$...\$\$} {\$\$...\$\$}}
+\def\showSETUPindex #1{\showSETUP{#1}{\leftargument...\rightargument} {\leftargument..+...+..\rightargument}}
+\def\showSETUPmath #1{\showSETUP{#1}{\$...\$} {\$...\$}}
+\def\showSETUPnothing #1{\showSETUP{#1}{...} {}}
+\def\showSETUPfile #1{\showSETUP{#1}{~...~} {}}
+\def\showSETUPposition #1{\showSETUP{#1}{(...)} {(...,...)}}
+\def\showSETUPreference #1{\showSETUP{#1}{[...]} {[...,...]}}
+\def\showSETUPcsname #1{\showSETUP{#1}{{\c!setup!command!{}}} {}}
+\def\showSETUPdestination#1{\showSETUP{#1}{[\leftargument..[ref]\rightargument]}{[..,\leftargument..[ref,..]\rightargument,..]}}
+\def\showSETUPtriplet #1{\showSETUP{#1}{[x:y:z=]} {[x:y:z=,..]}}
+\def\showSETUPword #1{\showSETUP{#1}{\leftargument...\rightargument} {\leftargument.. ... ..\rightargument}}
+\def\showSETUPcontent #1{\showSETUP{#1}{\leftargument...\rightargument} {\leftargument.. ... ..\rightargument}}
- function document.setups.load(filename)
- filename = resolvers.find_file(filename) or ""
- if filename ~= "" and not document.setups.loaded[filename] then
- local loaded = xml.load(filename)
- if loaded then
- if document.setups.root then
- xml.inject(document.setups.root,"/",loaded)
- else
- document.setups.root = loaded
- end
- document.setups.loaded[filename] = true
- end
- end
- end
- function document.setups.name(ek)
- local at = ek.at
- local name = at.name
- if at.type == 'environment' then
- name = "start" .. name
- end
- if at.variant then
- name = name .. ":" .. at.variant
- end
- if at.generated == "yes" then
- name = name .. "*"
- end
- return name:lower()
- end
- function document.setups.show(name)
- if document.setups.root then
- local name = name:gsub("[<>]","")
- local setup = xml.first(document.setups.root,"cd:command[@name='" .. name .. "']")
- document.setups.used[#document.setups.used+1] = setup
- xml.sprint(setup)
- end
- end
- function document.setups.showused()
- if document.setups.root and next(document.setups.used) then
- for k,v in ipairs(table.sortedkeys(document.setups.used)) do
- xml.sprint(document.setups.used[v])
- end
- end
- end
- function document.setups.showall()
- if document.setups.root then
- local list = { }
- xml.each_element(document.setups.root,"cd:command", function(r,d,t)
- local ek = d[t]
- list[document.setups.name(ek)] = ek
- end )
- for k,v in ipairs(table.sortedkeys(list)) do
- xml.sprint(list[v])
- end
- end
- end
- function document.setups.resolve(name)
- if document.setups.root then
- local e = xml.filter(document.setups.root,string.format("cd:define[@name='%s']/text()",name))
- if e then
- xml.sprint(e)
- end
- end
- end
- end
-\stopluacode
-
-\def\mkloadsetups #1{\ctxlua{document.setups.load("#1")}}
-\def\mkshowsetup #1{\ctxlua{document.setups.show("#1")}}
-\def\mkshowusedsetups {\bgroup\enableXML\ctxlua{document.setups.showused()}\egroup}
-\def\mkshowallsetups {\bgroup\enableXML\ctxlua{document.setups.showall ()}\egroup}
-
-\def\mkshowsetup #1{\bgroup\enableXML\ctxlua{document.setups.show("#1")}\egroup}
-
-\defineXMLenvironmentsave [cd:define] [name=]
- {}
-
-\defineXMLsingular [cd:resolve] [name=]
- {\enableXML\ignorespaces\ctxlua{document.setups.resolve("\XMLop{name}")}}
-
-\endinput
-
-% \starttext
-% \loadsetups[cont-en.xml]
-% \setup[goto]
-% \placeeverysetup
-% \stoptext
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-set-11.tex b/Master/texmf-dist/tex/context/base/x-set-11.tex
index 6fcc7f9341c..920fd7426d0 100644
--- a/Master/texmf-dist/tex/context/base/x-set-11.tex
+++ b/Master/texmf-dist/tex/context/base/x-set-11.tex
@@ -12,807 +12,99 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% module x-set-02 loads the mapping, after that we can say:
-%
-% texmfstart texexec --int=nl --pdf --global --result=setup-nl x-set-12
-%
-% \getinterfacecomponent{constant|variable|string}{tag}
-
-\usemodule[set-02]
-
\loadmarkfile{x-set-11}
-\ifx\mkloadsetups\undefined \let\mkloadsetups \gobbleoneargument \fi
-\ifx\mkshowsetup \undefined \let\mkshowsetup \gobbleoneargument \fi
-\ifx\mkusedsetups\undefined \let\mkusedsetups \gobbleoneargument \fi
-\ifx\mkallsetups \undefined \let\mkallsetups \gobbleoneargument \fi
-
-\unprotect
-
-% general
-
-\def\setupnumfont {}
-\def\setuptxtfont {}
-\def\setupintfont#1{\uppercase{#1}}
-\def\setupvarfont {\sl}
-\def\setupoptfont {\sl}
-\def\setupalwcolor {}
-\def\setupoptcolor {darkgray}
-
-\defineXMLenvironmentsave [cd:content] [list=,state=]
- {\simpleSETUPargument{content}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\startmessages dutch library: setup
- title: setup
- formula: formule
- number: getal
- list: lijst
- dimension: maat
- mark: markering
- reference: verwijzing
- command: commando
- file: file
- name: naam
- identifier: naam
- text: tekst
- section: sectie
- singular: naam enkelvoud
- plural: naam meervoud
- matrix: n*m
- see: zie
- inherits: erft van
- 1: de karakters < en > zijn globaal actief!
- 2: -- wordt verwerkt
- 3: -- is niet gedefinieerd
- 4: -- wordt nogmaals verwerkt
- optional: optioneel
- displaymath: formule
- index: ingang
- math: formule
- nothing: leeg
- file: file
- position: positie
- reference: verwijzing
- csname: naam
- destination: bestemming
- triplet: triplet
- word: woord
- content: tekst
-\stopmessages
-
-\startmessages english library: setup
- title: setup
- formula: formula
- number: number
- list: list
- dimension: dimension
- mark: mark
- reference: reference
- command: command
- file: file
- name: name
- identifier: identifier
- text: text
- section: section
- singular: singular name
- plural: plural name
- matrix: n*m
- see: see
- inherits: inherits from
- 1: the characters < and > are globally active!
- 2: -- is processed
- 3: -- is undefined
- 4: -- is processed again
- optional: optional
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages german library: setup
- title: Setup
- formula: Formel
- number: Nummer
- list: Liste
- dimension: Dimension
- mark: Beschriftung
- reference: Referenz
- command: Befehl
- file: Datei
- name: Name
- identifier: Name
- text: Text
- section: Abschnitt
- singular: singular
- plural: plural
- matrix: n*m
- see: siehe
- inherits: inherits from
- 1: Die Zeichen < und > gelten global!
- 2: -- wird verarbeitet
- 3: -- ist undefiniert
- 4: -- ist mehrmals verarbeitet
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages czech library: setup
- title: setup
- formula: rovnice
- number: cislo
- list: seznam
- dimension: dimenze
- mark: znacka
- reference: reference
- command: prikaz
- file: soubor
- name: jmeno
- identifier: jmeno
- text: text
- section: sekce
- singular: jmeno v singularu
- plural: jmeno v pluralu
- matrix: n*m
- see: viz
- inherits: inherits from
- 1: znaky < a > jsou globalne aktivni!
- 2: -- je zpracovano
- 3: -- je nedefinovano
- 4: -- je zpracovano znovu
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages italian library: setup
- title: setup
- formula: formula
- number: number
- list: list
- dimension: dimension
- mark: mark
- reference: reference
- command: command
- file: file
- name: name
- identifier: name
- text: text
- section: section
- singular: singular name
- plural: plural name
- matrix: n*m
- see: see
- inherits: inherits from
- 1: the characters < and > are globally active!
- 2: -- is processed
- 3: -- is undefined
- 4: -- is processed again
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages romanian library: setup
- title: setari
- formula: formula
- number: numar
- list: lista
- dimension: dimensiune
- mark: marcaj
- reference: referinta
- command: comanda
- file: fisier
- name: nume
- identifier: nume
- text: text
- section: sectiune
- singular: nume singular
- plural: nume pluram
- matrix: n*m
- see: vezi
- inherits: inherits from
- 1: caracterele < si > sunt active global!
- 2: este procesat --
- 3: -- este nedefinit
- 4: -- este procesat din nou
- optional: optioneel
- displaymath: formula
- index: entry
- math: formula
- nothing: empty
- file: file
- position: position
- reference: reference
- csname: name
- destination: destination
- triplet: triplet
- word: word
- content: text
-\stopmessages
-
-\startmessages french library: setup
- title: réglage
- formula: formule
- number: numéro
- list: liste
- dimension: dimension
- mark: marquage
- reference: reference
- command: commande
- file: fichier
- name: nom
- identifier: identificateur
- text: texte
- section: section
- singular: nom singulier
- plural: nom pluriel
- matrix: n*m
- see: vois
- inherits: herite de
- 1: les caractères < et > sont globalement actifs !
- 2: -- est traité
- 3: -- n'est pas défini
- 4: -- est traité de nouveau
- optional: optionel
- displaymath: formule
- index: entrée
- math: formule
- nothing: vide
- file: fichier
- position: position
- reference: réference
- csname: nom
- destination: destination
- triplet: triplet
- word: mot
- content: texte
-\stopmessages
-
-\def\c!setup!internal!#1%
- {{\setmessagetext{setup}{#1}%
- \expanded{\setupintfont{\currentmessagetext}}}}
-
-\def\c!setup!text!#1%
- {{\setmessagetext{setup}{#1}%
- \setupvarfont{\currentmessagetext}}}
-
-\def\c!setup!command!#1%
- {{\setupvarfont{\texescape...#1}}}
-
-\def\??stp{@@stp}
-
-\defineregister
- [texmacro]
- [texmacros]
-
-\definesorting
- [texcommand]
- [texcommands]
-
-\setupsorting
- [texcommand]
- [\c!command=\@@stpcommand,
- \c!criterium=\@@stpcriterium]
-
-\definesorting
- [eachtexcommand]
- [alltexcommands]
-
-\setupsorting
- [eachtexcommand]
- [\c!command=\@@stpcommand,
- \c!criterium=\v!all]
-
-\pushmacro\setuptext
-
-\defineframedtext
- [setuptext]
- [\c!width=\hsize,
- \c!height=\v!fit,
- \c!align=\v!right,
- \c!offset=0.75em]
-
-\popmacro\setuptext
-
-\newif\ifshortsetup
-
-\def\doshowsetup
- {\dosingleempty\dodoshowsetup}
-
-\def\dodoshowsetup[#1]%
- {\iffirstargument
- \mkshowsetup{#1}%
- \else
- \expandafter\mkshowsetup
- \fi}
-
-\def\setup {\shortsetupfalse\doshowsetup}
-\def\showsetup {\shortsetupfalse\doshowsetup}
-\def\shortsetup{\shortsetuptrue \doshowsetup}
-\def\setupsetup{\dodoubleargument\getparameters[\??stp]}
-
-\setupsetup
- [\c!before=,
- \c!after=,
- \c!command=\setup,
- \c!criterium=\v!used]
-
-% verwijzing: 0 geen verwijzingen plaatsen / wel genereren
-% 1 alleen bij zie plaatsen / wel genereren
-% 2 alle verwijzingen plaatsen / niet genereren
-% 3 bij zie commando klikken / wel genereren
-
-\setupsetup
- [\c!reference=0]
-
-\def\placesetup
- {\bgroup
- \mkshowusedsetups
- \egroup}
-
-\def\placeallsetups
- {\bgroup
- \setupsetup[\c!reference=2]%
- \setupreferencing[\c!state=\v!stop]%
- \mkshowallsetups
- \egroup}
-
-\let\placeeverysetup\placeallsetups
-
-\let\plaatssetup \placesetup
-\let\plaatselkesetup\placeallsetups
-
-% we use :1 as fallback
-%
-% \setup{setupinterlinespace}
-% \setup{setupinterlinespace:1}
-% \setup{setupinterlinespace:2}
-
-
-\defineXMLenvironment [cd:command] [name=,type=,generated=,interactive=,variant=]
- {}
- {\showSETUPrecord}
-
-\def\showSETUPrecord
- {\getvalue{\e!start setuptext}
- \tttf
- \nohyphens
- \veryraggedright
- \startXMLmapping [one]
- \doglobal\newcounter\currentSETUPargument
- \global\let\maximumSETUPargument\currentSETUPargument
- \bgroup
- \doif{\XMLpar{cd:command}{generated}{}}{yes}{\ttsl}%
- \doifelseXMLop{type}{environment}
- {\tex{\e!start}}{\tex{}}\ignorespaces
- \XMLflush{cd:sequence}\ignorespaces
- \egroup
- \doifelseXMLempty{cd:arguments}
- {}
- {\bgroup
- \setbox0=\hbox{\XMLflush{cd:arguments}}%
- \global\let\maximumSETUPargument\currentSETUPargument
- \doglobal\newcounter\currentSETUPargument
- \ignorespaces\XMLflush{cd:arguments}%
- \doif{\XMLpar{cd:command}{type}{}}{environment}
- {\hskip.5em\unknown\hskip.5em
- \doif{\XMLpar{cd:command}{generated}{}}{yes}{\ttsl}%
- \tex{\e!stop}\ignorespaces\XMLflush{cd:sequence}}%
- \endgraf
- \egroup
- %\bgroup
- % \tx
- % \doif{\XMLpar{cd:command}{interactive}{}}{yes} {\quad INTERACTIVE}%
- % \doif{\XMLpar{cd:command}{interactive}{}}{exclusive}{\quad INTERACTIVE ONLY}%
- %\egroup
- \startXMLmapping [two]
- \bgroup
- \doglobal\newcounter\currentSETUPargument
- \blank[\v!line]
- \switchtobodyfont[small] % kan sneller
- \ignorespaces\XMLflush{cd:arguments}\endgraf
- \egroup
- \stopXMLmapping}
- \stopXMLmapping
- \getvalue{\e!stop setuptext}}
-
-\defineXMLenvironmentsave [cd:sequence] \ignorespaces \ignorespaces
-\defineXMLenvironmentsave [cd:arguments] \ignorespaces \ignorespaces
-
-%D This is the first pass; here we generate the top line.
-
-\newcounter\currentSETUPargument
-\def\currentSETUPwidth{0pt}
-
-% environmentsave ?
-
-\startXMLmapping [one]
-
-\defineXMLenvironmentsave [cd:string] [value=]
- {\getinterfacecomponent{string}{\XMLop{value}}\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:variable] [value=]
- {{\expanded{\setupintfont{\getinterfacecomponent{variable}{\XMLop{value}}}}}\ignorespaces}
- {\ignorespaces}
-
-% moet een standaard type worden
-
-\defineXMLenvironmentsave [cd:assignments] [list=,state=]
- {\showSETUPassignment\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:keywords] [list=,state=]
- {\showSETUPkeyword\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:content] [list=,state=]
- {\showSETUPcontent\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:displaymath] [list=,state=]
- {\showSETUPdisplaymath\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:index] [list=,state=]
- {\showSETUPindex\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:math] [list=,state=]
- {\showSETUPmath\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:nothing] [list=,state=]
- {\showSETUPnothing\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:file] [list=,state=]
- {\showSETUPfile\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:position] [list=,state=]
- {\showSETUPposition\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:reference] [list=,state=]
- {\showSETUPreference\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:csname] [list=,state=]
- {\showSETUPcsname\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:destination] [list=,state=]
- {\showSETUPdestination\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:triplet] [list=,state=]
- {\showSETUPtriplet\ignorespaces} {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:word] [list=,state=]
- {\showSETUPword\ignorespaces} {\ignorespaces}
-
-\stopXMLmapping
-
-%D This is the second pass; here we generate the table.
-
-\startXMLmapping [two]
-
-\def\startfirstSETUPcolumn#1%
- {\bgroup
- \advance\leftskip 2em
- \noindent\llap{\hbox to 2em{#1\hss}}}
-
-\def\stopfirstSETUPcolumn
- {\endgraf
- \egroup}
-
-\def\startsecondSETUPcolumn#1#2%
- {\bgroup
- \advance\hangindent \currentSETUPwidth
- \advance\hangindent 2.5em
- \noindent \hbox to \hangindent{#1\hss\hbox to 2.5em{\hss#2\hss}}}
-
-\def\stopsecondSETUPcolumn
- {\endgraf
- \egroup}
-
-\def\secondSETUPcolumn#1#2%
- {\startsecondSETUPcolumn{#1}{#2}\stopsecondSETUPcolumn}
-
-\def\previousSETUPargument{\currentSETUPargument}
-
-\defineXMLenvironmentsave [cd:assignments]
- {}
- {\xdef\currentSETUPwidth{0pt}%
- \bgroup
- \defineXMLenvironment [cd:parameter] [name=]
- {\setbox0=\hbox{\potentialXMLentity{\getinterfacecomponent{constant}{\XMLop{name}}}}%
- \ifdim\wd0>\currentSETUPwidth\xdef\currentSETUPwidth{\the\wd0}\fi}%
- {}
- \setbox0=\vbox{\XMLflush{cd:assignments}}%
- \egroup
- \startfirstSETUPcolumn{\showSETUPnumber}%
- \doifelseXMLempty{cd:assignments}
- {\secondSETUPcolumn{\c!setup!text!{see} \previousSETUPargument}{}}
- {\ignorespaces
- \XMLflush{cd:assignments}%
- \let\previousSETUPargument\currentSETUPargument}%
- \stopfirstSETUPcolumn
- \blank[\v!halfline]
- \ignorespaces}
-
-\defineXMLenvironmentsave [cd:keywords] [optional=no]
+\endinput
+
+% Old code, a mixture of loading in mkiv and processing in mkii.
+
+\startluacode
+ do
+ document = document or { }
+
+ document.setups = {
+ loaded = { },
+ root = nil,
+ used = { },
+ }
+
+ function document.setups.load(filename)
+ filename = resolvers.find_file(filename) or ""
+ if filename ~= "" and not document.setups.loaded[filename] then
+ local loaded = xml.load(filename)
+ if loaded then
+ if document.setups.root then
+ xml.inject(document.setups.root,"/",loaded)
+ else
+ document.setups.root = loaded
+ end
+ document.setups.loaded[filename] = true
+ end
+ end
+ end
+ function document.setups.name(ek)
+ local at = ek.at
+ local name = at.name
+ if at.type == 'environment' then
+ name = "start" .. name
+ end
+ if at.variant then
+ name = name .. ":" .. at.variant
+ end
+ if at.generated == "yes" then
+ name = name .. "*"
+ end
+ return name:lower()
+ end
+ function document.setups.show(name)
+ if document.setups.root then
+ local name = name:gsub("[<>]","")
+ local setup = xml.first(document.setups.root,"cd:command[@name='" .. name .. "']")
+ document.setups.used[#document.setups.used+1] = setup
+ xml.sprint(setup)
+ end
+ end
+ function document.setups.showused()
+ if document.setups.root and next(document.setups.used) then
+ for k,v in ipairs(table.sortedkeys(document.setups.used)) do
+ xml.sprint(document.setups.used[v])
+ end
+ end
+ end
+ function document.setups.showall()
+ if document.setups.root then
+ local list = { }
+ xml.each_element(document.setups.root,"cd:command", function(r,d,t)
+ local ek = d[t]
+ list[document.setups.name(ek)] = ek
+ end )
+ for k,v in ipairs(table.sortedkeys(list)) do
+ xml.sprint(list[v])
+ end
+ end
+ end
+ function document.setups.resolve(name)
+ if document.setups.root then
+ local e = xml.filter(document.setups.root,string.format("cd:define[@name='%s']/text()",name))
+ if e then
+ xml.sprint(e)
+ end
+ end
+ end
+ end
+\stopluacode
+
+\def\mkloadsetups #1{\ctxlua{document.setups.load("#1")}}
+\def\mkshowsetup #1{\ctxlua{document.setups.show("#1")}}
+\def\mkshowusedsetups {\bgroup\enableXML\ctxlua{document.setups.showused()}\egroup}
+\def\mkshowallsetups {\bgroup\enableXML\ctxlua{document.setups.showall ()}\egroup}
+
+\def\mkshowsetup #1{\bgroup\enableXML\ctxlua{document.setups.show("#1")}\egroup}
+
+\defineXMLenvironmentsave [cd:define] [name=]
{}
- {\startfirstSETUPcolumn{\showSETUPnumber}%
- \doifelseXMLempty{cd:keywords}
- {\secondSETUPcolumn{see \previousSETUPargument}{}}
- {\ignorespaces
- \XMLflush{cd:keywords}%
- \let\previousSETUPargument\currentSETUPargument}%
- \stopfirstSETUPcolumn
- \blank[\v!halfline]
- \ignorespaces}
-
-\defineXMLenvironment [cd:parameter] [name=]
- {\startsecondSETUPcolumn{\potentialXMLentity{\getinterfacecomponent{constant}{\XMLop{name}}}}{=}%
- \ignorespaces}
- {\stopsecondSETUPcolumn
- \ignorespaces}
-
-\defineXMLenvironmentsave [cd:constant] [type=,default=]
- {\doifXMLop{default}{yes}{\underbar}%
- {\potentialXMLentity{\getinterfacecomponent{variable}{\XMLop{type}}}}\quad\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:variable] [type=]
- {\potentialXMLentity{\getinterfacecomponent{variable}{\XMLop{type}}}\quad\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:inherit] [name=]
- {\secondSETUPcolumn{\c!setup!text!{inherits} \tex{}\getinterfacecomponent{string}{\XMLop{name}}}{}\ignorespaces}
- {\ignorespaces}
-
-\def\simpleSETUPargument#1%
- {\startfirstSETUPcolumn{\showSETUPnumber}%
- \c!setup!internal!{#1}%
- \stopfirstSETUPcolumn}
-
-\defineXMLenvironmentsave [cd:content] [list=,state=]
- {\simpleSETUPargument{content}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:displaymath] [list=,state=]
- {\simpleSETUPargument{display math}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:index] [list=,state=]
- {\simpleSETUPargument{index}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:math] [list=,state=]
- {\simpleSETUPargument{math}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:nothing] [list=,state=]
- {\simpleSETUPargument{nothing}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:file] [list=,state=]
- {\simpleSETUPargument{file name}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:position] [list=,state=]
- {\simpleSETUPargument{position}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:reference] [list=,state=]
- {\simpleSETUPargument{reference}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:csname] [list=,state=]
- {\simpleSETUPargument{csname}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:destination] [list=,state=]
- {\simpleSETUPargument{destination}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:triplet] [list=,state=]
- {\simpleSETUPargument{triplet}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\defineXMLenvironmentsave [cd:word] [list=,state=]
- {\simpleSETUPargument{word}\blank[\v!halfline]\ignorespaces}
- {\ignorespaces}
-
-\stopXMLmapping
-
-\defineXMLentity [cd:command] {\c!setup!internal!{command}}
-\defineXMLentity [cd:dimension] {\c!setup!internal!{dimension}}
-\defineXMLentity [cd:file] {\c!setup!internal!{file}}
-\defineXMLentity [cd:name] {\c!setup!internal!{identifier}}
-\defineXMLentity [cd:character] {\c!setup!internal!{character}}
-\defineXMLentity [cd:mark] {\c!setup!internal!{mark}}
-\defineXMLentity [cd:number] {\c!setup!internal!{number}}
-\defineXMLentity [cd:reference] {\c!setup!internal!{reference}}
-\defineXMLentity [cd:plural] {\c!setup!internal!{plural}}
-\defineXMLentity [cd:singular] {\c!setup!internal!{singular}}
-\defineXMLentity [cd:text] {\c!setup!internal!{text}}
-\defineXMLentity [cd:formula] {\c!setup!internal!{formula}}
-\defineXMLentity [cd:file] {\c!setup!internal!{file}}
-\defineXMLentity [cd:matrix] {\c!setup!internal!{matrix}}
-\defineXMLentity [cd:list] {\c!setup!internal!{list}}
-\defineXMLentity [cd:section] {\c!setup!internal!{section}}
-
-\defineXMLentity [cd:noargument] {\c!setup!command!{}}
-\defineXMLentity [cd:oneargument] {\c!setup!command!{\#1}}
-\defineXMLentity [cd:twoarguments] {\c!setup!command!{\#1\#2}}
-\defineXMLentity [cd:threearguments] {\c!setup!command!{\#1\#2\#3}}
-
-%D Todo:
-
-\defineXMLprocess [cd:choice]
-
-%D Auxiliary.
-
-\unexpanded\def\showSETUP#1#2%
- {\bgroup
- \doglobal\increment\currentSETUPargument
- \setbox0=\hbox
- {\doifelseXMLop{list}{yes}{#2}{#1}}%
- \setbox2=\hbox to \wd0
- {\hss
- \raise1ex\hbox
- {\tx\ifcase\maximumSETUPargument\relax
- \or*\else\currentSETUPargument
- \fi}%
- \hss}%
- \setbox4=\hbox to \wd0
- {\hss
- \lower2ex\hbox
- \bgroup
- \txx\doifXMLop{optional}{yes}{\c!setup!internal!{optional}}%
- \egroup
- \hss}%
- \ht2\ht\strutbox
- \dp4\dp\strutbox
- \hskip.5em\hsmash{\box0}\hsmash{\box4}\box2%
- \egroup}
-
-\def\showSETUPnumber
- {\doglobal\increment\currentSETUPargument
- \hbox to 2em
- {\ifcase\maximumSETUPargument\relax
- \or*\else\currentSETUPargument
- \fi
- \hss}}
-
-\def\showSETUPassignment {\showSETUP
- {[.\lower.5ex\hbox{=}.]}
- {[..,.\lower.5ex\hbox{=}.,..]}}
-
-\def\showSETUPkeyword {\showSETUP
- {[...]}
- {[...,...]}}
-
-\def\showSETUPargument {\showSETUP
- {\leftargument..\rightargument}
- {\leftargument..,...,..\rightargument}}
-
-\def\showSETUPdisplaymath {\showSETUP
- {\$\$...\$\$}
- {\$\$...\$\$}}
-
-\def\showSETUPindex {\showSETUP
- {\leftargument...\rightargument}
- {\leftargument..+...+..\rightargument}}
-
-\def\showSETUPmath {\showSETUP
- {\$...\$}
- {\$...\$}}
-
-\def\showSETUPnothing {\showSETUP
- {...}
- {}}
-
-\def\showSETUPfile {\showSETUP
- {~...~}
- {}}
-
-\def\showSETUPposition {\showSETUP
- {(...)}
- {(...,...)}}
-
-\def\showSETUPreference {\showSETUP
- {[...]}
- {[...,...]}}
-
-\def\showSETUPcsname {\showSETUP
- {{\c!setup!command!{}}}
- {}}
-
-\def\showSETUPdestination {\showSETUP
- {[\leftargument..[ref]\rightargument]}
- {[..,\leftargument..[ref,..]\rightargument,..]}}
-
-\def\showSETUPtriplet {\showSETUP
- {[x:y:z=]}
- {[x:y:z=,..]}}
-
-\def\showSETUPword {\showSETUP
- {\leftargument...\rightargument}
- {\leftargument.. ... ..\rightargument}}
-
-\def\showSETUPcontent {\showSETUP
- {\leftargument...\rightargument}
- {\leftargument.. ... ..\rightargument}}
-
-%\def\c!par!{\c!setup!internal!{endofpar}}
-%\def\c!repeat!{\c!opt!{{\setupvarfont n}*}}
-%\showSETUP\def\c!par!{\texescape par}
-%\showSETUP\def\c!sep!{\texescape\texescape}
-%\def\c!par!{\addtypespec{delimiter}{par}} % \par
-%\def\c!sep!{\addtypespec{separator}{backslash}} % \\
-%\def\c!repeat!{}
-%\def\c!tex!#1{\addtypespec{command}{#1}\doanother{tex}}
-
-\startXMLmapping[zero]
-
-\defineXMLenvironmentsave [cd:command] [name=,type=,generated=,interactive=,variant=]
- {}
- {\doifelseXMLop{type}{environment}
- {\edef\currentSETUPname{start\getinterfacecomponent{string}{\XMLop{name}}}}
- {\edef\currentSETUPname{\getinterfacecomponent{string}{\XMLop{name}}}}%
- \doifsomething{\XMLop{variant}}
- {\edef\currentSETUPname{\currentSETUPname:\XMLop{variant}}}% like setupinterlinespace:1
- \doifXMLop{generated}{yes}
- {\edef\currentSETUPname{\currentSETUPname*}}%
- \doglobal\saveXMLdatainelement{stp:\currentSETUPname}{cd:command}{cd:command}%
- \expanded{\eachtexcommand[stp:x:\currentSETUPname]{\currentSETUPname}}%
- \expanded{\texcommand [stp:y:\currentSETUPname]{\currentSETUPname}}}
-
-\stopXMLmapping
-
-\def\loadsetups{\complexorsimple\loadsetups}
-
-\def\simpleloadsetups
- {\doifnotmode{no-setup-main}
- {\complexloadsetups[cont-en.xml]}}
-
-\def\complexloadsetups[#1]%
- {\doifsomething{#1}{\mkloadsetups{#1}}}
-\defineXMLsingular [cd:include] [file=]
- {\complexloadsetups[\XMLop{file}]}
+\defineXMLsingular [cd:resolve] [name=]
+ {\enableXML\ignorespaces\ctxlua{document.setups.resolve("\XMLop{name}")}}
-\protect \endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-set-12.tex b/Master/texmf-dist/tex/context/base/x-set-12.tex
index 2659df0d86e..d7990143365 100644
--- a/Master/texmf-dist/tex/context/base/x-set-12.tex
+++ b/Master/texmf-dist/tex/context/base/x-set-12.tex
@@ -16,7 +16,10 @@
\unprotect
-\loadsetups
+% \starttext
+% \setup{installlanguage}
+% \placesetup
+% \stoptext
\definecolor[TitleColor][r=.375,g=.125,b=.125]
\definecolor[TitleColor][r=.125,g=.375,b=.125]
@@ -32,6 +35,14 @@
\definecolor[TitleColor][r=.15,g=.20,b=.25]
\definecolor[TitleColor][r=.15,g=.25,b=.20]
+\startinterface english \loadsetups[cont-en.xml] \stopinterface
+\startinterface dutch \loadsetups[cont-nl.xml] \stopinterface
+\startinterface german \loadsetups[cont-de.xml] \stopinterface
+\startinterface french \loadsetups[cont-fr.xml] \stopinterface
+\startinterface italian \loadsetups[cont-it.xml] \stopinterface
+\startinterface czech \loadsetups[cont-cs.xml] \stopinterface
+\startinterface romanian \loadsetups[cont-ro.xml] \stopinterface
+
\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface
\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface
\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface
@@ -61,7 +72,7 @@
\definecolor [lightgray] [s=.9]
\definecolor [darkgray] [s=.1]
-\usetypescript[palatino][\defaultencoding]
+\usetypescript[palatino]
\setupbodyfont[palatino,9pt]
\setupcolors
@@ -181,9 +192,9 @@
\startmakeup[\v!standard]
\dontcomplain
+ \setupalign[\v!left]
\startcolor[TitleColor]
\definedfont[RegularBold at 100pt]\setstrut
- \setupalign[\v!left]
\strut Con\TeX t \par
\definedfont[RegularBold at 50pt]\setstrut
\setups[text:commands]
diff --git a/Master/texmf-dist/tex/context/base/x-set-99.tex b/Master/texmf-dist/tex/context/base/x-set-99.tex
new file mode 100644
index 00000000000..64d2b1db385
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-set-99.tex
@@ -0,0 +1,283 @@
+%D \module
+%D [ file=x-set-99,
+%D version=2004.10.31,
+%D remark=setupx.tex: 1998.07.20 and later,
+%D title=\CONTEXT\ Setup Definitions,
+%D subtitle=Macro Definitions,
+%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.
+
+% shared list
+
+\startmessages dutch library: setup
+ title: setup
+ formula: formule
+ number: getal
+ list: lijst
+ dimension: maat
+ mark: markering
+ reference: verwijzing
+ command: commando
+ file: file
+ name: naam
+ identifier: naam
+ text: tekst
+ section: sectie
+ singular: naam enkelvoud
+ plural: naam meervoud
+ matrix: n*m
+ see: zie
+ inherits: erft van
+ 1: de karakters < en > zijn globaal actief!
+ 2: -- wordt verwerkt
+ 3: -- is niet gedefinieerd
+ 4: -- wordt nogmaals verwerkt
+ optional: optioneel
+ displaymath: formule
+ index: ingang
+ math: formule
+ nothing: leeg
+ file: file
+ position: positie
+ reference: verwijzing
+ csname: naam
+ destination: bestemming
+ triplet: triplet
+ word: woord
+ content: tekst
+\stopmessages
+
+\startmessages english library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: identifier
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optional
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages german library: setup
+ title: Setup
+ formula: Formel
+ number: Nummer
+ list: Liste
+ dimension: Dimension
+ mark: Beschriftung
+ reference: Referenz
+ command: Befehl
+ file: Datei
+ name: Name
+ identifier: Name
+ text: Text
+ section: Abschnitt
+ singular: singular
+ plural: plural
+ matrix: n*m
+ see: siehe
+ inherits: inherits from
+ 1: Die Zeichen < und > gelten global!
+ 2: -- wird verarbeitet
+ 3: -- ist undefiniert
+ 4: -- ist mehrmals verarbeitet
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages czech library: setup
+ title: setup
+ formula: rovnice
+ number: cislo
+ list: seznam
+ dimension: dimenze
+ mark: znacka
+ reference: reference
+ command: prikaz
+ file: soubor
+ name: jmeno
+ identifier: jmeno
+ text: text
+ section: sekce
+ singular: jmeno v singularu
+ plural: jmeno v pluralu
+ matrix: n*m
+ see: viz
+ inherits: inherits from
+ 1: znaky < a > jsou globalne aktivni!
+ 2: -- je zpracovano
+ 3: -- je nedefinovano
+ 4: -- je zpracovano znovu
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages italian library: setup
+ title: setup
+ formula: formula
+ number: number
+ list: list
+ dimension: dimension
+ mark: mark
+ reference: reference
+ command: command
+ file: file
+ name: name
+ identifier: name
+ text: text
+ section: section
+ singular: singular name
+ plural: plural name
+ matrix: n*m
+ see: see
+ inherits: inherits from
+ 1: the characters < and > are globally active!
+ 2: -- is processed
+ 3: -- is undefined
+ 4: -- is processed again
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages romanian library: setup
+ title: setari
+ formula: formula
+ number: numar
+ list: lista
+ dimension: dimensiune
+ mark: marcaj
+ reference: referinta
+ command: comanda
+ file: fisier
+ name: nume
+ identifier: nume
+ text: text
+ section: sectiune
+ singular: nume singular
+ plural: nume pluram
+ matrix: n*m
+ see: vezi
+ inherits: inherits from
+ 1: caracterele < si > sunt active global!
+ 2: este procesat --
+ 3: -- este nedefinit
+ 4: -- este procesat din nou
+ optional: optioneel
+ displaymath: formula
+ index: entry
+ math: formula
+ nothing: empty
+ file: file
+ position: position
+ reference: reference
+ csname: name
+ destination: destination
+ triplet: triplet
+ word: word
+ content: text
+\stopmessages
+
+\startmessages french library: setup
+ title: réglage
+ formula: formule
+ number: numéro
+ list: liste
+ dimension: dimension
+ mark: marquage
+ reference: reference
+ command: commande
+ file: fichier
+ name: nom
+ identifier: identificateur
+ text: texte
+ section: section
+ singular: nom singulier
+ plural: nom pluriel
+ matrix: n*m
+ see: vois
+ inherits: herite de
+ 1: les caractères < et > sont globalement actifs !
+ 2: -- est traité
+ 3: -- n'est pas défini
+ 4: -- est traité de nouveau
+ optional: optionel
+ displaymath: formule
+ index: entrée
+ math: formule
+ nothing: vide
+ file: fichier
+ position: position
+ reference: réference
+ csname: nom
+ destination: destination
+ triplet: triplet
+ word: mot
+ content: texte
+\stopmessages
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-xtag.mkiv b/Master/texmf-dist/tex/context/base/x-xtag.mkiv
new file mode 100644
index 00000000000..d7e2f25595d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-xtag.mkiv
@@ -0,0 +1,23 @@
+%D \module
+%D [ file=x-xtag,
+%D version=2009.09.23,
+%D title=\CONTEXT\ Modules,
+%D subtitle=\XML\ stream handler,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ifdefined\XMLbanner \endinput \fi
+
+\loadcorefile{xtag-ini}
+\loadcorefile{xtag-ext}
+\loadcorefile{xtag-exp}
+\loadcorefile{xtag-pre} % has old encoding code
+\loadcorefile{xtag-xsd} % will go away (stub anyway)
+\loadcorefile{xtag-rng} % will go away (stub anyway)
+
+\endinput